ok, I have to retract my initial assertion that this is not a problem.
Indeed for IPv4 the breakage is not visible, but IPv6 in anything other
than fib_index zero is not usable.
The uninitialized entries in the IPv6 fib_index_to_table_index point to a
*IPv4* session table. Of course that does not work and will crash.

The fact that fib_index is passed a u8 into session_table_get_or_alloc does
not help either. A invalid fib_index of ~0 is converted to 255 and
the fib_index_to_table_index for IPv6 happily extendeds to 255 entries.

I'll try to come up with a fix, unless someone beats me to it.

Regards,
Andreas

Am Do., 23. Apr. 2020 um 09:07 Uhr schrieb Andreas Schultz via lists.fd.io
<andreas.schultz=travelping....@lists.fd.io>:

> Hi,
>
> While trying to troubleshoot a session problem, I've come
> across session_table_get_or_alloc:
>
> https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=src/vnet/session/session_lookup.c;h=4de6fdbe547499fcd256e387370cc5bf0c810206;hb=refs/heads/master#l158
>
> To me it looks like this function could leave holes of invalid/wrong
> table_indexes in the fib_index_to_table_index.
>
> Index 0 is initialized explicitly (fib_index = 0), but the other indexes
> are only initialized with a valid session table index when the first
> session in that fib_index is opened.
> When the first session happens to be in e.g. fib_index 10, all indexes
> from 1 up to including 9 are filled with zero (by vec_validate). The
> problem is that for those fib indexes the session table index is now 0.
> Fortunately, that session table index is valid, because it points to the
> session table for fib_index 0. However, it also means that sessions from
> the various fibs leak into each other.
>
> Or do I miss something?
>
> Regards
> Andreas
>
> --
>
> Andreas Schultz
>
> --
> 
>


-- 

Andreas Schultz
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16146): https://lists.fd.io/g/vpp-dev/message/16146
Mute This Topic: https://lists.fd.io/mt/73213863/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to