Li RongQing 1bb30a41da bpf: Return -EBADRQC for invalid map type in __bpf_tx_xdp_map
[ Upstream commit 0a29275b6300f39f78a87f2038bbfe5bdbaeca47 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-24 08:34:47 +01:00
..
2019-10-11 18:21:12 +02:00
2019-06-22 08:15:13 +02:00
2019-12-05 09:21:30 +01:00
2020-01-17 19:47:07 +01:00
2018-07-24 14:10:42 -07:00
2020-01-29 16:43:24 +01:00
2019-01-09 17:38:33 +01:00
2018-07-24 14:10:43 -07:00
2020-01-17 19:47:07 +01:00