BUG: bad usercopy in strncpy_from_user

9 views
Skip to first unread message

syzbot

unread,
Dec 31, 2017, 6:58:02 AM12/31/17
to syzkaller-upst...@googlegroups.com
Hello,

syzkaller hit the following crash on
beacbc68ac3e23821a681adb30b45dc55b17488d
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.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: [james...@arm.com kees...@chromium.org keun-...@darkmatter.ae
lab...@redhat.com linux-...@vger.kernel.org linu...@kvack.org
mark.r...@arm.com mi...@kernel.org]

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+574e12...@syzkaller.appspotmail.com
It will help syzbot understand when the bug is fixed. See footer for
details.
If you forward the report, please keep this part and the footer.

usercopy: kernel memory overwrite attempt detected to 00000000764fef29
(names_cache) (4068 bytes)
------------[ cut here ]------------
kernel BUG at mm/usercopy.c:72!
invalid opcode: 0000 [#1] SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in:
CPU: 0 PID: 3369 Comm: syz-executor2 Not tainted 4.15.0-rc5+ #238
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:report_usercopy mm/usercopy.c:64 [inline]
RIP: 0010:__check_object_size+0x3a2/0x4f0 mm/usercopy.c:264
RSP: 0018:ffff8801ac43fc30 EFLAGS: 00010286
RAX: 0000000000000061 RBX: ffffffff85328380 RCX: 0000000000000000
RDX: 0000000000000061 RSI: 1ffff10035887f46 RDI: ffffed0035887f7a
RBP: ffff8801ac43fd20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff85328340
R13: ffff8801bf00175c R14: 0000000000000fe4 R15: ffffea0006fc0000
FS: 0000000000dd3940(0000) GS:ffff8801db400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020fa7f12 CR3: 00000001ab72c001 CR4: 00000000001606f0
Call Trace:
check_object_size include/linux/thread_info.h:112 [inline]
strncpy_from_user+0xf4/0x430 lib/strncpy_from_user.c:116
getname_flags+0x10e/0x580 fs/namei.c:149
getname+0x19/0x20 fs/namei.c:209
do_sys_open+0x2e7/0x6d0 fs/open.c:1053
SYSC_open fs/open.c:1077 [inline]
SyS_open+0x2d/0x40 fs/open.c:1072
entry_SYSCALL_64_fastpath+0x1f/0x96
RIP: 0033:0x450c70
RSP: 002b:0000000000a2e8b0 EFLAGS: 00000202 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 0000000000dd3914 RCX: 0000000000450c70
RDX: 00000000000004ba RSI: 0000000000090800 RDI: 0000000000a2fa50
RBP: 0000000000a2fa50 R08: 0000000000000001 R09: 0000000000dd3940
R10: 0000000000000000 R11: 0000000000000202 R12: 00000000000004ba
R13: 0000000000000000 R14: 0000000000021cda R15: 0000000000000010
Code: 48 0f 44 da e8 c0 79 c2 ff 48 8b 85 28 ff ff ff 4d 89 f1 4c 89 e9 4c
89 e2 48 89 de 48 c7 c7 40 84 32 85 49 89 c0 e8 a6 35 ac ff <0f> 0b 48 c7
c0 00 82 32 85 eb 96 48 c7 c0 40 82 32 85 eb 8d 48
RIP: report_usercopy mm/usercopy.c:64 [inline] RSP: ffff8801ac43fc30
RIP: __check_object_size+0x3a2/0x4f0 mm/usercopy.c:264 RSP: ffff8801ac43fc30
---[ end trace b911647a6d5c1d71 ]---
Kernel panic - not syncing: Fatal exception
Dumping ftrace buffer:
(ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..


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

syzbot will keep track of this bug report.
If you forgot to add the Reported-by tag, once the fix for this bug is
merged
into any tree, 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 31, 2017, 7:39:10 AM12/31/17
to syzbot, 'Dmitry Vyukov' via syzkaller-upstream-moderation
Let's consider that this is:

#syz fix: crypto: pcrypt - fix freeing pcrypt instances

happened once, no reproducer
> --
> 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/001a113ed38ad50e720561a19328%40google.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages