Re: [PATCHv2 bpf 1/2] bpf: Support sk lookup in netns with id 0
From: Nicolas Dichtel <hidden>
Date: 2018-11-30 20:00:01
From: Nicolas Dichtel <hidden>
Date: 2018-11-30 20:00:01
Le 30/11/2018 à 01:29, Joe Stringer a écrit :
David Ahern and Nicolas Dichtel report that the handling of the netns id 0 is incorrect for the BPF socket lookup helpers: rather than finding the netns with id 0, it is resolving to the current netns. This renders the netns_id 0 inaccessible. To fix this, adjust the API for the netns to treat all negative s32 values as a lookup in the current netns, while any values with a positive value in the signed 32-bit integer space would result in a lookup for a socket in the netns corresponding to that id. As before, if the netns with that ID does not exist, no socket will be found. Furthermore, if any bits are set in the upper 32-bits, then no socket will be found. Signed-off-by: Joe Stringer <redacted>
Acked-by: Nicolas Dichtel <redacted>