general protection fault in __lock_acquire

8 views
Skip to first unread message

syzbot

unread,
Apr 12, 2019, 8:00:53 PM4/12/19
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: e70c132b ANDROID: xattr: Pass EOPNOTSUPP to permission2
git tree: android-4.4
console output: https://syzkaller.appspot.com/x/log.txt?x=130b7725800000
kernel config: https://syzkaller.appspot.com/x/.config?x=c329588c9963e90f
dashboard link: https://syzkaller.appspot.com/bug?extid=60dcb218e358a98c13d9
compiler: gcc (GCC) 7.1.1 20170620
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12ceaef9800000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14c41ab5800000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+60dcb2...@syzkaller.appspotmail.com

audit: type=1400 audit(1516905091.637:6): avc: denied { write } for
pid=3329 comm="syzkaller476655"
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
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory accessgeneral
protection fault: 0000 [#1] PREEMPT SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in:
CPU: 1 PID: 3329 Comm: syzkaller476655 Not tainted 4.4.113-ge70c132 #34
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
task: ffff8800b461af80 task.stack: ffff8800b47f8000
RIP: 0010:[<ffffffff81236989>] [<ffffffff81236989>]
__lock_acquire+0x5c9/0x4b50 kernel/locking/lockdep.c:3092
RSP: 0018:ffff8800b47ff460 EFLAGS: 00010006
RAX: dffffc0000000000 RBX: ffff8800b461af80 RCX: 0000000000000000
RDX: 0000000000000005 RSI: 0000000000000001 RDI: 0000000000000028
RBP: ffff8800b47ff600 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 1ffff100168ffe9e R12: 0000000000000000
R13: ffff8800b461af80 R14: 0000000000000028 R15: 0000000000000000
FS: 0000000001566880(0063) GS:ffff8801db300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020023000 CR3: 00000000b4d78000 CR4: 0000000000160670
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Stack:
ffffffff842bdba0 0000000000000000 ffff8800b47ff620 ffffffff81236f1f
0000000041b58ab3 ffffffff83fb1858 ffffffff812363c0 0000000082e0107b
dffffc0000000000 ffff8800b461b830 ffff8800b461b7e0 ffff8800b461b7e8
Call Trace:
[<ffffffff8123c77e>] lock_acquire+0x15e/0x460 kernel/locking/lockdep.c:3592
[<ffffffff83770e1a>] __raw_spin_lock_bh
include/linux/spinlock_api_smp.h:137 [inline]
[<ffffffff83770e1a>] _raw_spin_lock_bh+0x3a/0x50
kernel/locking/spinlock.c:175
[<ffffffff82fa3a75>] spin_lock_bh include/linux/spinlock.h:307 [inline]
[<ffffffff82fa3a75>] nfulnl_set_flags net/netfilter/nfnetlink_log.c:319
[inline]
[<ffffffff82fa3a75>] nfulnl_recv_config+0x935/0x1430
net/netfilter/nfnetlink_log.c:932
[<ffffffff82f97603>] nfnetlink_rcv_msg+0xa63/0xbc0
net/netfilter/nfnetlink.c:215
[<ffffffff82f889be>] netlink_rcv_skb+0x13e/0x370
net/netlink/af_netlink.c:2349
[<ffffffff82f95b7e>] nfnetlink_rcv+0x29e/0x1070
net/netfilter/nfnetlink.c:479
[<ffffffff82f87542>] netlink_unicast_kernel net/netlink/af_netlink.c:1267
[inline]
[<ffffffff82f87542>] netlink_unicast+0x522/0x760
net/netlink/af_netlink.c:1293
[<ffffffff82f88068>] netlink_sendmsg+0x8e8/0xc50
net/netlink/af_netlink.c:1847
[<ffffffff82dea0aa>] sock_sendmsg_nosec net/socket.c:625 [inline]
[<ffffffff82dea0aa>] sock_sendmsg+0xca/0x110 net/socket.c:635
[<ffffffff82debc81>] ___sys_sendmsg+0x6c1/0x7c0 net/socket.c:1962
[<ffffffff82dedcd3>] __sys_sendmsg+0xd3/0x190 net/socket.c:1996
[<ffffffff82deddbd>] SYSC_sendmsg net/socket.c:2007 [inline]
[<ffffffff82deddbd>] SyS_sendmsg+0x2d/0x50 net/socket.c:2003
[<ffffffff83771b5f>] entry_SYSCALL_64_fastpath+0x1c/0x98
Code: 25 28 00 00 00 0f 85 0e 31 00 00 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41
5f 5d c3 48 b8 00 00 00 00 00 fc ff df 4c 89 f2 48 c1 ea 03 <80> 3c 02 00
0f 85 94 32 00 00 49 81 3e 20 39 a2 84 41 ba 00 00
RIP [<ffffffff81236989>] __lock_acquire+0x5c9/0x4b50
kernel/locking/lockdep.c:3092
RSP <ffff8800b47ff460>
---[ end trace 9b5fca9472a60778 ]---


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Apr 13, 2019, 8:00:37 PM4/13/19
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 25063787
git tree: android-4.9
console output: https://syzkaller.appspot.com/x/log.txt?x=1279e091800000
kernel config: https://syzkaller.appspot.com/x/.config?x=4fadd453521adb
dashboard link: https://syzkaller.appspot.com/bug?extid=3fdad6e3bdc26c4bcf3a
compiler: gcc (GCC) 7.1.1 20170620
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16c22c21800000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=129f019e800000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+3fdad6...@syzkaller.appspotmail.com

==================================================================
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in:
CPU: 0 PID: 3844 Comm: syzkaller977133 Not tainted 4.9.71-g2506378 #113
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
task: ffff8801c5ee9800 task.stack: ffff8801c5ef8000
RIP: 0010:[<ffffffff8123a1b4>] [<ffffffff8123a1b4>]
__lock_acquire+0x194/0x3640 kernel/locking/lockdep.c:3234
RSP: 0018:ffff8801c5eff8e0 EFLAGS: 00010086
RAX: dead4ead00000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 1ffff10038f88950 RSI: 0000000000000000 RDI: ffff8801c7c44a80
RBP: ffff8801c5effaa0 R08: 0000000000000001 R09: 0000000000000001
R10: 0000000000000000 R11: ffff8801c5ee9800 R12: 0000000000000001
R13: 0000000000000001 R14: 0000000000000000 R15: ffff8801c7c44a78
FS: 00007fb399772700(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb399771e78 CR3: 00000001c8971000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Stack:
ffffffff814ccab0 ffff8801c939caa8 ffff8801c5ee9800 ffffed0038bdd415
dffffc0000000000 ffff8801c8a3e5c0 0000000000000000 ffff8801c5eea0b0
ffff8801c5eea088 ffff8801c5eff9e0 0000000000000246 ffff8801c5ee9800
Call Trace:
[<ffffffff8123e09e>] lock_acquire+0x12e/0x410 kernel/locking/lockdep.c:3756
[<ffffffff838aeede>] __raw_write_lock_irqsave
include/linux/rwlock_api_smp.h:186 [inline]
[<ffffffff838aeede>] _raw_write_lock_irqsave+0x4e/0x62
kernel/locking/spinlock.c:303
[<ffffffff82664ba0>] sg_remove_request+0x70/0x120 drivers/scsi/sg.c:2122
[<ffffffff826651b5>] sg_finish_rem_req+0x295/0x340 drivers/scsi/sg.c:1838
[<ffffffff82666fec>] sg_read+0xa1c/0x1440 drivers/scsi/sg.c:527
[<ffffffff81569903>] __vfs_read+0x103/0x670 fs/read_write.c:452
[<ffffffff8156d69e>] vfs_read+0x11e/0x380 fs/read_write.c:475
[<ffffffff815713c9>] SYSC_read fs/read_write.c:591 [inline]
[<ffffffff815713c9>] SyS_read+0xd9/0x1b0 fs/read_write.c:584
[<ffffffff838aef85>] entry_SYSCALL_64_fastpath+0x23/0xc6
Code: 9e ff ff 44 8b 94 24 98 00 00 00 48 85 c0 8b 8c 24 90 00 00 00 44 8b
8c 24 88 00 00 00 4c 8b 9c 24 80 00 00 00 0f 84 ff 07 00 00 <f0> ff 80 98
01 00 00 49 8d b3 a8 08 00 00 48 ba 00 00 00 00 00
RIP [<ffffffff8123a1b4>] __lock_acquire+0x194/0x3640
kernel/locking/lockdep.c:3234
RSP <ffff8801c5eff8e0>
---[ end trace 83f0cb5afceb023a ]---
Kernel panic - not syncing: Fatal exception
BUG: KASAN: slab-out-of-bounds in __read_once_size
include/linux/compiler.h:243 [inline]
BUG: KASAN: slab-out-of-bounds in list_empty include/linux/list.h:189
[inline]
BUG: KASAN: slab-out-of-bounds in sg_remove_request+0x103/0x120
drivers/scsi/sg.c:2120
Read of size 8 at addr ffff8801c7c44bc0 by task syzkaller977133/3843

CPU: 1 PID: 3843 Comm: syzkaller977133 Tainted: G D
4.9.71-g2506378 #113
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
ffff8801c5ef7ab0 ffffffff81d922b9 ffffea00071f1100 ffff8801c7c44bc0
0000000000000000 ffff8801c7c44bc0 ffff8801c5de2338 ffff8801c5ef7ae8
ffffffff8153bab3 ffff8801c7c44bc0 0000000000000008 0000000000000000
Call Trace:
[<ffffffff81d922b9>] __dump_stack lib/dump_stack.c:15 [inline]
[<ffffffff81d922b9>] dump_stack+0xc1/0x128 lib/dump_stack.c:51
[<ffffffff8153bab3>] print_address_description+0x73/0x280
mm/kasan/report.c:252
[<ffffffff8153bfd5>] kasan_report_error mm/kasan/report.c:351 [inline]
[<ffffffff8153bfd5>] kasan_report+0x275/0x360 mm/kasan/report.c:408
[<ffffffff8153c134>] __asan_report_load8_noabort+0x14/0x20
mm/kasan/report.c:429
[<ffffffff82664c33>] __read_once_size include/linux/compiler.h:243 [inline]
[<ffffffff82664c33>] list_empty include/linux/list.h:189 [inline]
[<ffffffff82664c33>] sg_remove_request+0x103/0x120 drivers/scsi/sg.c:2120
[<ffffffff826651b5>] sg_finish_rem_req+0x295/0x340 drivers/scsi/sg.c:1838
[<ffffffff82666fec>] sg_read+0xa1c/0x1440 drivers/scsi/sg.c:527
[<ffffffff81569903>] __vfs_read+0x103/0x670 fs/read_write.c:452
[<ffffffff8156d69e>] vfs_read+0x11e/0x380 fs/read_write.c:475
[<ffffffff815713c9>] SYSC_read fs/read_write.c:591 [inline]
[<ffffffff815713c9>] SyS_read+0xd9/0x1b0 fs/read_write.c:584
[<ffffffff838aef85>] entry_SYSCALL_64_fastpath+0x23/0xc6

Allocated by task 0:
(stack is not available)

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8801c7c44b80
which belongs to the cache fasync_cache of size 96
The buggy address is located 64 bytes inside of
96-byte region [ffff8801c7c44b80, ffff8801c7c44be0)
The buggy address belongs to the page:
page:ffffea00071f1100 count:1 mapcount:0 mapping: (null) index:0x0
flags: 0x8000000000000080(slab)
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8801c7c44a80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
ffff8801c7c44b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
> ffff8801c7c44b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff8801c7c44c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8801c7c44c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
Dumping ftrace buffer:
(ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..
Reply all
Reply to author
Forward
0 new messages