]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Return -EBADRQC for invalid map type in __bpf_tx_xdp_map
authorLi RongQing <lirongqing@baidu.com>
Fri, 10 Jan 2020 01:04:37 +0000 (09:04 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 14 Jan 2020 19:32:24 +0000 (20:32 +0100)
commit242c562a01034c94f4d175b570ee6cd0d6b107df
tree1d8ed61d64ce17f6f067eca367d76d0fa531ab46
parent95842aee8549fd6d357f78970ff307966b339e57
bpf: Return -EBADRQC for invalid map type in __bpf_tx_xdp_map

A negative value should be returned if map->map_type is invalid
although that is impossible now, but if we run into such situation
in future, then xdpbuff could be leaked.

Daniel Borkmann suggested:

-EBADRQC should be returned to stay consistent with generic XDP
for the tracepoint output and not to be confused with -EOPNOTSUPP
from other locations like dev_map_enqueue() when ndo_xdp_xmit is
missing and such.

Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/1578618277-18085-1-git-send-email-lirongqing@baidu.com
net/core/filter.c