diff options
author | Willem de Bruijn | 2018-09-24 22:49:57 +0200 |
---|---|---|
committer | Daniel Borkmann | 2018-09-25 17:31:19 +0200 |
commit | d0e13a1488ad30dc3c2c9347b931cb10f892e3a4 (patch) | |
tree | 1a15d2fdf34411e490eb568710becbf156b97dac /include/linux/console_struct.h | |
parent | bpftool: add support for BPF_MAP_TYPE_REUSEPORT_SOCKARRAY maps (diff) | |
download | kernel-qcow2-linux-d0e13a1488ad30dc3c2c9347b931cb10f892e3a4.tar.gz kernel-qcow2-linux-d0e13a1488ad30dc3c2c9347b931cb10f892e3a4.tar.xz kernel-qcow2-linux-d0e13a1488ad30dc3c2c9347b931cb10f892e3a4.zip |
flow_dissector: lookup netns by skb->sk if skb->dev is NULL
BPF flow dissectors are configured per network namespace.
__skb_flow_dissect looks up the netns through dev_net(skb->dev).
In some dissector paths skb->dev is NULL, such as for Unix sockets.
In these cases fall back to looking up the netns by socket.
Analyzing the codepaths leading to __skb_flow_dissect I did not find
a case where both skb->dev and skb->sk are NULL. Warn and fall back to
standard flow dissector if one is found.
Fixes: d58e468b1112 ("flow_dissector: implements flow dissector BPF hook")
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux/console_struct.h')
0 files changed, 0 insertions, 0 deletions