syzbot


WARNING: kmalloc bug in hash_mac_create

Status: fixed on 2022/03/08 16:11
Subsystems: netfilter
[Documentation on labels]
Reported-by: syzbot+ee5cb15f4a0e85e0d54e@syzkaller.appspotmail.com
Fix commit: 7bbc3d385bd8 netfilter: ipset: Fix oversized kvmalloc() calls
First crash: 962d, last: 957d
Cause bisection: introduced by (bisect log) :
commit 7661809d493b426e979f39ab512e3adf41fbcc69
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Wed Jul 14 16:45:49 2021 +0000

  mm: don't allow oversized kvmalloc() calls

Crash: WARNING: kmalloc bug in hash_mac_create (log)
Repro: C syz .config
  
Discussions (11)
Title Replies (including bot) Last reply
[PATCH 4.14 00/75] 4.14.249-rc1 review 81 (81) 2021/10/07 16:21
[PATCH AUTOSEL 5.14 01/40] ext4: check and update i_disksize properly 44 (44) 2021/10/06 15:12
[PATCH 5.4 00/56] 5.4.151-rc1 review 62 (62) 2021/10/05 06:56
[PATCH 4.9 00/57] 4.9.285-rc1 review 62 (62) 2021/10/05 06:54
[PATCH 4.19 00/95] 4.19.209-rc1 review 103 (103) 2021/10/05 06:47
[PATCH 5.14 000/172] 5.14.10-rc1 review 184 (184) 2021/10/05 06:41
[PATCH 5.10 00/93] 5.10.71-rc1 review 100 (100) 2021/10/05 02:40
[PATCH 4.4 00/41] 4.4.286-rc1 review 45 (45) 2021/10/05 02:13
[PATCH net 00/15] Netfilter/IPVS fixes for net 17 (17) 2021/09/25 03:40
[PATCH 1/1] netfilter: ipset: Fix oversized kvmalloc() calls 2 (2) 2021/09/13 22:50
[syzbot] WARNING: kmalloc bug in hash_mac_create 0 (1) 2021/09/05 20:22

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 1 PID: 8439 at mm/util.c:597 kvmalloc_node+0x111/0x120 mm/util.c:597
Modules linked in:
CPU: 1 PID: 8439 Comm: syz-executor737 Not tainted 5.14.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:kvmalloc_node+0x111/0x120 mm/util.c:597
Code: 01 00 00 00 4c 89 e7 e8 4d 17 0d 00 49 89 c5 e9 69 ff ff ff e8 30 3e d1 ff 41 89 ed 41 81 cd 00 20 01 00 eb 95 e8 1f 3e d1 ff <0f> 0b e9 4c ff ff ff 0f 1f 84 00 00 00 00 00 55 48 89 fd 53 e8 06
RSP: 0018:ffffc90001097290 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 000000000000001f RCX: 0000000000000000
RDX: ffff888074f06240 RSI: ffffffff81a41371 RDI: 0000000000000003
RBP: 0000000000400dc0 R08: 000000007fffffff R09: 000000000000001f
R10: ffffffff81a4132e R11: 000000000000001f R12: 0000000400000018
R13: 0000000000000000 R14: 00000000ffffffff R15: ffff888029e5d3c0
FS:  00000000019c3300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000106 CR3: 0000000023af8000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 hash_mac_create+0x3bb/0xf50 net/netfilter/ipset/ip_set_hash_gen.h:1524
 ip_set_create+0x782/0x15a0 net/netfilter/ipset/ip_set_core.c:1100
 nfnetlink_rcv_msg+0xbc9/0x13f0 net/netfilter/nfnetlink.c:296
 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504
 nfnetlink_rcv+0x1ac/0x420 net/netfilter/nfnetlink.c:654
 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline]
 netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340
 netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929
 sock_sendmsg_nosec net/socket.c:704 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:724
 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2409
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2463
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2492
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x43f039
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffcc15b62a8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000400488 RCX: 000000000043f039
RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000003
RBP: 0000000000403020 R08: 0000000000000005 R09: 0000000000400488
R10: 0000000000000002 R11: 0000000000000246 R12: 00000000004030b0
R13: 0000000000000000 R14: 00000000004ac018 R15: 0000000000400488

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/09/04 19:38 upstream f1583cb1be35 d236a457 .config console log report syz C ci-upstream-kasan-gce-selinux-root WARNING: kmalloc bug in hash_mac_create
2021/09/04 19:34 upstream f1583cb1be35 d236a457 .config console log report syz C ci-upstream-kasan-gce WARNING: kmalloc bug in hash_mac_create
2021/09/04 19:31 upstream f1583cb1be35 d236a457 .config console log report syz C ci-upstream-kasan-gce-smack-root WARNING: kmalloc bug in hash_mac_create
2021/09/04 19:24 upstream f1583cb1be35 d236a457 .config console log report syz C ci-upstream-kasan-gce-root WARNING: kmalloc bug in hash_mac_create
2021/09/04 19:19 upstream f1583cb1be35 d236a457 .config console log report info ci-upstream-kasan-gce-smack-root WARNING: kmalloc bug in hash_mac_create
2021/09/04 19:12 upstream f1583cb1be35 d236a457 .config console log report info ci-upstream-kasan-gce WARNING: kmalloc bug in hash_mac_create
2021/09/04 19:11 upstream f1583cb1be35 d236a457 .config console log report info ci-upstream-kasan-gce-selinux-root WARNING: kmalloc bug in hash_mac_create
2021/09/04 19:10 upstream f1583cb1be35 d236a457 .config console log report info ci-upstream-kasan-gce-root WARNING: kmalloc bug in hash_mac_create
2021/09/04 19:25 upstream f1583cb1be35 d236a457 .config console log report info ci-upstream-kasan-gce-386 WARNING: kmalloc bug in hash_mac_create
2021/09/10 08:00 net-next-old 626bf91a292e e2776ee4 .config console log report info ci-upstream-net-kasan-gce WARNING: kmalloc bug in hash_mac_create
2021/09/08 23:06 net-next-old 626bf91a292e e2776ee4 .config console log report info ci-upstream-net-kasan-gce WARNING: kmalloc bug in hash_mac_create
* Struck through repros no longer work on HEAD.