android_kernel_samsung_msm8976/net/xfrm
Sean Tranchetti 3fcb04cc1d xfrm: validate template mode
XFRM mode parameters passed as part of the user templates
in the IP_XFRM_POLICY are never properly validated. Passing
values other than valid XFRM modes can cause stack-out-of-bounds
reads to occur later in the XFRM processing:

[  140.535608] ================================================================
[  140.543058] BUG: KASAN: stack-out-of-bounds in xfrm_state_find+0x17e4/0x1cc4
[  140.550306] Read of size 4 at addr ffffffc0238a7a58 by task repro/5148
[  140.557369]
[  140.558927] Call trace:
[  140.558936] dump_backtrace+0x0/0x388
[  140.558940] show_stack+0x24/0x30
[  140.558946] __dump_stack+0x24/0x2c
[  140.558949] dump_stack+0x8c/0xd0
[  140.558956] print_address_description+0x74/0x234
[  140.558960] kasan_report+0x240/0x264
[  140.558963] __asan_report_load4_noabort+0x2c/0x38
[  140.558967] xfrm_state_find+0x17e4/0x1cc4
[  140.558971] xfrm_resolve_and_create_bundle+0x40c/0x1fb8
[  140.558975] xfrm_lookup+0x238/0x1444
[  140.558977] xfrm_lookup_route+0x48/0x11c
[  140.558984] ip_route_output_flow+0x88/0xc4
[  140.558991] raw_sendmsg+0xa74/0x266c
[  140.558996] inet_sendmsg+0x258/0x3b0
[  140.559002] sock_sendmsg+0xbc/0xec
[  140.559005] SyS_sendto+0x3a8/0x5a8
[  140.559008] el0_svc_naked+0x34/0x38
[  140.559009]
[  140.592245] page dumped becaus: kasan: bad access detected
[  140.597981] page_owner info is not active (free page?)
[  140.603267]
[  140.653503] ================================================================

Change-Id: I5d2fa78a9d950c79d83d759bfd4d0f399fed18a4
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
2019-09-28 20:28:33 +02:00
..
Kconfig net/xfrm: remove depends on CONFIG_EXPERIMENTAL 2013-01-11 11:40:03 -08:00
Makefile xfrm: make xfrm_algo.c a module 2012-05-15 13:13:34 -04:00
xfrm_algo.c ANDROID: make PF_KEY SHA256 use RFC-compliant truncation. 2019-07-27 21:49:54 +02:00
xfrm_hash.c
xfrm_hash.h
xfrm_input.c xfrm: Use __skb_queue_tail in xfrm_trans_queue 2019-07-27 21:46:26 +02:00
xfrm_ipcomp.c net: xfrm: use __this_cpu_read per-cpu helper 2012-11-13 14:38:52 +01:00
xfrm_output.c BACKPORT: net: xfrm: support setting an output mark. 2019-07-27 21:51:33 +02:00
xfrm_policy.c xfrm: Fix stack-out-of-bounds read on socket policy lookup. 2019-08-30 01:29:11 +02:00
xfrm_proc.c net: proc: change proc_net_remove to remove_proc_entry 2013-02-18 14:53:08 -05:00
xfrm_replay.c xfrm: Fix esn sequence number diff calculation in xfrm_replay_notify_esn() 2013-03-25 07:25:50 +01:00
xfrm_state.c xfrm: Fix bucket count reported to userspace 2019-07-27 22:08:35 +02:00
xfrm_sysctl.c net: Don't export sysctls to unprivileged users 2012-11-18 20:30:55 -05:00
xfrm_user.c xfrm: validate template mode 2019-09-28 20:28:33 +02:00