syzbot


KASAN: slab-out-of-bounds Read in ipt_init_target

Status: upstream: reported C repro on 2020/01/21 23:32
Reported-by: syzbot+4b811c6c00652025a8a7@syzkaller.appspotmail.com
First crash: 1605d, last: 538d
Fix bisection the fix commit could be any of (bisect log):
  c1141b3aab36 Linux 4.14.166
  4139fb08c05f Linux 4.14.187
  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 general protection fault in ipt_init_target C error 157 484d 1615d 0/1 upstream: reported C repro on 2020/01/12 00:39

Sample crash report:
netlink: 128 bytes leftover after parsing attributes in process `syz-executor312'.
netlink: 4 bytes leftover after parsing attributes in process `syz-executor312'.
==================================================================
BUG: KASAN: slab-out-of-bounds in ipt_init_target+0x213/0x250 net/sched/act_ipt.c:46
Read of size 1 at addr ffff8880af659bdf by task syz-executor312/7982

CPU: 0 PID: 7982 Comm: syz-executor312 Not tainted 4.14.295-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/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_load1_noabort+0x68/0x70 mm/kasan/report.c:427
 ipt_init_target+0x213/0x250 net/sched/act_ipt.c:46
 __tcf_ipt_init+0x48d/0xc00 net/sched/act_ipt.c:168
 tcf_ipt_init+0x43/0x50 net/sched/act_ipt.c:202
 tcf_action_init_1+0x51a/0x9e0 net/sched/act_api.c:691
 tcf_action_init+0x26d/0x400 net/sched/act_api.c:760
 tcf_action_add net/sched/act_api.c:1088 [inline]
 tc_ctl_action+0x2e3/0x510 net/sched/act_api.c:1140
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4322
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2454
 netlink_unicast_kernel net/netlink/af_netlink.c:1296 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1322
 netlink_sendmsg+0x648/0xbc0 net/netlink/af_netlink.c:1893
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f1bea640179
RSP: 002b:00007ffd20a67048 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f1bea640179
RDX: 0000000000000000 RSI: 0000000020007bc0 RDI: 0000000000000003
RBP: 00007f1bea604160 R08: 0000000000000000 R09: 0000000000000000
R10: fffffffffffffff0 R11: 0000000000000246 R12: 00007f1bea6041f0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 7982:
 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
 __do_kmalloc mm/slab.c:3720 [inline]
 __kmalloc_track_caller+0x155/0x400 mm/slab.c:3735
 kmemdup+0x23/0x50 mm/util.c:119
 kmemdup include/linux/string.h:449 [inline]
 __tcf_ipt_init+0x464/0xc00 net/sched/act_ipt.c:164
 tcf_ipt_init+0x43/0x50 net/sched/act_ipt.c:202
 tcf_action_init_1+0x51a/0x9e0 net/sched/act_api.c:691
 tcf_action_init+0x26d/0x400 net/sched/act_api.c:760
 tcf_action_add net/sched/act_api.c:1088 [inline]
 tc_ctl_action+0x2e3/0x510 net/sched/act_api.c:1140
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4322
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2454
 netlink_unicast_kernel net/netlink/af_netlink.c:1296 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1322
 netlink_sendmsg+0x648/0xbc0 net/netlink/af_netlink.c:1893
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 1:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 kobject_uevent_env+0x26c/0xf30 lib/kobject_uevent.c:537
 tty_register_device_attr+0x444/0x710 drivers/tty/tty_io.c:3017
 tty_register_device drivers/tty/tty_io.c:2930 [inline]
 tty_register_driver+0x3a6/0x750 drivers/tty/tty_io.c:3201
 legacy_pty_init drivers/tty/pty.c:592 [inline]
 pty_init+0x66a/0xdca drivers/tty/pty.c:954
 do_one_initcall+0x88/0x210 init/main.c:830
 do_initcall_level init/main.c:896 [inline]
 do_initcalls init/main.c:904 [inline]
 do_basic_setup init/main.c:922 [inline]
 kernel_init_freeable+0x565/0x626 init/main.c:1081
 kernel_init+0xd/0x161 init/main.c:1006
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

The buggy address belongs to the object at ffff8880af659bc0
 which belongs to the cache kmalloc-32 of size 32
The buggy address is located 31 bytes inside of
 32-byte region [ffff8880af659bc0, ffff8880af659be0)
