lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  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:   Fri, 27 Oct 2017 02:44:00 -0700
From:   syzbot 
        <bot+c0733f3aab92fc116dc1d10d8a25f5bf1f739eff@...kaller.appspotmail.com>
To:     john.stultz@...aro.org, linux-kernel@...r.kernel.org,
        sboyd@...eaurora.org, syzkaller-bugs@...glegroups.com,
        tglx@...utronix.de
Subject: KASAN: use-after-free Write in detach_if_pending

Hello,

syzkaller hit the following crash on  
e7989f973ae1b90ec7c0b671c81f7f553affccbe
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.
C reproducer is attached
syzkaller reproducer is attached. See https://goo.gl/kgGztJ
for information about syzkaller reproducers


BUG: KASAN: use-after-free in __write_once_size  
include/linux/compiler.h:305 [inline]
BUG: KASAN: use-after-free in __hlist_del include/linux/list.h:648 [inline]
BUG: KASAN: use-after-free in detach_timer kernel/time/timer.c:791 [inline]
BUG: KASAN: use-after-free in detach_if_pending+0x557/0x610  
kernel/time/timer.c:808
Write of size 8 at addr ffff8801d3bab780 by task syzkaller900516/2986

CPU: 1 PID: 2986 Comm: syzkaller900516 Not tainted 4.13.0+ #82
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
Call Trace:
  __dump_stack lib/dump_stack.c:16 [inline]
  dump_stack+0x194/0x257 lib/dump_stack.c:52
  print_address_description+0x73/0x250 mm/kasan/report.c:252
  kasan_report_error mm/kasan/report.c:351 [inline]
  kasan_report+0x24e/0x340 mm/kasan/report.c:409
  __asan_report_store8_noabort+0x17/0x20 mm/kasan/report.c:435
  __write_once_size include/linux/compiler.h:305 [inline]
  __hlist_del include/linux/list.h:648 [inline]
  detach_timer kernel/time/timer.c:791 [inline]
  detach_if_pending+0x557/0x610 kernel/time/timer.c:808
  try_to_del_timer_sync+0xa2/0x120 kernel/time/timer.c:1182
  del_timer_sync+0x18a/0x240 kernel/time/timer.c:1247
  tun_flow_uninit drivers/net/tun.c:1104 [inline]
  tun_free_netdev+0x105/0x1b0 drivers/net/tun.c:1776
  netdev_run_todo+0x870/0xca0 net/core/dev.c:7864
  rtnl_unlock+0xe/0x10 net/core/rtnetlink.c:106
  tun_detach drivers/net/tun.c:588 [inline]
  tun_chr_close+0x49/0x60 drivers/net/tun.c:2609
  __fput+0x333/0x7f0 fs/file_table.c:210
  ____fput+0x15/0x20 fs/file_table.c:246
  task_work_run+0x199/0x270 kernel/task_work.c:112
  exit_task_work include/linux/task_work.h:21 [inline]
  do_exit+0xa52/0x1b40 kernel/exit.c:865
  do_group_exit+0x149/0x400 kernel/exit.c:968
  SYSC_exit_group kernel/exit.c:979 [inline]
  SyS_exit_group+0x1d/0x20 kernel/exit.c:977
  entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x443a28
RSP: 002b:00007fff42800438 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443a28
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 0000000000000082 R08: 00000000000000e7 R09: ffffffffffffffd4
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006d6180 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 2986:
  save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
  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_node mm/slab.c:3689 [inline]
  __kmalloc_node+0x47/0x70 mm/slab.c:3696
  kmalloc_node include/linux/slab.h:535 [inline]
  kvmalloc_node+0x64/0xd0 mm/util.c:397
  kvmalloc include/linux/mm.h:529 [inline]
  kvzalloc include/linux/mm.h:537 [inline]
  alloc_netdev_mqs+0x16e/0xed0 net/core/dev.c:8018
  tun_set_iff drivers/net/tun.c:2022 [inline]
  __tun_chr_ioctl+0x12be/0x3d20 drivers/net/tun.c:2276
  tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:2521
  vfs_ioctl fs/ioctl.c:45 [inline]
  do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685
  SYSC_ioctl fs/ioctl.c:700 [inline]
  SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
  entry_SYSCALL_64_fastpath+0x1f/0xbe

Freed by task 2986:
  save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
  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:3503 [inline]
  kfree+0xca/0x250 mm/slab.c:3820
  kvfree+0x36/0x60 mm/util.c:416
  netdev_freemem net/core/dev.c:7970 [inline]
  free_netdev+0x2cf/0x360 net/core/dev.c:8132
  tun_set_iff drivers/net/tun.c:2105 [inline]
  __tun_chr_ioctl+0x2cf6/0x3d20 drivers/net/tun.c:2276
  tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:2521
  vfs_ioctl fs/ioctl.c:45 [inline]
  do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685
  SYSC_ioctl fs/ioctl.c:700 [inline]
  SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
  entry_SYSCALL_64_fastpath+0x1f/0xbe

The buggy address belongs to the object at ffff8801d3ba8380
  which belongs to the cache kmalloc-16384 of size 16384
The buggy address is located 13312 bytes inside of
  16384-byte region [ffff8801d3ba8380, ffff8801d3bac380)
The buggy address belongs to the page:
page:ffffea00074eea00 count:1 mapcount:0 mapping:ffff8801d3ba8380 index:0x0  
compound_mapcount: 0
flags: 0x200000000008100(slab|head)
raw: 0200000000008100 ffff8801d3ba8380 0000000000000000 0000000100000001
raw: ffffea0007355020 ffff8801dac01c50 ffff8801dac02200 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
  ffff8801d3bab680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  ffff8801d3bab700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff8801d3bab780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                    ^
  ffff8801d3bab800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  ffff8801d3bab880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


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

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

Download attachment "raw.log" of type "application/octet-stream" (11887 bytes)

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

Download attachment "repro.c" of type "application/octet-stream" (6885 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