syzbot


BUG: using __this_cpu_read() in preemptible code in ipcomp4_init_state

Status: fixed on 2018/04/23 15:29
Fix commit: net: xfrm: use preempt-safe this_cpu_read() in ipcomp_alloc_tfms()
First crash: 2245d, last: 2200d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 BUG: using __this_cpu_read() in preemptible code in ipcomp4_init_state 1 2278d 2278d 0/3 auto-closed as invalid on 2019/02/22 15:19

Sample crash report:
BUG: using __this_cpu_read() in preemptible [00000000] code: syz-executor1/8721
caller is __this_cpu_preempt_check+0x1c/0x20 lib/smp_processor_id.c:62
CPU: 1 PID: 8721 Comm: syz-executor1 Not tainted 4.4.119-g855ea74 #27
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 0000000000000000 c198ad1f71895bf9 ffff8800b21d7480 ffffffff81d0402d
 0000000000000001 ffffffff839fe5a0 ffffffff83d0be20 ffff8801cf95e000
 0000000000000003 ffff8800b21d74c0 ffffffff81d63f84 ffff8800b21d74d8
Call Trace:
 [<ffffffff81d0402d>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81d0402d>] dump_stack+0xc1/0x124 lib/dump_stack.c:51
 [<ffffffff81d63f84>] check_preemption_disabled+0x1d4/0x200 lib/smp_processor_id.c:46
 [<ffffffff81d63fec>] __this_cpu_preempt_check+0x1c/0x20 lib/smp_processor_id.c:62
audit: type=1401 audit(1520105720.732:36): op=setxattr invalid_context=280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000audit: type=1401 audit(1520105720.732:37): op=setxattr invalid_context=280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A004E2408000000FE8000000000000000000000000000BBFF7F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 [<ffffffff832e2d28>] ipcomp_alloc_tfms net/xfrm/xfrm_ipcomp.c:286 [inline]
audit: type=1401 audit(1520105720.732:36): op=setxattr invalid_context=280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000audit: type=1401 audit(1520105720.732:37): op=setxattr invalid_context=280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A004E2408000000FE8000000000000000000000000000BBFF7F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 [<ffffffff832e2d28>] ipcomp_init_state+0x188/0x980 net/xfrm/xfrm_ipcomp.c:363
 [<ffffffff8324aa90>] ipcomp4_init_state+0xb0/0x7d0 net/ipv4/ipcomp.c:137
 [<ffffffff832c1637>] __xfrm_init_state+0x3e7/0xb30 net/xfrm/xfrm_state.c:2058
 [<ffffffff832e0516>] xfrm_state_construct net/xfrm/xfrm_user.c:590 [inline]
 [<ffffffff832e0516>] xfrm_add_sa+0x1916/0x2e40 net/xfrm/xfrm_user.c:636
 [<ffffffff832d0a1c>] xfrm_user_rcv_msg+0x41c/0x6b0 net/xfrm/xfrm_user.c:2549
 [<ffffffff82f8b38e>] netlink_rcv_skb+0x13e/0x370 net/netlink/af_netlink.c:2349
 [<ffffffff832ccf4f>] xfrm_netlink_rcv+0x6f/0x90 net/xfrm/xfrm_user.c:2557
 [<ffffffff82f89f12>] netlink_unicast_kernel net/netlink/af_netlink.c:1267 [inline]
 [<ffffffff82f89f12>] netlink_unicast+0x522/0x760 net/netlink/af_netlink.c:1293
 [<ffffffff82f8aa38>] netlink_sendmsg+0x8e8/0xc50 net/netlink/af_netlink.c:1847
 [<ffffffff82deb88a>] sock_sendmsg_nosec net/socket.c:625 [inline]
 [<ffffffff82deb88a>] sock_sendmsg+0xca/0x110 net/socket.c:635
 [<ffffffff82ded461>] ___sys_sendmsg+0x6c1/0x7c0 net/socket.c:1962
 [<ffffffff82def4b3>] __sys_sendmsg+0xd3/0x190 net/socket.c:1996
 [<ffffffff82def59d>] SYSC_sendmsg net/socket.c:2007 [inline]
 [<ffffffff82def59d>] SyS_sendmsg+0x2d/0x50 net/socket.c:2003
 [<ffffffff8377365f>] entry_SYSCALL_64_fastpath+0x1c/0x98
BUG: using __this_cpu_read() in preemptible [00000000] code: syz-executor1/8721
caller is __this_cpu_preempt_check+0x1c/0x20 lib/smp_processor_id.c:62
CPU: 1 PID: 8721 Comm: syz-executor1 Not tainted 4.4.119-g855ea74 #27
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 0000000000000000 c198ad1f71895bf9 ffff8800b21d7480 ffffffff81d0402d
 0000000000000001 ffffffff839fe5a0 ffffffff83d0be20 ffff8801cf95e000
 0000000000000003 ffff8800b21d74c0 ffffffff81d63f84 ffff8800b21d74d8
Call Trace:
 [<ffffffff81d0402d>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81d0402d>] dump_stack+0xc1/0x124 lib/dump_stack.c:51
 [<ffffffff81d63f84>] check_preemption_disabled+0x1d4/0x200 lib/smp_processor_id.c:46
 [<ffffffff81d63fec>] __this_cpu_preempt_check+0x1c/0x20 lib/smp_processor_id.c:62
 [<ffffffff832e2d28>] ipcomp_alloc_tfms net/xfrm/xfrm_ipcomp.c:286 [inline]
 [<ffffffff832e2d28>] ipcomp_init_state+0x188/0x980 net/xfrm/xfrm_ipcomp.c:363
 [<ffffffff8324aa90>] ipcomp4_init_state+0xb0/0x7d0 net/ipv4/ipcomp.c:137
 [<ffffffff832c1637>] __xfrm_init_state+0x3e7/0xb30 net/xfrm/xfrm_state.c:2058
 [<ffffffff832e0516>] xfrm_state_construct net/xfrm/xfrm_user.c:590 [inline]
 [<ffffffff832e0516>] xfrm_add_sa+0x1916/0x2e40 net/xfrm/xfrm_user.c:636
 [<ffffffff832d0a1c>] xfrm_user_rcv_msg+0x41c/0x6b0 net/xfrm/xfrm_user.c:2549
 [<ffffffff82f8b38e>] netlink_rcv_skb+0x13e/0x370 net/netlink/af_netlink.c:2349
 [<ffffffff832ccf4f>] xfrm_netlink_rcv+0x6f/0x90 net/xfrm/xfrm_user.c:2557
 [<ffffffff82f89f12>] netlink_unicast_kernel net/netlink/af_netlink.c:1267 [inline]
 [<ffffffff82f89f12>] netlink_unicast+0x522/0x760 net/netlink/af_netlink.c:1293
 [<ffffffff82f8aa38>] netlink_sendmsg+0x8e8/0xc50 net/netlink/af_netlink.c:1847
 [<ffffffff82deb88a>] sock_sendmsg_nosec net/socket.c:625 [inline]
 [<ffffffff82deb88a>] sock_sendmsg+0xca/0x110 net/socket.c:635
 [<ffffffff82ded461>] ___sys_sendmsg+0x6c1/0x7c0 net/socket.c:1962
 [<ffffffff82def4b3>] __sys_sendmsg+0xd3/0x190 net/socket.c:1996
 [<ffffffff82def59d>] SYSC_sendmsg net/socket.c:2007 [inline]
 [<ffffffff82def59d>] SyS_sendmsg+0x2d/0x50 net/socket.c:2003
 [<ffffffff8377365f>] entry_SYSCALL_64_fastpath+0x1c/0x98
FAULT_FLAG_ALLOW_RETRY missing 30
CPU: 0 PID: 8798 Comm: syz-executor5 Not tainted 4.4.119-g855ea74 #27
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 0000000000000000 338538dc1821898b ffff8800b5b3f7d0 ffffffff81d0402d
 ffff8800b33bc000 1ffff10016b67f07 ffff8800b5b3f958 0000000000000000
 0000000000000000 ffff8800b5b3f980 ffffffff816072a5 ffffffff81237410
Call Trace:
 [<ffffffff81d0402d>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81d0402d>] dump_stack+0xc1/0x124 lib/dump_stack.c:51
 [<ffffffff816072a5>] handle_userfault+0x715/0xf50 fs/userfaultfd.c:316
 [<ffffffff814a2d48>] do_anonymous_page mm/memory.c:2731 [inline]
 [<ffffffff814a2d48>] handle_pte_fault mm/memory.c:3295 [inline]
 [<ffffffff814a2d48>] __handle_mm_fault mm/memory.c:3426 [inline]
 [<ffffffff814a2d48>] handle_mm_fault+0x2938/0x3190 mm/memory.c:3455
 [<ffffffff810dc6cb>] __do_page_fault+0x35b/0xa00 arch/x86/mm/fault.c:1245
 [<ffffffff810dcd97>] do_page_fault+0x27/0x30 arch/x86/mm/fault.c:1308
 [<ffffffff83774a88>] page_fault+0x28/0x30 arch/x86/entry/entry_64.S:1033
 [<ffffffff8155e7aa>] SYSC_select fs/select.c:648 [inline]
 [<ffffffff8155e7aa>] SyS_select+0x14a/0x1d0 fs/select.c:630
 [<ffffffff8377365f>] entry_SYSCALL_64_fastpath+0x1c/0x98
TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
audit: type=1400 audit(1520105722.632:38): avc:  denied  { attach_queue } for  pid=9035 comm="syz-executor4" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=tun_socket permissive=1
TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
netlink: 92 bytes leftover after parsing attributes in process `syz-executor2'.
binder: 9199:9206 got transaction with invalid offsets ptr
keychord: invalid keycode count 0
binder: 9199:9206 transaction failed 29201/-14, size 0-8 line 3156
binder: BINDER_SET_CONTEXT_MGR already set
binder: 9199:9206 ioctl 40046207 0 returned -16
binder_alloc: 9199: binder_alloc_buf, no vma
binder: 9199:9206 transaction failed 29189/-3, size 0-8 line 3128
binder: undelivered TRANSACTION_ERROR: 29189
binder: undelivered TRANSACTION_ERROR: 29201
binder: 9219:9220 got transaction with invalid offsets ptr
keychord: invalid keycode count 0
binder: 9219:9220 transaction failed 29201/-14, size 0-8 line 3156
binder: undelivered TRANSACTION_ERROR: 29201
binder: tried to use weak ref as strong ref
binder: 9265:9271 got transaction with invalid handle, 0
binder: 9265:9271 transaction failed 29201/-22, size 56-8 line 3220
binder: BINDER_SET_CONTEXT_MGR already set
binder: 9265:9276 ioctl 40046207 0 returned -16
binder_alloc: 9265: binder_alloc_buf, no vma
binder: 9265:9276 transaction failed 29189/-3, size 56-8 line 3128
binder: undelivered TRANSACTION_ERROR: 29189
binder: undelivered TRANSACTION_ERROR: 29201
audit: type=1326 audit(1520105723.672:39): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=9283 comm="syz-executor5" exe="/root/syz-executor5" sig=31 arch=c000003e syscall=202 compat=0 ip=0x453d69 code=0x0
binder: tried to use weak ref as strong ref
binder: 9310:9314 got transaction with invalid handle, 0
binder: 9310:9314 transaction failed 29201/-22, size 56-8 line 3220
binder: undelivered TRANSACTION_ERROR: 29201
IPv4: Oversized IP packet from 127.0.0.1
IPv4: Oversized IP packet from 127.0.0.1
Empty option to dns_resolver key
Empty option to dns_resolver key
netlink: 452 bytes leftover after parsing attributes in process `syz-executor5'.
netlink: 452 bytes leftover after parsing attributes in process `syz-executor5'.
IPVS: Creating netns size=2552 id=9
handle_userfault: 9 callbacks suppressed
FAULT_FLAG_ALLOW_RETRY missing 30
CPU: 0 PID: 9754 Comm: syz-executor7 Not tainted 4.4.119-g855ea74 #27
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 0000000000000000 c1cd322bf1742d4c ffff8801cc36f900 ffffffff81d0402d
 ffff8801d1349380 1ffff1003986df2d ffff8801cc36fa88 0000000000000000
 0000000000000000 ffff8801cc36fab0 ffffffff816072a5 ffffffff81237410
Call Trace:
 [<ffffffff81d0402d>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81d0402d>] dump_stack+0xc1/0x124 lib/dump_stack.c:51
 [<ffffffff816072a5>] handle_userfault+0x715/0xf50 fs/userfaultfd.c:316
 [<ffffffff814a2d48>] do_anonymous_page mm/memory.c:2731 [inline]
 [<ffffffff814a2d48>] handle_pte_fault mm/memory.c:3295 [inline]
 [<ffffffff814a2d48>] __handle_mm_fault mm/memory.c:3426 [inline]
 [<ffffffff814a2d48>] handle_mm_fault+0x2938/0x3190 mm/memory.c:3455
 [<ffffffff810dc6cb>] __do_page_fault+0x35b/0xa00 arch/x86/mm/fault.c:1245
 [<ffffffff810dcd97>] do_page_fault+0x27/0x30 arch/x86/mm/fault.c:1308
 [<ffffffff83774a88>] page_fault+0x28/0x30 arch/x86/entry/entry_64.S:1033
 [<ffffffff8154ff3e>] getname_flags+0x10e/0x580 fs/namei.c:146
 [<ffffffff815503c9>] getname+0x19/0x20 fs/namei.c:206
 [<ffffffff8151bfef>] do_sys_open+0x21f/0x660 fs/open.c:1032
 [<ffffffff8151c4a0>] SYSC_openat fs/open.c:1065 [inline]
 [<ffffffff8151c4a0>] SyS_openat+0x30/0x40 fs/open.c:1059
 [<ffffffff8377365f>] entry_SYSCALL_64_fastpath+0x1c/0x98
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket
binder: 9999:10001 ERROR: BC_REGISTER_LOOPER called without request
binder_alloc: binder_alloc_mmap_handler: 9999 20000000-20002000 already mapped failed -16
binder: BINDER_SET_CONTEXT_MGR already set
binder: 9999:10001 ioctl 40046207 0 returned -16
binder_alloc: 9999: binder_alloc_buf, no vma
binder: 9999:10008 transaction failed 29189/-3, size 0-0 line 3128
binder_alloc: binder_alloc_mmap_handler: 10027 20000000-20002000 already mapped failed -16
binder: 10119:10139 unknown command 536871232
binder: 10119:10139 ioctl c0306201 20000000 returned -22
audit: type=1400 audit(1520105728.202:43): avc:  denied  { accept } for  pid=10154 comm="syz-executor2" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1
binder: BINDER_SET_CONTEXT_MGR already set
binder: 10119:10174 ioctl 40046207 0 returned -16
netlink: 3 bytes leftover after parsing attributes in process `syz-executor4'.
netlink: 3 bytes leftover after parsing attributes in process `syz-executor4'.
IPVS: Creating netns size=2552 id=10
syz-executor3 (10499): /proc/10499/oom_adj is deprecated, please use /proc/10499/oom_score_adj instead.
audit: type=1400 audit(1520105730.412:44): avc:  denied  { bind } for  pid=10631 comm="syz-executor3" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1
SELinux: unrecognized netlink message: protocol=6 nlmsg_type=48523 sclass=netlink_xfrm_socket
SELinux: unrecognized netlink message: protocol=6 nlmsg_type=48523 sclass=netlink_xfrm_socket
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=4022 sclass=netlink_route_socket
SELinux: unrecognized netlink message: protocol=0 nlmsg_type=4022 sclass=netlink_route_socket

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/03/03 19:35 https://android.googlesource.com/kernel/common android-4.4 855ea747806b 2c6f473e .config console log report ci-android-44-kasan-gce
2018/04/17 22:40 https://android.googlesource.com/kernel/common android-4.4 38f41ec1cb31 b80fd3b5 .config console log report ci-android-44-kasan-gce-386
2018/03/17 01:43 https://android.googlesource.com/kernel/common android-4.4 d63fdf61a4dc 08dacaa0 .config console log report ci-android-44-kasan-gce-386
* Struck through repros no longer work on HEAD.