syzbot


KASAN: stack-out-of-bounds Read in nft_range_dump

Status: upstream: reported C repro on 2020/03/07 22:08
Reported-by: syzbot+5af57aca98a625b08499@syzkaller.appspotmail.com
First crash: 1755d, last: 1665d
Fix bisection the fix commit could be any of (bisect log):
  78d697fc93f9 Linux 4.14.172
  4139fb08c05f Linux 4.14.187
  
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/01/20 14:32 14m retest repro linux-4.14.y report log
2022/09/05 03:27 10m retest repro linux-4.14.y report log
Fix bisection attempts (4)
Created Duration User Patch Repo Result
2020/07/05 23:21 30m bisect fix linux-4.14.y OK (2) job log
2020/06/05 22:57 23m bisect fix linux-4.14.y OK (0) job log log
2020/05/06 22:31 25m bisect fix linux-4.14.y OK (0) job log log
2020/04/06 22:07 23m bisect fix linux-4.14.y OK (0) job log log

Sample crash report:
audit: type=1400 audit(1583618709.018:36): avc:  denied  { map } for  pid=7417 comm="syz-executor585" path="/root/syz-executor585694863" dev="sda1" ino=16484 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
==================================================================
audit: type=1400 audit(1583618709.028:37): avc:  denied  { create } for  pid=7417 comm="syz-executor585" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1
BUG: KASAN: stack-out-of-bounds in nft_range_dump+0x1ab/0x1d0 net/netfilter/nft_range.c:115
Read of size 1 at addr ffff888086b172c8 by task syz-executor585/7417

CPU: 0 PID: 7417 Comm: syz-executor585 Not tainted 4.14.172-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x13e/0x194 lib/dump_stack.c:58
 print_address_description.cold+0x7c/0x1e2 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/0x2ae mm/kasan/report.c:393
 nft_range_dump+0x1ab/0x1d0 net/netfilter/nft_range.c:115
 nfnetlink_parse_nat net/netfilter/nf_nat_core.c:747 [inline]
 nfnetlink_parse_nat_setup+0x1e0/0x370 net/netfilter/nf_nat_core.c:784
 ctnetlink_parse_nat_setup+0x70/0x490 net/netfilter/nf_conntrack_netlink.c:1421
audit: type=1400 audit(1583618709.028:38): avc:  denied  { write } for  pid=7417 comm="syz-executor585" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1
 ctnetlink_setup_nat net/netfilter/nf_conntrack_netlink.c:1496 [inline]
 ctnetlink_create_conntrack+0x477/0x1040 net/netfilter/nf_conntrack_netlink.c:1840
 ctnetlink_new_conntrack+0x460/0xc30 net/netfilter/nf_conntrack_netlink.c:1964
 nfnetlink_rcv_msg+0xa08/0xc00 net/netfilter/nfnetlink.c:214
 netlink_rcv_skb+0x127/0x370 net/netlink/af_netlink.c:2432
 nfnetlink_rcv+0x1ab/0x1650 net/netfilter/nfnetlink.c:515
 netlink_unicast_kernel net/netlink/af_netlink.c:1286 [inline]
 netlink_unicast+0x437/0x620 net/netlink/af_netlink.c:1312
 netlink_sendmsg+0x733/0xbe0 net/netlink/af_netlink.c:1877
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xc5/0x100 net/socket.c:656
 ___sys_sendmsg+0x70a/0x840 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+0x42/0xb7
RIP: 0033:0x440239
RSP: 002b:00007fff1b318b88 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440239
RDX: 0000000000000000 RSI: 0000000020000640 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 0000000000000000 R09: 00000000004002c8
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401ac0
R13: 0000000000401b50 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea00021ac5c0 count:0 mapcount:0 mapping:          (null) index:0x0
flags: 0xfffe0000000000()
raw: 00fffe0000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: 0000000000000000 0000000100000001 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888086b17180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888086b17200: 00 f1 f1 f1 f1 04 f3 f3 f3 00 00 00 00 00 00 00
>ffff888086b17280: f1 f1 f1 f1 00 00 00 00 00 f2 f2 f2 f2 f2 00 00
                                              ^
 ffff888086b17300: 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00 00 00
 ffff888086b17380: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 f2
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/07 22:07 linux-4.14.y 78d697fc93f9 2e9971bb .config console log report syz C ci2-linux-4-14
* Struck through repros no longer work on HEAD.