Sean Tranchetti
32bf94fb5c
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 because: kasan: bad access detected
[ 140.597981] page_owner info is not active (free page?)
[ 140.603267]
[ 140.653503] ================================================================
Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
2018-09-20 08:30:42 +02:00
..
2017-11-02 11:10:55 +01:00
2018-07-14 11:11:09 -07:00
2017-11-21 15:57:07 -08:00
2018-07-02 20:34:04 +09:00
2018-06-28 10:40:47 -07:00
2018-06-28 10:40:47 -07:00
2018-06-28 10:40:47 -07:00
2018-06-23 10:29:33 +02:00
2018-06-28 10:40:47 -07:00
2018-07-11 16:10:57 -07:00
2018-06-28 21:39:16 +09:00
2018-06-16 07:39:34 +09:00
2018-07-21 16:14:39 -07:00
2018-06-28 10:40:47 -07:00
2018-06-15 07:24:58 +09:00
2018-07-28 21:02:21 -07:00
2018-06-12 16:19:22 -07:00
2018-06-28 10:40:47 -07:00
2018-06-28 10:40:47 -07:00
2018-07-16 11:22:14 -07:00
2018-06-11 14:19:38 -07:00
2018-05-08 00:02:36 -04:00
2017-10-25 13:00:27 +09:00
2018-07-05 11:13:17 +02:00
2018-04-22 21:12:00 -04:00
2018-09-04 10:26:30 +02:00
2018-09-04 10:26:30 +02:00
2018-06-28 10:40:47 -07:00
2018-06-28 10:40:47 -07:00
2018-06-28 10:40:47 -07:00
2018-06-28 10:40:47 -07:00
2017-11-21 16:35:54 -08:00
2018-06-28 10:40:47 -07:00
2018-07-06 14:34:42 +02:00
2018-03-28 22:55:18 +02:00
2018-03-27 13:18:09 -04:00
2018-06-20 07:26:58 +09:00
2018-07-24 00:36:33 +02:00
2018-05-14 17:24:18 -04:00
2018-07-29 12:50:19 -07:00
2018-06-28 10:40:47 -07:00
2018-07-18 10:51:45 -07:00
2018-07-12 16:55:29 -07:00
2018-07-29 13:20:54 -07:00
2018-07-12 16:55:59 -07:00
2018-06-28 10:40:47 -07:00
2017-11-01 12:19:03 +09:00
2018-07-05 20:20:03 +09:00
2018-07-26 14:03:07 -07:00
2018-05-23 11:26:45 +02:00
2018-06-28 10:40:47 -07:00
2018-06-28 10:40:47 -07:00
2018-07-18 13:44:07 -07:00
2018-07-04 21:36:34 +09:00
2018-07-18 19:32:54 -07:00
2018-06-28 21:37:26 +09:00
2018-06-22 06:21:34 +09:00
2017-11-10 13:41:40 +09:00
2018-07-07 19:49:02 +09:00
2018-07-20 14:38:14 -07:00
2018-06-28 10:40:47 -07:00
2018-06-28 10:40:47 -07:00
2017-11-02 11:10:55 +01:00
2018-07-24 09:11:31 +02:00
2018-06-28 10:40:47 -07:00
2018-07-26 02:53:10 +02:00
2018-09-20 08:30:42 +02:00
2018-04-27 19:46:06 -04:00
2018-05-28 22:59:54 -04:00
2018-06-28 13:36:39 +09:00
2018-07-28 22:43:30 -07:00
2018-03-27 13:18:09 -04:00