BUG: Bad page state (2)

5 views
Skip to first unread message

syzbot

unread,
Nov 30, 2017, 3:21:02 PM11/30/17
to syzkaller-upst...@googlegroups.com
Hello,

syzkaller hit the following crash on
1ea8d039f9edcfefb20d8ddfe136930f6e551529
git://git.cmpxchg.org/linux-mmots.git/master
compiler: gcc (GCC) 7.1.1 20170620
.config is attached
Raw console output is attached.

Unfortunately, I don't have any reproducer for this bug yet.
CC: [da...@davemloft.net her...@gondor.apana.org.au
linux-...@vger.kernel.org linux-...@vger.kernel.org]

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


---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to syzk...@googlegroups.com.
Please credit me with: Reported-by: syzbot <syzk...@googlegroups.com>

syzbot will keep track of this bug report.
Once a fix for this bug is committed, please reply to this email with:
#syz fix: exact-commit-title
To mark this as a duplicate of another syzbot report, please reply with:
#syz dup: exact-subject-of-another-report
If it's a one-off invalid bug report, please reply with:
#syz invalid
Note: if the crash happens again, it will cause creation of a new bug
report.
Note: all commands must start from beginning of the line in the email body.
To upstream this report, please reply with:
#syz upstream
config.txt
raw.log

Dmitry Vyukov

unread,
Dec 6, 2017, 7:57:55 AM12/6/17
to syzbot, 'Dmitry Vyukov' via syzkaller-upstream-moderation
happened only once, probably consequence of one of crypto bugs

#syz invalid

On Thu, Nov 30, 2017 at 9:21 PM, syzbot
<bot+cd26a9375f316e1d2c...@syzkaller.appspotmail.com>
wrote:
> --
> You received this message because you are subscribed to the Google Groups
> "syzkaller-upstream-moderation" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to syzkaller-upstream-m...@googlegroups.com.
> To post to this group, send email to
> syzkaller-upst...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/syzkaller-upstream-moderation/001a113ec9009b24b6055f38fd80%40google.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages