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

6 views
Skip to first unread message

syzbot

unread,
Mar 7, 2020, 5:08:12 PM3/7/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 78d697fc Linux 4.14.172
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14a2c945e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=3484a1ea90b8523a
dashboard link: https://syzkaller.appspot.com/bug?extid=5af57aca98a625b08499
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16f9da55e00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=133289fde00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+5af57a...@syzkaller.appspotmail.com

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
==================================================================


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages