1
0
Fork 0
alistair23-linux/net/xdp
Magnus Karlsson 25c9cdef57 xsk: Add missing check on user supplied headroom size
commit 99e3a236dd upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23 10:36:21 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
xdp_umem.c xsk: Add missing check on user supplied headroom size 2020-04-23 10:36:21 +02:00
xdp_umem.h xdp: fix hang while unregistering device bound to xdp socket 2019-07-03 15:10:55 +02:00
xsk.c xsk: Fix out of boundary write in __xsk_rcv_memcpy 2020-04-23 10:36:15 +02:00
xsk.h xsk: add support for need_wakeup flag in AF_XDP rings 2019-08-17 23:07:32 +02:00
xsk_diag.c xsk: lock the control mutex in sock_diag interface 2019-09-05 14:11:52 +02:00
xsk_queue.c net: xsk: add a simple buffer reuse queue 2018-09-25 13:13:15 -07:00
xsk_queue.h xsk: add support to allow unaligned chunk placement 2019-08-31 01:08:26 +02:00