syzbot


BUG: Bad page state (2)

Status: closed as invalid on 2017/12/06 12:57
Reported-by: syzbot+cd26a9375f316e1d2c9b36b10ed5a3eddc815c1c@syzkaller.appspotmail.com
First crash: 1714d, last: 1714d
similar bugs (11):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: Bad page state (3) C 3 1672d 1679d 4/23 fixed on 2018/02/02 04:39
upstream BUG: Bad page state (5) C 171 1257d 1270d 0/23 closed as invalid on 2019/02/27 20:53
linux-4.19 BUG: Bad page state 1 259d 259d 0/1 auto-closed as invalid on 2022/03/21 10:57
linux-4.19 BUG: Bad page state (2) 1 69d 69d 0/1 upstream: reported on 2022/05/29 19:49
upstream BUG: Bad page state (7) 3 707d 764d 0/23 auto-closed as invalid on 2020/12/28 02:44
android-49 BUG: Bad page state 3 1039d 1063d 0/3 auto-closed as invalid on 2020/01/30 18:48
android-54 BUG: Bad page state C 9 860d 891d 0/2 upstream: reported C repro on 2020/02/28 01:20
upstream BUG: Bad page state (4) 1 1477d 1476d 0/23 closed as invalid on 2018/09/05 12:51
upstream BUG: Bad page state (6) C 2 1256d 1256d 0/23 closed as invalid on 2019/03/01 18:38
upstream BUG: Bad page state C 2 1817d 1818d 3/23 fixed on 2017/10/24 06:54
upstream BUG: Bad page state (8) 355 57d 552d 1/23 upstream: reported on 2021/02/01 10:07

Sample crash report:
BUG: Bad page state in process syz-executor0  pfn:1ca204
page:ffffea0007288100 count:0 mapcount:0 mapping:ffff8801ca204480 index:0x0 compound_mapcount: 0
flags: 0x2fffc0000008100(slab|head)
raw: 02fffc0000008100 ffff8801ca204480 0000000000000000 0000000000000003
raw: ffffea000641d6a0 ffffea0007268720 ffff8801db000c40 0000000000000000
page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set
bad because of flags: 0x100(slab)
Modules linked in:
CPU: 0 PID: 6979 Comm: syz-executor0 Not tainted 4.14.0-mm1+ #25
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x257 lib/dump_stack.c:53
 bad_page+0x230/0x2b0 mm/page_alloc.c:577
 free_pages_check_bad+0x1f0/0x2e0 mm/page_alloc.c:955
 free_pages_check mm/page_alloc.c:964 [inline]
 free_pages_prepare mm/page_alloc.c:1054 [inline]
 free_pcp_prepare mm/page_alloc.c:1079 [inline]
 free_unref_page_prepare mm/page_alloc.c:2628 [inline]
 free_unref_page+0x584/0x9d0 mm/page_alloc.c:2678
 __free_pages+0x107/0x150 mm/page_alloc.c:4292
 free_pages+0x51/0x90 mm/page_alloc.c:4304
 blkcipher_walk_done+0x767/0xde0 crypto/blkcipher.c:141
 encrypt+0x50a/0xaf0 crypto/salsa20_generic.c:208
 skcipher_crypt_blkcipher crypto/skcipher.c:619 [inline]
 skcipher_decrypt_blkcipher+0x213/0x310 crypto/skcipher.c:637
 crypto_skcipher_decrypt include/crypto/skcipher.h:463 [inline]
 _skcipher_recvmsg crypto/algif_skcipher.c:133 [inline]
 skcipher_recvmsg+0xb06/0xf30 crypto/algif_skcipher.c:164
 sock_recvmsg_nosec net/socket.c:805 [inline]
 sock_recvmsg+0xc9/0x110 net/socket.c:812
 ___sys_recvmsg+0x29b/0x630 net/socket.c:2207
 __sys_recvmsg+0xe2/0x210 net/socket.c:2252
 SYSC_recvmsg net/socket.c:2264 [inline]
 SyS_recvmsg+0x2d/0x50 net/socket.c:2259
 entry_SYSCALL_64_fastpath+0x1f/0x96
RIP: 0033:0x452879
RSP: 002b:00007eff9424bbe8 EFLAGS: 00000212 ORIG_RAX: 000000000000002f
RAX: ffffffffffffffda RBX: 0000000000758020 RCX: 0000000000452879
RDX: 0000000000000101 RSI: 0000000020bdb000 RDI: 0000000000000014
RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006f1f78
R13: 00000000ffffffff R14: 00007eff9424c6d4 R15: 0000000000000000
==================================================================
BUG: KASAN: use-after-free in af_alg_free_areq_sgls+0x921/0xab0 crypto/af_alg.c:667
Read of size 8 at addr ffff8801d343dae8 by task syz-executor0/6979