The buggy address belongs to the page:
page:ffffea0002bd9640 count:1 mapcount:0 mapping:ffff8880af659000 index:0xffff8880af659fc1
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880af659000 ffff8880af659fc1 000000010000003f
raw: ffffea0002bdf120 ffff88813fe64248 ffff88813fe741c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880af659a80: 06 fc fc fc fc fc fc fc fb fb fb fb fc fc fc fc
 ffff8880af659b00: fb fb fb fb fc fc fc fc 06 fc fc fc fc fc fc fc
>ffff8880af659b80: 06 fc fc fc fc fc fc fc 00 fc fc fc fc fc fc fc
                                                    ^
 ffff8880af659c00: 06 fc fc fc fc fc fc fc 06 fc fc fc fc fc fc fc
 ffff8880af659c80: 06 fc fc fc fc fc fc fc 00 00 fc fc fc fc fc fc
==================================================================

Crashes (32):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/10/09 19:53 linux-4.14.y 9d5c0b3a8e1a aea5da89 .config console log report syz C [disk image] [vmlinux] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2022/06/26 02:13 linux-4.14.y f051383ef03b a371c43c .config console log report syz C ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2020/01/21 23:58 linux-4.14.y c1141b3aab36 8eda0b95 .config console log report syz C ci2-linux-4-14
2022/12/24 10:08 linux-4.14.y c4215ee4771b 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2022/12/24 10:08 linux-4.14.y c4215ee4771b 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2022/10/09 19:39 linux-4.14.y 9d5c0b3a8e1a aea5da89 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2022/10/09 19:39 linux-4.14.y 9d5c0b3a8e1a aea5da89 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2022/07/15 05:42 linux-4.14.y 424a46ea058e 5d921b08 .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2022/06/26 02:03 linux-4.14.y f051383ef03b a371c43c .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2022/05/01 11:47 linux-4.14.y e3a56aaade89 2df221f6 .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2022/04/24 15:08 linux-4.14.y 15a1c6b6f516 131df97d .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2022/02/28 10:51 linux-4.14.y fa33f9094f36 45a13a73 .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2021/05/20 09:16 linux-4.14.y 7d7d1c0ab3eb a343ba6b .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2021/05/13 04:22 linux-4.14.y 7d7d1c0ab3eb ed7d41c5 .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2021/04/21 01:05 linux-4.14.y cf256fbcbe34 c0ced557 .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2021/04/15 06:41 linux-4.14.y 958e517f4e16 fcdb12ba .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2021/04/06 09:55 linux-4.14.y bd634aa64163 6a81331a .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2021/04/05 19:04 linux-4.14.y bd634aa64163 6a81331a .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2021/03/15 07:20 linux-4.14.y c7150cd2fa8c cc1cff8f .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Read in ipt_init_target
2020/12/02 10:05 linux-4.14.y c196b3a9c83a c42a35e9 .config console log report info ci2-linux-4-14
2020/10/18 15:00 linux-4.14.y cbfa1702aaf6 fea47c01 .config console log report info ci2-linux-4-14
2020/08/25 07:09 linux-4.14.y 6a24ca2506d6 344da168 .config console log report ci2-linux-4-14
2020/05/23 21:24 linux-4.14.y a41ba30d9df2 4afdfa20 .config console log report ci2-linux-4-14
2020/05/16 18:09 linux-4.14.y ab9dfda23248 37bccd4e .config console log report ci2-linux-4-14
2020/04/27 17:00 linux-4.14.y 050272a0423e 0ce7569e .config console log report ci2-linux-4-14
2020/04/27 16:30 linux-4.14.y 050272a0423e 0ce7569e .config console log report ci2-linux-4-14
2020/04/26 20:07 linux-4.14.y 050272a0423e 0ce7569e .config console log report ci2-linux-4-14
2020/04/15 02:47 linux-4.14.y c10b57a567e4 3f3c5574 .config console log report ci2-linux-4-14
2020/04/02 13:35 linux-4.14.y 01364dad1d45 a34e2c33 .config console log report ci2-linux-4-14
2020/03/16 07:59 linux-4.14.y 12cd844a39ed 749688d2 .config console log report ci2-linux-4-14
2020/02/18 23:22 linux-4.14.y 98db2bf27b9e 012fbc32 .config console log report ci2-linux-4-14
2020/01/21 23:31 linux-4.14.y c1141b3aab36 8eda0b95 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.