[syzbot] [netfilter?] WARNING: ODEBUG bug in ip_set_free

17 views
Skip to first unread message

syzbot

unread,
Feb 13, 2024, 1:22:26 PMFeb 13
to core...@netfilter.org, da...@davemloft.net, edum...@google.com, f...@strlen.de, kad...@netfilter.org, ku...@kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, netfilt...@vger.kernel.org, pab...@redhat.com, pa...@netfilter.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: f735966ee23c Merge branches 'for-next/reorg-va-space' and ..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
console output: https://syzkaller.appspot.com/x/log.txt?x=168b6592180000
kernel config: https://syzkaller.appspot.com/x/.config?x=d47605a39da2cf06
dashboard link: https://syzkaller.appspot.com/bug?extid=ebbab3e04c88fa141e6b
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1000ede0180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=161a6ba2180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/bdea2316c4db/disk-f735966e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/75ba7806a91c/vmlinux-f735966e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/208f119d45ed/Image-f735966e.gz.xz

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

------------[ cut here ]------------
ODEBUG: free active (active state 0) object: 00000000310f7442 object type: timer_list hint: bitmap_port_gc+0x0/0x4dc net/netfilter/ipset/ip_set_bitmap_port.c:282
WARNING: CPU: 1 PID: 6165 at lib/debugobjects.c:517 debug_print_object lib/debugobjects.c:514 [inline]
WARNING: CPU: 1 PID: 6165 at lib/debugobjects.c:517 __debug_check_no_obj_freed lib/debugobjects.c:989 [inline]
WARNING: CPU: 1 PID: 6165 at lib/debugobjects.c:517 debug_check_no_obj_freed+0x398/0x47c lib/debugobjects.c:1019
Modules linked in:
CPU: 1 PID: 6165 Comm: syz-executor468 Not tainted 6.8.0-rc3-syzkaller-gf735966ee23c #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : debug_print_object lib/debugobjects.c:514 [inline]
pc : __debug_check_no_obj_freed lib/debugobjects.c:989 [inline]
pc : debug_check_no_obj_freed+0x398/0x47c lib/debugobjects.c:1019
lr : debug_print_object lib/debugobjects.c:514 [inline]
lr : __debug_check_no_obj_freed lib/debugobjects.c:989 [inline]
lr : debug_check_no_obj_freed+0x398/0x47c lib/debugobjects.c:1019
sp : ffff800097886950
x29: ffff800097886990 x28: 0000000000000000 x27: ffff80008aeec3c0
x26: ffff0000d051c718 x25: dfff800000000000 x24: 0000000000000000
x23: ffff80009365bb10 x22: ffff0000d051c000 x21: 0000000000000000
x20: ffff8000894dfe30 x19: ffff0000d051c700 x18: ffff800097885e20
x17: 626f203234343766 x16: ffff80008aca1180 x15: 0000000000000001
x14: 1ffff00012f10c44 x13: 0000000000000000 x12: 0000000000000000
x11: 0000000000000002 x10: 0000000000ff0100 x9 : f70d4eacec590700
x8 : f70d4eacec590700 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff800097886238 x4 : ffff80008ed517e0 x3 : ffff80008036df60
x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000
Call trace:
debug_print_object lib/debugobjects.c:514 [inline]
__debug_check_no_obj_freed lib/debugobjects.c:989 [inline]
debug_check_no_obj_freed+0x398/0x47c lib/debugobjects.c:1019
slab_free_hook mm/slub.c:2093 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x114/0x3cc mm/slub.c:4409
kvfree+0x40/0x50 mm/util.c:663
ip_set_free+0x28/0x7c net/netfilter/ipset/ip_set_core.c:264
bitmap_port_destroy+0xe4/0x324 net/netfilter/ipset/ip_set_bitmap_gen.h:66
ip_set_create+0x904/0xf48 net/netfilter/ipset/ip_set_core.c:1157
nfnetlink_rcv_msg+0xa78/0xf80 net/netfilter/nfnetlink.c:302
netlink_rcv_skb+0x214/0x3c4 net/netlink/af_netlink.c:2543
nfnetlink_rcv+0x21c/0x1ed0 net/netfilter/nfnetlink.c:659
netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
netlink_unicast+0x65c/0x898 net/netlink/af_netlink.c:1367
netlink_sendmsg+0x83c/0xb20 net/netlink/af_netlink.c:1908
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x56c/0x840 net/socket.c:2584
___sys_sendmsg net/socket.c:2638 [inline]
__sys_sendmsg+0x26c/0x33c net/socket.c:2667
__do_sys_sendmsg net/socket.c:2676 [inline]
__se_sys_sendmsg net/socket.c:2674 [inline]
__arm64_sys_sendmsg+0x80/0x94 net/socket.c:2674
__invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
el0_svc+0x54/0x158 arch/arm64/kernel/entry-common.c:678
el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598
irq event stamp: 524
hardirqs last enabled at (523): [<ffff80008035f104>] __up_console_sem kernel/printk/printk.c:341 [inline]
hardirqs last enabled at (523): [<ffff80008035f104>] __console_unlock kernel/printk/printk.c:2706 [inline]
hardirqs last enabled at (523): [<ffff80008035f104>] console_unlock+0x17c/0x3d4 kernel/printk/printk.c:3038
hardirqs last disabled at (524): [<ffff80008ad60eac>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:436
softirqs last enabled at (518): [<ffff80008002189c>] softirq_handle_end kernel/softirq.c:399 [inline]
softirqs last enabled at (518): [<ffff80008002189c>] __do_softirq+0xac8/0xce4 kernel/softirq.c:582
softirqs last disabled at (507): [<ffff80008002ab48>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:81
---[ end trace 0000000000000000 ]---


---
This report 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 issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

Hillf Danton

unread,
Feb 13, 2024, 7:56:09 PMFeb 13
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Tue, 13 Feb 2024 10:22:24 -0800
> HEAD commit: f735966ee23c Merge branches 'for-next/reorg-va-space' and ..
> git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=161a6ba2180000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

--- x/net/netfilter/ipset/ip_set_bitmap_gen.h
+++ y/net/netfilter/ipset/ip_set_bitmap_gen.h
@@ -60,6 +60,7 @@ mtype_destroy(struct ip_set *set)
{
struct mtype *map = set->data;

+ del_timer_sync(&map->gc);
if (set->dsize && set->extensions & IPSET_EXT_DESTROY)
mtype_ext_cleanup(set);
ip_set_free(map->members);
--

syzbot

unread,
Feb 13, 2024, 10:44:05 PMFeb 13
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+ebbab3...@syzkaller.appspotmail.com

Tested on:

commit: 7e90b5c2 Merge tag 'trace-tools-v6.8-rc4' of git://git..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=11135a78180000
kernel config: https://syzkaller.appspot.com/x/.config?x=3d2ba14dfa6c1908
dashboard link: https://syzkaller.appspot.com/bug?extid=ebbab3e04c88fa141e6b
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
patch: https://syzkaller.appspot.com/x/patch.diff?x=11eebca4180000

Note: testing is done by a robot and is best-effort only.

Jozsef Kadlecsik

unread,
Feb 14, 2024, 4:08:26 AMFeb 14
to core...@netfilter.org, David Miller, edum...@google.com, Florian Westphal, ku...@kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, netfilt...@vger.kernel.org, pab...@redhat.com, Pablo Neira Ayuso, syzkall...@googlegroups.com
Hi,

It seems this is an old bug uncovered now: the bitmap type of sets still
use del_timer_sync() to cancel the garbage collecors. However
del_timer_sync() does not prevent rearming, which is triggered by syzbot.
The proper way to solve the issue is a one-liner:

diff --git a/net/netfilter/ipset/ip_set_bitmap_gen.h b/net/netfilter/ipset/ip_set_bitmap_gen.h
index cb48a2b9cb9f..60f5e29ac8fd 100644
--- a/net/netfilter/ipset/ip_set_bitmap_gen.h
+++ b/net/netfilter/ipset/ip_set_bitmap_gen.h
@@ -294,7 +294,7 @@ mtype_cancel_gc(struct ip_set *set)
struct mtype *map = set->data;

if (SET_WITH_TIMEOUT(set))
- del_timer_sync(&map->gc);
+ timer_shutdown_sync(&map->gc);
}

static const struct ip_set_type_variant mtype = {

(There are no other set types in ipset where del_timer_sync() is used.)

I'll need time for testing then if it fixes the bug, then I'll submit the
patch.

Best regards,
Jozsef
--
E-mail : kad...@blackhole.kfki.hu, kadlecsi...@wigner.hu
PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics
H-1525 Budapest 114, POB. 49, Hungary

syzbot

unread,
Feb 14, 2024, 4:15:34 AMFeb 14
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
Author: kad...@netfilter.org

syzbot

unread,
Feb 14, 2024, 4:18:59 AMFeb 14
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
Author: kad...@blackhole.kfki.hu

syzbot

unread,
Feb 14, 2024, 4:35:04 AMFeb 14
to kad...@netfilter.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot tried to test the proposed patch but the build/boot failed:

failed to apply patch:
checking file net/netfilter/ipset/ip_set_bitmap_gen.h
patch: **** unexpected end of file in patch



Tested on:

commit: f735966e Merge branches 'for-next/reorg-va-space' and ..
userspace arch: arm64
patch: https://syzkaller.appspot.com/x/patch.diff?x=173bec1c180000

syzbot

unread,
Feb 14, 2024, 4:52:05 AMFeb 14
to kad...@blackhole.kfki.hu, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING: ODEBUG bug in ip_set_free

------------[ cut here ]------------
ODEBUG: free active (active state 0) object: 0000000062ae9ef3 object type: timer_list hint: bitmap_port_gc+0x0/0x4dc net/netfilter/ipset/ip_set_bitmap_port.c:282
WARNING: CPU: 0 PID: 6628 at lib/debugobjects.c:517 debug_print_object lib/debugobjects.c:514 [inline]
WARNING: CPU: 0 PID: 6628 at lib/debugobjects.c:517 __debug_check_no_obj_freed lib/debugobjects.c:989 [inline]
WARNING: CPU: 0 PID: 6628 at lib/debugobjects.c:517 debug_check_no_obj_freed+0x398/0x47c lib/debugobjects.c:1019
Modules linked in:
CPU: 0 PID: 6628 Comm: syz-executor.0 Not tainted 6.8.0-rc3-syzkaller-00010-gf735966ee23c-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : debug_print_object lib/debugobjects.c:514 [inline]
pc : __debug_check_no_obj_freed lib/debugobjects.c:989 [inline]
pc : debug_check_no_obj_freed+0x398/0x47c lib/debugobjects.c:1019
lr : debug_print_object lib/debugobjects.c:514 [inline]
lr : __debug_check_no_obj_freed lib/debugobjects.c:989 [inline]
lr : debug_check_no_obj_freed+0x398/0x47c lib/debugobjects.c:1019
sp : ffff8000978c6950
x29: ffff8000978c6990 x28: 0000000000000000 x27: ffff80008aeec3c0
x26: ffff0000e345d318 x25: dfff800000000000 x24: 0000000000000000
x23: ffff80009368be40 x22: ffff0000e345d000 x21: 0000000000000000
x20: ffff8000894dfe30 x19: ffff0000e345d300 x18: 1fffe000367ff596
x17: ffff80008ec6d000 x16: ffff80008031fff4 x15: 0000000000000001
x14: 1fffe00036801de8 x13: 0000000000000000 x12: 0000000000000003
x11: 0000000000000001 x10: 0000000000000003 x9 : dee47f29bae7c100
x8 : dee47f29bae7c100 x7 : ffff800080296b68 x6 : 0000000000000000
x5 : 0000000000000001 x4 : 0000000000000001 x3 : 0000000000000000
x2 : 0000000000000006 x1 : ffff80008aecd8e0 x0 : ffff800125439000
irq event stamp: 294
hardirqs last enabled at (293): [<ffff800080296c08>] raw_spin_rq_unlock_irq kernel/sched/sched.h:1397 [inline]
hardirqs last enabled at (293): [<ffff800080296c08>] finish_lock_switch+0xbc/0x1e4 kernel/sched/core.c:5154
hardirqs last disabled at (294): [<ffff80008ad60eac>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:436
softirqs last enabled at (276): [<ffff80008002189c>] softirq_handle_end kernel/softirq.c:399 [inline]
softirqs last enabled at (276): [<ffff80008002189c>] __do_softirq+0xac8/0xce4 kernel/softirq.c:582
softirqs last disabled at (147): [<ffff80008002ab48>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:81
---[ end trace 0000000000000000 ]---


Tested on:

commit: f735966e Merge branches 'for-next/reorg-va-space' and ..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
console output: https://syzkaller.appspot.com/x/log.txt?x=10afd01c180000
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
patch: https://syzkaller.appspot.com/x/patch.diff?x=10de0934180000

syzbot

unread,
Feb 15, 2024, 6:38:55 AMFeb 15
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: Re: WARNING: ODEBUG bug in ip_set_free
Author: f...@strlen.de

syzbot

unread,
Feb 15, 2024, 7:25:04 AMFeb 15
to f...@strlen.de, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+ebbab3...@syzkaller.appspotmail.com

Tested on:

commit: 8d3dea21 Merge tag 'mips-fixes_6.8_2' of git://git.ker..
console output: https://syzkaller.appspot.com/x/log.txt?x=1615eee0180000
kernel config: https://syzkaller.appspot.com/x/.config?x=3d2ba14dfa6c1908
dashboard link: https://syzkaller.appspot.com/bug?extid=ebbab3e04c88fa141e6b
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64

Note: no patches were applied.

syzbot

unread,
Feb 15, 2024, 7:39:16 AMFeb 15
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: Re: [syzbot] [netfilter?] WARNING: ODEBUG bug in ip_set_free
Author: f...@strlen.de

#syz fix: netfilter: ipset: Missing gc cancellations fixed
Reply all
Reply to author
Forward
0 new messages