CPU: 0 PID: 6979 Comm: syz-executor0 Tainted: G    B            4.14.0-mm1+ #25
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x257 lib/dump_stack.c:53
 print_address_description+0x73/0x250 mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report+0x25b/0x340 mm/kasan/report.c:409
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
 af_alg_free_areq_sgls+0x921/0xab0 crypto/af_alg.c:667
 _skcipher_recvmsg crypto/algif_skcipher.c:150 [inline]
 skcipher_recvmsg+0x4fa/0xf30 crypto/algif_skcipher.c:164
 sock_recvmsg_nosec net/socket.c:805 [inline]
 sock_recvmsg+0xc9/0x110 net/socket.c:812
 ___sys_recvmsg+0x29b/0x630 net/socket.c:2207
 __sys_recvmsg+0xe2/0x210 net/socket.c:2252
 SYSC_recvmsg net/socket.c:2264 [inline]
 SyS_recvmsg+0x2d/0x50 net/socket.c:2259
 entry_SYSCALL_64_fastpath+0x1f/0x96
RIP: 0033:0x452879
RSP: 002b:00007eff9424bbe8 EFLAGS: 00000212 ORIG_RAX: 000000000000002f
RAX: ffffffffffffffda RBX: 0000000000758020 RCX: 0000000000452879
RDX: 0000000000000101 RSI: 0000000020bdb000 RDI: 0000000000000014
RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006f1f78
R13: 00000000ffffffff R14: 00007eff9424c6d4 R15: 0000000000000000

Allocated by task 6979:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
 __do_kmalloc mm/slab.c:3712 [inline]
 __kmalloc+0x162/0x760 mm/slab.c:3721
 kmalloc include/linux/slab.h:519 [inline]
 sock_kmalloc+0x112/0x190 net/core/sock.c:1979
 skcipher_accept_parent_nokey+0x90/0x4d0 crypto/algif_skcipher.c:370
 skcipher_accept_parent+0x95/0xd0 crypto/algif_skcipher.c:406
 af_alg_accept+0x125/0x670 crypto/af_alg.c:294
 alg_accept+0x46/0x60 crypto/af_alg.c:330
 SYSC_accept4+0x384/0x850 net/socket.c:1573
 SyS_accept4 net/socket.c:1523 [inline]
 SYSC_accept net/socket.c:1607 [inline]
 SyS_accept+0x26/0x30 net/socket.c:1604
 entry_SYSCALL_64_fastpath+0x1f/0x96

Freed by task 6979:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3492 [inline]
 kfree+0xca/0x250 mm/slab.c:3807
 blkcipher_walk_done+0x72b/0xde0 crypto/blkcipher.c:139
 encrypt+0x50a/0xaf0 crypto/salsa20_generic.c:208
 skcipher_crypt_blkcipher crypto/skcipher.c:619 [inline]
 skcipher_decrypt_blkcipher+0x213/0x310 crypto/skcipher.c:637
 crypto_skcipher_decrypt include/crypto/skcipher.h:463 [inline]
 _skcipher_recvmsg crypto/algif_skcipher.c:133 [inline]
 skcipher_recvmsg+0xb06/0xf30 crypto/algif_skcipher.c:164
 sock_recvmsg_nosec net/socket.c:805 [inline]
 sock_recvmsg+0xc9/0x110 net/socket.c:812
 ___sys_recvmsg+0x29b/0x630 net/socket.c:2207
 __sys_recvmsg+0xe2/0x210 net/socket.c:2252
 SYSC_recvmsg net/socket.c:2264 [inline]
 SyS_recvmsg+0x2d/0x50 net/socket.c:2259
 entry_SYSCALL_64_fastpath+0x1f/0x96

The buggy address belongs to the object at ffff8801d343da00
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 232 bytes inside of
 256-byte region [ffff8801d343da00, ffff8801d343db00)
The buggy address belongs to the page:
page:ffffea00074d0f40 count:1 mapcount:0 mapping:ffff8801d343d000 index:0x0
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffff8801d343d000 0000000000000000 000000010000000c
raw: ffffea00074c5fe0 ffffea00074c6120 ffff8801db0007c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801d343d980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8801d343da00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8801d343da80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                          ^
 ffff8801d343db00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
 ffff8801d343db80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-mmots-kasan-gce 2017/11/26 19:00 mmots 1ea8d039f9ed deb5f6ae .config log report