linux-stable/net/xdp
Magnus Karlsson ad8fb61c18 xsk: Add missing check on user supplied headroom size
[ Upstream commit 99e3a236dd ]

Add a check that the headroom cannot be larger than the available
space in the chunk. In the current code, a malicious user can set the
headroom to a value larger than the chunk size minus the fixed XDP
headroom. That way packets with a length larger than the supported
size in the umem could get accepted and result in an out-of-bounds
write.

Fixes: c0c77d8fb7 ("xsk: add user memory registration support sockopt")
Reported-by: Bui Quang Minh <minhquangbui99@gmail.com>
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=207225
Link: https://lore.kernel.org/bpf/1586849715-23490-1-git-send-email-magnus.karlsson@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-23 10:30:15 +02:00
..
Kconfig
Makefile
xdp_umem.c xsk: Add missing check on user supplied headroom size 2020-04-23 10:30:15 +02:00
xdp_umem.h
xdp_umem_props.h
xsk.c xsk: avoid store-tearing when assigning umem 2020-01-27 14:51:10 +01:00
xsk_queue.c
xsk_queue.h xsk: Properly terminate assignment in xskq_produce_flush_desc 2019-07-26 09:14:12 +02:00