kernel_samsung_a53x/net/xfrm
Sabrina Dubroca b7a65631b5 xfrm: validate new SA's prefixlen using SA family when sel.family is unset
[ Upstream commit 3f0ab59e6537c6a8f9e1b355b48f9c05a76e8563 ]

This expands the validation introduced in commit 07bf7908950a ("xfrm:
Validate address prefix lengths in the xfrm selector.")

syzbot created an SA with
    usersa.sel.family = AF_UNSPEC
    usersa.sel.prefixlen_s = 128
    usersa.family = AF_INET

Because of the AF_UNSPEC selector, verify_newsa_info doesn't put
limits on prefixlen_{s,d}. But then copy_from_user_state sets
x->sel.family to usersa.family (AF_INET). Do the same conversion in
verify_newsa_info before validating prefixlen_{s,d}, since that's how
prefixlen is going to be used later on.

Reported-by: syzbot+cc39f136925517aed571@syzkaller.appspotmail.com
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Antony Antony <antony.antony@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:22:02 +01:00
..
espintcp.c
Kconfig
Makefile
xfrm_algo.c
xfrm_compat.c
xfrm_device.c xfrm: extract dst lookup parameters into a struct 2024-11-23 23:22:00 +01:00
xfrm_hash.c
xfrm_hash.h
xfrm_inout.h
xfrm_input.c xfrm: Preserve vlan tags for transport mode software GRO 2024-11-19 11:32:45 +01:00
xfrm_interface_core.c
xfrm_ipcomp.c
xfrm_output.c
xfrm_policy.c xfrm: respect ip protocols rules criteria when performing dst lookups 2024-11-23 23:22:00 +01:00
xfrm_proc.c
xfrm_replay.c
xfrm_state.c
xfrm_sysctl.c
xfrm_user.c xfrm: validate new SA's prefixlen using SA family when sel.family is unset 2024-11-23 23:22:02 +01:00