syzbot


KASAN: use-after-free Write in padata_serial_worker

Status: upstream: reported C repro on 2019/06/10 15:27
Reported-by: syzbot+3565b7e06c0e4fee4a9b@syzkaller.appspotmail.com
First crash: 2026d, last: 895d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 BUG: unable to handle kernel NULL pointer dereference in padata_serial_worker C error 40 836d 1684d 0/1 upstream: reported C repro on 2020/05/17 07:11
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/03/02 05:32 13m retest repro linux-4.14.y report log
2022/11/11 07:30 9m retest repro linux-4.14.y report log
Fix bisection attempts (7)
Created Duration User Patch Repo Result
2020/07/06 16:44 0m bisect fix linux-4.14.y error job log
2020/06/06 16:21 23m bisect fix linux-4.14.y OK (0) job log log
2020/05/07 15:54 26m bisect fix linux-4.14.y OK (0) job log log
2020/04/07 15:31 23m bisect fix linux-4.14.y OK (0) job log log
2020/03/08 15:07 24m bisect fix linux-4.14.y OK (0) job log log
2020/01/13 07:49 23m bisect fix linux-4.14.y OK (0) job log log
2019/12/14 07:26 22m bisect fix linux-4.14.y OK (0) job log log

Sample crash report:
audit: type=1400 audit(1568053150.491:36): avc:  denied  { map } for  pid=7025 comm="syz-executor133" path="/root/syz-executor133608442" dev="sda1" ino=16483 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies.  Check SNMP counters.
==================================================================
BUG: KASAN: use-after-free in list_replace include/linux/list.h:141 [inline]
BUG: KASAN: use-after-free in list_replace_init include/linux/list.h:149 [inline]
BUG: KASAN: use-after-free in padata_serial_worker+0x362/0x400 kernel/padata.c:301
Write of size 8 at addr ffff8880990aab18 by task kworker/1:1/23

CPU: 1 PID: 23 Comm: kworker/1:1 Not tainted 4.14.142 #0
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:17 [inline]
 dump_stack+0x138/0x197 lib/dump_stack.c:53
 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
 __asan_report_store8_noabort+0x17/0x20 mm/kasan/report.c:435
 list_replace include/linux/list.h:141 [inline]
 list_replace_init include/linux/list.h:149 [inline]
 padata_serial_worker+0x362/0x400 kernel/padata.c:301
 process_one_work+0x863/0x1600 kernel/workqueue.c:2114
 worker_thread+0x5d9/0x1050 kernel/workqueue.c:2248
 kthread+0x319/0x430 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 7025:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
 __do_kmalloc mm/slab.c:3720 [inline]
 __kmalloc+0x15d/0x7a0 mm/slab.c:3729
 kmalloc include/linux/slab.h:493 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 tls_push_record+0x10a/0x1210 net/tls/tls_sw.c:250
 tls_sw_sendmsg+0x9e8/0x1020 net/tls/tls_sw.c:457
 inet_sendmsg+0x122/0x500 net/ipv4/af_inet.c:762
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xce/0x110 net/socket.c:656
 SYSC_sendto+0x206/0x310 net/socket.c:1763
 SyS_sendto+0x40/0x50 net/socket.c:1731
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 7025:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcc/0x270 mm/slab.c:3815
 tls_push_record+0xc03/0x1210 net/tls/tls_sw.c:293
 tls_sw_sendmsg+0x9e8/0x1020 net/tls/tls_sw.c:457
 inet_sendmsg+0x122/0x500 net/ipv4/af_inet.c:762
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xce/0x110 net/socket.c:656
 SYSC_sendto+0x206/0x310 net/socket.c:1763
 SyS_sendto+0x40/0x50 net/socket.c:1731
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8880990aaac0
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 88 bytes inside of
 256-byte region [ffff8880990aaac0, ffff8880990aabc0)
The buggy address belongs to the page:
page:ffffea0002642a80 count:1 mapcount:0 mapping:ffff8880990aa0c0 index:0xffff8880990aad40
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffff8880990aa0c0 ffff8880990aad40 0000000100000004
raw: ffffea00026604a0 ffffea0002795020 ffff8880aa8007c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880990aaa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880990aaa80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff8880990aab00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff8880990aab80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8880990aac00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/09/09 18:22 linux-4.14.y 414510bc00a5 a60cb4cd .config console log report syz C ci2-linux-4-14
2022/07/15 12:16 linux-4.14.y 424a46ea058e 5d921b08 .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in padata_serial_worker
2021/03/24 15:46 linux-4.14.y 670d6552eda8 607e3baf .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in padata_serial_worker
2021/03/02 02:41 linux-4.14.y 3242aa3a635c 183afb6c .config console log report info ci2-linux-4-14 KASAN: use-after-free Write in padata_serial_worker
2020/02/07 15:07 linux-4.14.y e0f8b8a65a47 06150bf1 .config console log report ci2-linux-4-14
2019/11/01 19:06 linux-4.14.y ddef1e8e3f6e 997ccc67 .config console log report ci2-linux-4-14
2019/08/03 14:33 linux-4.14.y 10d6aa565d05 6affd8e8 .config console log report ci2-linux-4-14
2019/06/11 09:48 linux-4.14.y e6a95d8851f1 0159583c .config console log report ci2-linux-4-14
2019/06/10 14:25 linux-4.14.y e6a95d8851f1 0159583c .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.