================================================================== BUG: KASAN: slab-out-of-bounds in sg_mark_end include/linux/scatterlist.h:190 [inline] BUG: KASAN: slab-out-of-bounds in tls_push_record+0x10cc/0x1270 net/tls/tls_sw.c:255 Read of size 8 at addr ffff8880b37eab78 by task syz-executor393/8002 CPU: 1 PID: 8002 Comm: syz-executor393 Not tainted 4.14.299-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351 kasan_report mm/kasan/report.c:409 [inline] __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430 sg_mark_end include/linux/scatterlist.h:190 [inline] tls_push_record+0x10cc/0x1270 net/tls/tls_sw.c:255 tls_handle_open_record net/tls/tls_main.c:158 [inline] tls_sk_proto_close+0x6f0/0x8b0 net/tls/tls_main.c:270 inet_release+0xdf/0x1b0 net/ipv4/af_inet.c:425 inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:450 __sock_release+0xcd/0x2b0 net/socket.c:602 sock_close+0x15/0x20 net/socket.c:1139 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa44/0x2850 kernel/exit.c:868 do_group_exit+0x100/0x2e0 kernel/exit.c:965 get_signal+0x38d/0x1ca0 kernel/signal.c:2412 do_signal+0x7c/0x1550 arch/x86/kernel/signal.c:792 exit_to_usermode_loop+0x160/0x200 arch/x86/entry/common.c:160 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 Allocated by task 7984: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618 ------------[ cut here ]------------ kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] tls_set_sw_offload+0x88/0xcd0 net/tls/tls_sw.c:683 do_tls_setsockopt_tx net/tls/tls_main.c:443 [inline] do_tls_setsockopt net/tls/tls_main.c:468 [inline] tls_setsockopt+0x216/0x3f0 net/tls/tls_main.c:486 kernel BUG at include/linux/scatterlist.h:190! SYSC_setsockopt net/socket.c:1865 [inline] SyS_setsockopt+0x110/0x1e0 net/socket.c:1844 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 Freed by task 0: ------------[ cut here ]------------ (stack is not available) kernel BUG at include/linux/scatterlist.h:190! The buggy address belongs to the object at ffff8880b37ea300 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 120 bytes to the right of 2048-byte region [ffff8880b37ea300, ffff8880b37eab00) invalid opcode: 0000 [#1] PREEMPT SMP KASAN The buggy address belongs to the page: Modules linked in: page:ffffea0002cdfa80 count:1 mapcount:0 mapping:ffff8880b37ea300 index:0x0 CPU: 0 PID: 8014 Comm: syz-executor393 Not tainted 4.14.299-syzkaller #0 compound_mapcount: 0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 flags: 0xfff00000008100(slab|head) task: ffff888094c02080 task.stack: ffff8880b30e8000 raw: 00fff00000008100 ffff8880b37ea300 0000000000000000 0000000100000003 RIP: 0010:sg_mark_end include/linux/scatterlist.h:190 [inline] RIP: 0010:tls_push_record+0xd41/0x1270 net/tls/tls_sw.c:255 raw: ffffea0002569ea0 ffffea00025681a0 ffff88813fe74c40 0000000000000000 RSP: 0018:ffff8880b30ef868 EFLAGS: 00010297 page dumped because: kasan: bad access detected RAX: ffff888094c02080 RBX: ffff8880ab406700 RCX: 0000000000000000 Memory state around the buggy address: RDX: 0000000000000000 RSI: ffff8880b016f4e0 RDI: ffff8880b016f4b8 ffff8880b37eaa00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc RBP: ffff8880b322b400 R08: ffffffff8ae15eae R09: ffffffff8ae15eb0 ffff8880b37eaa80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc R10: 00000000001466d9 R11: 0000000000066071 R12: ffff88809dfac040 >ffff8880b37eab00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc R13: 0000000000000017 R14: ffff8880b016f4c0 R15: ffff8880b016f4b8 ^ FS: 00007f120f6f6700(0000) GS:ffff8880ba400000(0000) knlGS:0000000000000000 ffff8880b37eab80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 ffff8880b37eac00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 CR2: 00007f3170d34000 CR3: 00000000a8c07000 CR4: 00000000003406f0 ================================================================== DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: tls_handle_open_record net/tls/tls_main.c:158 [inline] tls_sk_proto_close+0x6f0/0x8b0 net/tls/tls_main.c:270 inet_release+0xdf/0x1b0 net/ipv4/af_inet.c:425 inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:450 __sock_release+0xcd/0x2b0 net/socket.c:602 sock_close+0x15/0x20 net/socket.c:1139 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa44/0x2850 kernel/exit.c:868 do_group_exit+0x100/0x2e0 kernel/exit.c:965 get_signal+0x38d/0x1ca0 kernel/signal.c:2412 do_signal+0x7c/0x1550 arch/x86/kernel/signal.c:792 exit_to_usermode_loop+0x160/0x200 arch/x86/entry/common.c:160 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 Code: 00 4a 00 00 00 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 07 05 00 00 4c 89 e7 41 ff 94 24 58 04 00 00 e9 54 fd ff ff e8 cf e8 27 fb <0f> 0b e8 c8 e8 27 fb 0f 0b e8 c1 e8 27 fb 0f 0b e8 ba e8 27 fb RIP: sg_mark_end include/linux/scatterlist.h:190 [inline] RSP: ffff8880b30ef868 RIP: tls_push_record+0xd41/0x1270 net/tls/tls_sw.c:255 RSP: ffff8880b30ef868 invalid opcode: 0000 [#2] PREEMPT SMP KASAN Modules linked in: CPU: 0 PID: 8015 Comm: syz-executor393 Tainted: G B D 4.14.299-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 task: ffff88809534c0c0 task.stack: ffff8880b2ec0000 RIP: 0010:sg_mark_end include/linux/scatterlist.h:190 [inline] RIP: 0010:tls_push_record+0xd41/0x1270 net/tls/tls_sw.c:255 RSP: 0018:ffff8880b2ec7868 EFLAGS: 00010297 RAX: ffff88809534c0c0 RBX: ffff8880ab406500 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff8880b016e3e0 RDI: ffff8880b016e3b8 RBP: ffff8880aff7bd00 R08: ffffffff8ae15eae R09: ffffffff8ae15eb0 R10: 00000000001466d9 R11: 0000000000066071 R12: ffff888095a3c100 R13: 0000000000000017 R14: ffff8880b016e3c0 R15: ffff8880b016e3b8 FS: 00007f120f6f6700(0000) GS:ffff8880ba400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f3170d36000 CR3: 000000008f6a9000 CR4: 00000000003406f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: tls_handle_open_record net/tls/tls_main.c:158 [inline] tls_sk_proto_close+0x6f0/0x8b0 net/tls/tls_main.c:270 inet_release+0xdf/0x1b0 net/ipv4/af_inet.c:425 inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:450 __sock_release+0xcd/0x2b0 net/socket.c:602 sock_close+0x15/0x20 net/socket.c:1139 __fput+0x25f/0x7a0 fs/file_table.c:210 task_work_run+0x11f/0x190 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa44/0x2850 kernel/exit.c:868