lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 13 Feb 2018 15:59:01 -0800
From:   syzbot <syzbot+cab5816b0edbabf598b3@...kaller.appspotmail.com>
To:     ast@...nel.org, daniel@...earbox.net, linux-kernel@...r.kernel.org,
        netdev@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: WARNING: kmalloc bug in bpf_prog_array_copy_info

Hello,

syzbot hit the following crash on bpf-next commit
7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (Sun Feb 11 23:04:29 2018 +0000)
Linux 4.16-rc1

So far this crash happened 362 times on bpf-next.
C reproducer is attached.
syzkaller reproducer is attached.
Raw console output is attached.
compiler: gcc (GCC) 7.1.1 20170620
.config is attached.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+cab5816b0edbabf598b3@...kaller.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.

audit: type=1400 audit(1518458605.853:8): avc:  denied  { prog_load } for   
pid=4110 comm="syzkaller462229"  
scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023  
tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=bpf  
permissive=1
audit: type=1400 audit(1518458605.881:9): avc:  denied  { prog_run } for   
pid=4110 comm="syzkaller462229"  
scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023  
tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=bpf  
permissive=1
WARNING: CPU: 1 PID: 4110 at mm/slab_common.c:1012 kmalloc_slab+0x5d/0x70  
mm/slab_common.c:1012
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 4110 Comm: syzkaller462229 Not tainted 4.16.0-rc1+ #12
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
  panic+0x1e4/0x41c kernel/panic.c:183
  __warn+0x1dc/0x200 kernel/panic.c:547
  report_bug+0x211/0x2d0 lib/bug.c:184
  fixup_bug.part.11+0x37/0x80 arch/x86/kernel/traps.c:178
  fixup_bug arch/x86/kernel/traps.c:247 [inline]
  do_error_trap+0x2d7/0x3e0 arch/x86/kernel/traps.c:296
  do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:315
  invalid_op+0x22/0x40 arch/x86/entry/entry_64.S:988
RIP: 0010:kmalloc_slab+0x5d/0x70 mm/slab_common.c:1012
RSP: 0018:ffff8801be09f798 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 1ffff10037c13f22 RCX: ffffffff817e12fd
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000fffff8a4
RBP: ffff8801be09f798 R08: ffffed0037c13f26 R09: ffffed0037c13f26
R10: 0000000000000001 R11: ffffed0037c13f26 R12: ffff8801d90d8080
R13: ffff8801be09f930 R14: 00000000014280c0 R15: 000000003ffffe29
  __do_kmalloc mm/slab.c:3700 [inline]
  __kmalloc+0x25/0x760 mm/slab.c:3714
  kmalloc_array include/linux/slab.h:631 [inline]
  kcalloc include/linux/slab.h:642 [inline]
  bpf_prog_array_copy_to_user+0x98/0x480 kernel/bpf/core.c:1593
  bpf_prog_array_copy_info+0x17b/0x1c0 kernel/bpf/core.c:1701
  perf_event_query_prog_array+0x196/0x280 kernel/trace/bpf_trace.c:877
  _perf_ioctl kernel/events/core.c:4737 [inline]
  perf_ioctl+0x3e1/0x1480 kernel/events/core.c:4757
  vfs_ioctl fs/ioctl.c:46 [inline]
  do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686
  SYSC_ioctl fs/ioctl.c:701 [inline]
  SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
  do_syscall_64+0x282/0x940 arch/x86/entry/common.c:287
  entry_SYSCALL_64_after_hwframe+0x26/0x9b
RIP: 0033:0x43ff89
RSP: 002b:00007ffd84f05b68 EFLAGS: 00000217 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: ffffffffffffffff RCX: 000000000043ff89
RDX: 00000000206a8000 RSI: 00000000c008240a RDI: 0000000000000003
RBP: 00000000006ca018 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000217 R12: 00000000004018b0
R13: 0000000000401940 R14: 0000000000000000 R15: 0000000000000000
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 syzkaller@...glegroups.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
If you want to test a patch for this bug, please reply with:
#syz test: git://repo/address.git branch
and provide the patch inline or as an attachment.
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.

View attachment "raw.log.txt" of type "text/plain" (6384 bytes)

View attachment "repro.syz.txt" of type "text/plain" (774 bytes)

View attachment "repro.c.txt" of type "text/plain" (4965 bytes)

View attachment "config.txt" of type "text/plain" (136427 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux - Powered by OpenVZ