KASAN: slab-out-of-bounds Read in firmware_fallback_sysfs

7 views
Skip to first unread message

syzbot

unread,
May 18, 2020, 1:41:15 AM5/18/20
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: b818fc58 ANDROID: Incremental fs: wake up log pollers less..
git tree: android-5.4
console output: https://syzkaller.appspot.com/x/log.txt?x=1709ec9c100000
kernel config: https://syzkaller.appspot.com/x/.config?x=3ae0ea53623d798b
dashboard link: https://syzkaller.appspot.com/bug?extid=ab6013550cb5f94f6509
compiler: Android (6032204 based on r370808) clang version 10.0.1 (https://android.googlesource.com/toolchain/llvm-project 6e765c10313d15c02ab29977a82938f66742c3a9)

Unfortunately, I don't have any reproducer for this crash yet.

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

platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
platform regulatory.0: Falling back to sysfs fallback for: regulatory.db
==================================================================
BUG: KASAN: slab-out-of-bounds in __list_add_valid+0x36/0xc0 lib/list_debug.c:23
Read of size 8 at addr ffff8881c9960388 by task syz-executor.2/9583

CPU: 1 PID: 9583 Comm: syz-executor.2 Not tainted 5.4.41-syzkaller-00234-gb818fc58f06b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x14a/0x1ce lib/dump_stack.c:118
print_address_description+0x93/0x620 mm/kasan/report.c:374
__kasan_report+0x16d/0x1e0 mm/kasan/report.c:506
kasan_report+0x34/0x60 mm/kasan/common.c:634
__list_add_valid+0x36/0xc0 lib/list_debug.c:23
__list_add include/linux/list.h:60 [inline]
list_add include/linux/list.h:79 [inline]
fw_load_sysfs_fallback drivers/base/firmware_loader/fallback.c:515 [inline]
fw_load_from_user_helper drivers/base/firmware_loader/fallback.c:580 [inline]
firmware_fallback_sysfs+0x48d/0xb30 drivers/base/firmware_loader/fallback.c:654
_request_firmware+0xe82/0x1360 drivers/base/firmware_loader/main.c:783
request_firmware+0x33/0x50 drivers/base/firmware_loader/main.c:826
reg_reload_regdb+0xa6/0x220 net/wireless/reg.c:1083
genl_family_rcv_msg net/netlink/genetlink.c:629 [inline]
genl_rcv_msg+0xeef/0x13c0 net/netlink/genetlink.c:654
netlink_rcv_skb+0x200/0x480 net/netlink/af_netlink.c:2478
genl_rcv+0x24/0x40 net/netlink/genetlink.c:665
netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
netlink_unicast+0x8ad/0xa50 net/netlink/af_netlink.c:1329
netlink_sendmsg+0x9de/0xd80 net/netlink/af_netlink.c:1918
sock_sendmsg_nosec net/socket.c:638 [inline]
sock_sendmsg net/socket.c:658 [inline]
____sys_sendmsg+0x58a/0x8d0 net/socket.c:2298
___sys_sendmsg net/socket.c:2352 [inline]
__sys_sendmsg+0x2d5/0x3c0 net/socket.c:2398
do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45ca29
Code: 0d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 db b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f6b5bdadc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004fed80 RCX: 000000000045ca29
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000009
RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 000000000000097d R14: 00000000004d5e80 R15: 00007f6b5bdae6d4

Allocated by task 7047:
save_stack mm/kasan/common.c:69 [inline]
set_track mm/kasan/common.c:77 [inline]
__kasan_kmalloc+0x12c/0x1c0 mm/kasan/common.c:510
slab_post_alloc_hook mm/slab.h:584 [inline]
slab_alloc_node mm/slub.c:2766 [inline]
slab_alloc mm/slub.c:2774 [inline]
kmem_cache_alloc+0x1d5/0x260 mm/slub.c:2779
kmem_cache_zalloc include/linux/slab.h:680 [inline]
locks_alloc_lock fs/locks.c:346 [inline]
flock_make_lock fs/locks.c:487 [inline]
__do_sys_flock fs/locks.c:2234 [inline]
__se_sys_flock+0x149/0x530 fs/locks.c:2215
do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 7047:
save_stack mm/kasan/common.c:69 [inline]
set_track mm/kasan/common.c:77 [inline]
kasan_set_free_info mm/kasan/common.c:332 [inline]
__kasan_slab_free+0x181/0x230 mm/kasan/common.c:471
slab_free_hook mm/slub.c:1424 [inline]
slab_free_freelist_hook+0xd0/0x150 mm/slub.c:1457
slab_free mm/slub.c:3014 [inline]
kmem_cache_free+0xac/0x600 mm/slub.c:3030
locks_free_lock fs/locks.c:383 [inline]
__do_sys_flock fs/locks.c:2255 [inline]
__se_sys_flock+0x447/0x530 fs/locks.c:2215
do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9

The buggy address belongs to the object at ffff8881c9960270
which belongs to the cache file_lock_cache of size 248
The buggy address is located 32 bytes to the right of
248-byte region [ffff8881c9960270, ffff8881c9960368)
The buggy address belongs to the page:
page:ffffea0007265800 refcount:1 mapcount:0 mapping:ffff8881da8f4a00 index:0x0
flags: 0x8000000000000200(slab)
raw: 8000000000000200 dead000000000100 dead000000000122 ffff8881da8f4a00
raw: 0000000000000000 00000000000d000d 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8881c9960280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881c9960300: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
>ffff8881c9960380: fc fc fc fc fc fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881c9960400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881c9960480: fb fb fb fb fc fc fc fc fc fc fc fc fb fb fb fb
==================================================================
list_add corruption. next->prev should be prev (ffffffff84cb6570), but was 0000000000000000. (next=ffff8881c9960380).
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:25!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 9583 Comm: syz-executor.2 Tainted: G B 5.4.41-syzkaller-00234-gb818fc58f06b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__list_add_valid+0xa0/0xc0 lib/list_debug.c:23
Code: be ad 98 84 4c 89 fe 4c 89 e2 4c 89 f1 31 c0 e8 22 62 2f ff 0f 0b 48 c7 c7 09 ad 98 84 4c 89 e6 4c 89 f1 31 c0 e8 0c 62 2f ff <0f> 0b 48 c7 c7 6c ad 98 84 4c 89 f6 4c 89 e1 31 c0 e8 f6 61 2f ff
RSP: 0018:ffff888183fef2c8 EFLAGS: 00010246
RAX: 0000000000000075 RBX: ffff8881c9960388 RCX: f32afb4d829b4700
RDX: ffffc90003242000 RSI: 000000000003ffff RDI: 0000000000040000
RBP: ffff8881c9960380 R08: ffffffff812bdf2e R09: ffffed103b725df0
R10: ffffed103b725df0 R11: 0000000000000000 R12: ffffffff84cb6570
R13: dffffc0000000000 R14: ffff8881c9960380 R15: ffff8881c6397880
FS: 00007f6b5bdae700(0000) GS:ffff8881db900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa53e06e000 CR3: 0000000160b1a006 CR4: 00000000001606e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__list_add include/linux/list.h:60 [inline]
list_add include/linux/list.h:79 [inline]
fw_load_sysfs_fallback drivers/base/firmware_loader/fallback.c:515 [inline]
fw_load_from_user_helper drivers/base/firmware_loader/fallback.c:580 [inline]
firmware_fallback_sysfs+0x48d/0xb30 drivers/base/firmware_loader/fallback.c:654
_request_firmware+0xe82/0x1360 drivers/base/firmware_loader/main.c:783
request_firmware+0x33/0x50 drivers/base/firmware_loader/main.c:826
reg_reload_regdb+0xa6/0x220 net/wireless/reg.c:1083
genl_family_rcv_msg net/netlink/genetlink.c:629 [inline]
genl_rcv_msg+0xeef/0x13c0 net/netlink/genetlink.c:654
netlink_rcv_skb+0x200/0x480 net/netlink/af_netlink.c:2478
genl_rcv+0x24/0x40 net/netlink/genetlink.c:665
netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
netlink_unicast+0x8ad/0xa50 net/netlink/af_netlink.c:1329
netlink_sendmsg+0x9de/0xd80 net/netlink/af_netlink.c:1918
sock_sendmsg_nosec net/socket.c:638 [inline]
sock_sendmsg net/socket.c:658 [inline]
____sys_sendmsg+0x58a/0x8d0 net/socket.c:2298
___sys_sendmsg net/socket.c:2352 [inline]
__sys_sendmsg+0x2d5/0x3c0 net/socket.c:2398
do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45ca29
Code: 0d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 db b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f6b5bdadc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004fed80 RCX: 000000000045ca29
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000009
RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 000000000000097d R14: 00000000004d5e80 R15: 00007f6b5bdae6d4
Modules linked in:
---[ end trace 2d4ac945726a2b15 ]---
RIP: 0010:__list_add_valid+0xa0/0xc0 lib/list_debug.c:23
Code: be ad 98 84 4c 89 fe 4c 89 e2 4c 89 f1 31 c0 e8 22 62 2f ff 0f 0b 48 c7 c7 09 ad 98 84 4c 89 e6 4c 89 f1 31 c0 e8 0c 62 2f ff <0f> 0b 48 c7 c7 6c ad 98 84 4c 89 f6 4c 89 e1 31 c0 e8 f6 61 2f ff
RSP: 0018:ffff888183fef2c8 EFLAGS: 00010246
RAX: 0000000000000075 RBX: ffff8881c9960388 RCX: f32afb4d829b4700
RDX: ffffc90003242000 RSI: 000000000003ffff RDI: 0000000000040000
RBP: ffff8881c9960380 R08: ffffffff812bdf2e R09: ffffed103b725df0
R10: ffffed103b725df0 R11: 0000000000000000 R12: ffffffff84cb6570
R13: dffffc0000000000 R14: ffff8881c9960380 R15: ffff8881c6397880
FS: 00007f6b5bdae700(0000) GS:ffff8881db900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa53e075000 CR3: 0000000160b1a002 CR4: 00000000001606e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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

unread,
Jan 2, 2021, 11:24:16 PM1/2/21
to syzkaller-a...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages