From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+9ada62e1dc03fdc41982@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] WARNING in cleanup_net (3)
Date: Sun, 7 Apr 2024 18:33:06 +0800 [thread overview]
Message-ID: <20240407103306.1364-1-hdanton@sina.com> (raw)
In-Reply-To: <0000000000009c0f98061550a827@google.com>
On Thu, 04 Apr 2024 20:00:30 -0700
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: fe46a7dd189e Merge tag 'sound-6.9-rc1' of git://git.kernel..
> git tree: upstream
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16696223180000
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git fe46a7dd189e
--- x/include/net/net_namespace.h
+++ y/include/net/net_namespace.h
@@ -318,7 +318,7 @@ static inline int check_net(const struct
return 1;
}
-#define net_drop_ns NULL
+static void net_drop_ns(void *p) {}
#endif
@@ -353,6 +353,7 @@ static inline void __netns_tracker_free(
static inline struct net *get_net_track(struct net *net,
netns_tracker *tracker, gfp_t gfp)
{
+ refcount_inc(&net->passive);
get_net(net);
netns_tracker_alloc(net, tracker, gfp);
return net;
@@ -362,6 +363,7 @@ static inline void put_net_track(struct
{
__netns_tracker_free(net, tracker, true);
put_net(net);
+ net_drop_ns(net);
}
typedef struct {
--- x/net/netfilter/nf_nat_masquerade.c
+++ y/net/netfilter/nf_nat_masquerade.c
@@ -123,11 +123,12 @@ static void nf_nat_masq_schedule(struct
INIT_WORK(&w->work, iterate_cleanup_work);
w->ifindex = ifindex;
w->net = net;
- netns_tracker_alloc(net, &w->ns_tracker, gfp_flags);
+ get_net_track(net, &w->ns_tracker, gfp_flags);
w->iter = iter;
if (addr)
w->addr = *addr;
schedule_work(&w->work);
+ put_net(net);
return;
}
--
next prev parent reply other threads:[~2024-04-07 10:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-30 8:30 [syzbot] [net?] WARNING in cleanup_net (3) syzbot
2024-04-05 3:00 ` syzbot
2024-04-05 6:37 ` Hillf Danton
2024-04-06 15:20 ` syzbot
2024-04-05 21:22 ` Eric Dumazet
2024-04-06 22:48 ` Hillf Danton
2024-04-07 3:20 ` syzbot
2024-04-07 10:33 ` Hillf Danton [this message]
2024-04-07 11:08 ` syzbot
-- strict thread matches above, loose matches on Subject: below --
2023-11-30 8:42 xingwei lee
2023-11-30 8:46 ` Eric Dumazet
2023-11-30 9:38 ` Eric Dumazet
2023-12-01 0:39 ` xingwei lee
[not found] ` <20231201111253.1029-1-hdanton@sina.com>
2023-12-01 12:52 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240407103306.1364-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+9ada62e1dc03fdc41982@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox