KASAN: use-after-free Read in firmware_fallback_sysfs

15 views
Skip to first unread message

syzbot

unread,
Apr 19, 2020, 12:26:15 AM4/19/20
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: d573071f ANDROID: GKI: abi update due to changes in 5.4.33
git tree: android-5.4
console output: https://syzkaller.appspot.com/x/log.txt?x=137b5b00100000
kernel config: https://syzkaller.appspot.com/x/.config?x=eb7ea42627cffd14
dashboard link: https://syzkaller.appspot.com/bug?extid=deda4d116cac59d52370
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+deda4d...@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: use-after-free in __list_add_valid+0x36/0xc0 lib/list_debug.c:23
Read of size 8 at addr ffff8881c8594288 by task syz-executor.4/17008

CPU: 0 PID: 17008 Comm: syz-executor.4 Not tainted 5.4.33-syzkaller-00454-gd573071fcc49 #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:0x45c869
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:00007ffa2186cc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007ffa2186d6d4 RCX: 000000000045c869
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000006
RBP: 000000000076c040 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000977 R14: 00000000004d5b60 R15: 000000000076c04c

Allocated by task 16932:
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
kmem_cache_alloc_trace+0xc3/0x280 mm/slub.c:2793
kmalloc include/linux/slab.h:556 [inline]
kzalloc include/linux/slab.h:690 [inline]
__allocate_fw_priv drivers/base/firmware_loader/main.c:174 [inline]
alloc_lookup_fw_priv drivers/base/firmware_loader/main.c:229 [inline]
_request_firmware_prepare drivers/base/firmware_loader/main.c:705 [inline]
_request_firmware+0x5ab/0x1360 drivers/base/firmware_loader/main.c:766
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

Freed by task 16932:
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]
kfree+0x12b/0x600 mm/slub.c:3975
__free_fw_priv drivers/base/firmware_loader/main.c:259 [inline]
kref_put include/linux/kref.h:65 [inline]
free_fw_priv drivers/base/firmware_loader/main.c:266 [inline]
firmware_free_data drivers/base/firmware_loader/main.c:541 [inline]
release_firmware+0x45f/0x4a0 drivers/base/firmware_loader/main.c:949
_request_firmware+0x181/0x1360 drivers/base/firmware_loader/main.c:790
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

The buggy address belongs to the object at ffff8881c8594200
which belongs to the cache kmalloc-192 of size 192
The buggy address is located 136 bytes inside of
192-byte region [ffff8881c8594200, ffff8881c85942c0)
The buggy address belongs to the page:
page:ffffea0007216500 refcount:1 mapcount:0 mapping:ffff8881da803000 index:0x0
flags: 0x8000000000000200(slab)
raw: 8000000000000200 ffffea00063bf340 0000000300000003 ffff8881da803000
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8881c8594180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff8881c8594200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881c8594280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff8881c8594300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8881c8594380: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
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,
Apr 19, 2020, 1:39:12 AM4/19/20
to syzkaller-a...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: d573071f ANDROID: GKI: abi update due to changes in 5.4.33
git tree: android-5.4
console output: https://syzkaller.appspot.com/x/log.txt?x=10d331d7e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=eb7ea42627cffd14
dashboard link: https://syzkaller.appspot.com/bug?extid=deda4d116cac59d52370
compiler: Android (6032204 based on r370808) clang version 10.0.1 (https://android.googlesource.com/toolchain/llvm-project 6e765c10313d15c02ab29977a82938f66742c3a9)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=105e1610100000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+deda4d...@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: use-after-free in __list_add_valid+0x36/0xc0 lib/list_debug.c:23
Read of size 8 at addr ffff8881d12b5788 by task syz-executor.3/7500

CPU: 0 PID: 7500 Comm: syz-executor.3 Not tainted 5.4.33-syzkaller-00454-gd573071fcc49 #0
RSP: 002b:00007f0a271f3c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f0a271f46d4 RCX: 000000000045c869
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003
RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000977 R14: 00000000004d5b60 R15: 000000000076bf0c

Allocated by task 7468:
Freed by task 7468:
The buggy address belongs to the object at ffff8881d12b5700
which belongs to the cache kmalloc-192 of size 192
The buggy address is located 136 bytes inside of
192-byte region [ffff8881d12b5700, ffff8881d12b57c0)
The buggy address belongs to the page:
page:ffffea000744ad40 refcount:1 mapcount:0 mapping:ffff8881da803000 index:0xffff8881d12b5200
flags: 0x8000000000000200(slab)
raw: 8000000000000200 ffffea0007676100 0000000400000004 ffff8881da803000
raw: ffff8881d12b5200 000000008010000f 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8881d12b5680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff8881d12b5700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881d12b5780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff8881d12b5800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881d12b5880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================

syzbot

unread,
May 21, 2020, 12:14:15 PM5/21/20
to syzkaller-a...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: 8ca74482 ANDROID: GKI update kernel abi for 5.4.42 merge
git tree: android-5.4
console output: https://syzkaller.appspot.com/x/log.txt?x=10e66272100000
kernel config: https://syzkaller.appspot.com/x/.config?x=5993e04cebb65bd0
dashboard link: https://syzkaller.appspot.com/bug?extid=deda4d116cac59d52370
compiler: Android (6032204 based on r370808) clang version 10.0.1 (https://android.googlesource.com/toolchain/llvm-project 6e765c10313d15c02ab29977a82938f66742c3a9)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11e19b81100000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14e66272100000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+deda4d...@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: use-after-free in __list_add_valid+0x36/0xc0 lib/list_debug.c:23
Read of size 8 at addr ffff8881cef57588 by task syz-executor796/502

CPU: 1 PID: 502 Comm: syz-executor796 Not tainted 5.4.42-syzkaller-00387-g8ca744822f5e #0
RIP: 0033:0x44a7a9
Code: e8 0c e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 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 7b cb fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f754ad3cdb8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000006dbc28 RCX: 000000000044a7a9
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003
RBP: 00000000006dbc20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dbc2c
R13: 00007ffda118d1ff R14: 00007f754ad3d9c0 R15: 000000000000002d

Allocated by task 417:
Freed by task 417:
The buggy address belongs to the object at ffff8881cef57500
which belongs to the cache kmalloc-192 of size 192
The buggy address is located 136 bytes inside of
192-byte region [ffff8881cef57500, ffff8881cef575c0)
The buggy address belongs to the page:
page:ffffea00073bd5c0 refcount:1 mapcount:0 mapping:ffff8881da802a00 index:0x0
flags: 0x8000000000000200(slab)
raw: 8000000000000200 ffffea00073bd340 0000000a0000000a ffff8881da802a00
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8881cef57480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff8881cef57500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881cef57580: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff8881cef57600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881cef57680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================

Reply all
Reply to author
Forward
0 new messages