syzbot


KASAN: use-after-free Read in timer_is_static_object (2)

Status: auto-closed as invalid on 2019/10/25 08:47
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+81215bf96c82318c7e74@syzkaller.appspotmail.com
First crash: 1808d, last: 1781d
Discussions (2)
Title Replies (including bot) Last reply
Reminder: 17 open syzbot bugs in "net/tls" subsystem 1 (1) 2019/06/25 05:50
KASAN: use-after-free Read in timer_is_static_object (2) 0 (1) 2019/05/15 05:28
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in timer_is_static_object dccp 1 2170d 2169d 5/26 fixed on 2018/06/07 13:52

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in timer_is_static_object+0x80/0x90 kernel/time/timer.c:608
Read of size 8 at addr ffff8880969d8628 by task kworker/0:1/10643

CPU: 0 PID: 10643 Comm: kworker/0:1 Not tainted 5.2.0-rc3+ #23
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: pencrypt padata_serial_worker
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x172/0x1f0 lib/dump_stack.c:113
 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:188
 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
 kasan_report+0x12/0x20 mm/kasan/common.c:614
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132
 timer_is_static_object+0x80/0x90 kernel/time/timer.c:608
 debug_object_activate+0x291/0x4e0 lib/debugobjects.c:510
 debug_timer_activate kernel/time/timer.c:710 [inline]
 __mod_timer kernel/time/timer.c:1035 [inline]
 mod_timer kernel/time/timer.c:1096 [inline]
 add_timer+0x3c6/0x930 kernel/time/timer.c:1132
 __queue_delayed_work+0x1af/0x270 kernel/workqueue.c:1649
 queue_delayed_work_on+0x19a/0x200 kernel/workqueue.c:1674
 queue_delayed_work include/linux/workqueue.h:509 [inline]
 schedule_delayed_work include/linux/workqueue.h:610 [inline]
 tls_encrypt_done+0x441/0x550 net/tls/tls_sw.c:477
 aead_request_complete include/crypto/internal/aead.h:70 [inline]
 pcrypt_aead_serial+0x75/0xa0 crypto/pcrypt.c:123
 padata_serial_worker+0x2a3/0x4b0 kernel/padata.c:349
 process_one_work+0x989/0x1790 kernel/workqueue.c:2269
 worker_thread+0x98/0xe40 kernel/workqueue.c:2415
 kthread+0x354/0x420 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

Allocated by task 16201:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_kmalloc mm/kasan/common.c:489 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462
 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:503
 kmem_cache_alloc_trace+0x151/0x750 mm/slab.c:3555
 kmalloc include/linux/slab.h:547 [inline]
 kzalloc include/linux/slab.h:742 [inline]
 tls_set_sw_offload+0x1223/0x1620 net/tls/tls_sw.c:2189
 do_tls_setsockopt_conf net/tls/tls_main.c:527 [inline]
 do_tls_setsockopt net/tls/tls_main.c:574 [inline]
 tls_setsockopt+0x7bf/0x8c0 net/tls/tls_main.c:593
 sock_common_setsockopt+0x94/0xd0 net/core/sock.c:3124
 __sys_setsockopt+0x17a/0x280 net/socket.c:2072
 __do_sys_setsockopt net/socket.c:2083 [inline]
 __se_sys_setsockopt net/socket.c:2080 [inline]
 __x64_sys_setsockopt+0xbe/0x150 net/socket.c:2080
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 16200:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459
 __cache_free mm/slab.c:3432 [inline]
 kfree+0xcf/0x220 mm/slab.c:3755
 tls_sw_free_resources_tx+0x3a7/0x6d0 net/tls/tls_sw.c:2096
 tls_sk_proto_close+0x5cf/0x750 net/tls/tls_main.c:289
 inet_release+0xe0/0x1f0 net/ipv4/af_inet.c:427
 inet6_release+0x53/0x80 net/ipv6/af_inet6.c:470
 __sock_release+0xce/0x2a0 net/socket.c:601
 sock_close+0x1b/0x30 net/socket.c:1273
 __fput+0x2ff/0x890 fs/file_table.c:280
 ____fput+0x16/0x20 fs/file_table.c:313
 task_work_run+0x145/0x1c0 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:185 [inline]
 exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:168
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:279 [inline]
 do_syscall_64+0x58e/0x680 arch/x86/entry/common.c:304
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880969d8580
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 168 bytes inside of
 512-byte region [ffff8880969d8580, ffff8880969d8780)
The buggy address belongs to the page:
page:ffffea00025a7600 refcount:1 mapcount:0 mapping:ffff8880aa400940 index:0xffff8880969d8a80
flags: 0x1fffc0000000200(slab)
raw: 01fffc0000000200 ffffea0002a3af88 ffffea000261b848 ffff8880aa400940
raw: ffff8880969d8a80 ffff8880969d8080 0000000100000005 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880969d8500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880969d8580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880969d8600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
 ffff8880969d8680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880969d8700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/10 13:25 net-next-old ad3a9ee0b623 0159583c .config console log report ci-upstream-net-kasan-gce
2019/05/14 13:46 net-next-old 63863ee8e2f6 ada3c44c .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.