netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: syzbot <syzbot+03218bcdba6aa76441a3@syzkaller.appspotmail.com>
To: coreteam@netfilter.org, davem@davemloft.net, fw@strlen.de,
	kadlec@blackhole.kfki.hu, kuznet@ms2.inr.ac.ru,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org, pabeni@redhat.com,
	pablo@netfilter.org, syzkaller-bugs@googlegroups.com,
	xiyou.wangcong@gmail.com, yoshfuji@linux-ipv6.org
Subject: WARNING: proc registration bug in clusterip_tg_check
Date: Wed, 07 Feb 2018 03:24:01 -0800	[thread overview]
Message-ID: <f4030437f0e834ba2a05649d88c9@google.com> (raw)
In-Reply-To: <65775a4878958a927b7d7d5e31dc240486096f31.1518001993.git.pabeni@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1900 bytes --]

Hello,

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

kernel build failed: failed to run /usr/bin/make [make bzImage -j 32  
CC=/syzkaller/gcc/bin/gcc]: exit status 2
scripts/kconfig/conf  --silentoldconfig Kconfig
   CHK     include/config/kernel.release
   CHK     include/generated/uapi/linux/version.h
   CHK     include/generated/utsrelease.h
   CHK     scripts/mod/devicetable-offsets.h
   CHK     include/generated/bounds.h
   CHK     include/generated/timeconst.h
   CHK     include/generated/asm-offsets.h
   CALL    scripts/checksyscalls.sh
   CHK     include/generated/compile.h
   CC      net/ipv4/netfilter/ipt_CLUSTERIP.o
   CC      net/ipv4/netfilter/ipt_MASQUERADE.o
   CC      net/ipv4/netfilter/ipt_REJECT.o
   CC      net/ipv4/netfilter/ipt_SYNPROXY.o
   CC      net/ipv4/netfilter/arp_tables.o
   CC      net/ipv4/netfilter/arpt_mangle.o
   CC      net/ipv4/netfilter/arptable_filter.o
   CC      net/ipv4/netfilter/nf_dup_ipv4.o
net/ipv4/netfilter/ipt_CLUSTERIP.c: In function ‘clusterip_config_init’:
net/ipv4/netfilter/ipt_CLUSTERIP.c:253:22: error: expected ‘;’ before ‘:’  
token
    goto err_remove_pte:
                       ^
scripts/Makefile.build:316: recipe for  
target 'net/ipv4/netfilter/ipt_CLUSTERIP.o' failed
make[3]: *** [net/ipv4/netfilter/ipt_CLUSTERIP.o] Error 1
make[3]: *** Waiting for unfinished jobs....
scripts/Makefile.build:575: recipe for target 'net/ipv4/netfilter' failed
make[2]: *** [net/ipv4/netfilter] Error 2
scripts/Makefile.build:575: recipe for target 'net/ipv4' failed
make[1]: *** [net/ipv4] Error 2
Makefile:1020: recipe for target 'net' failed
make: *** [net] Error 2



Tested on net commit
176bfb406d735655f9a69d868a7af0c3da959d51 (Tue Feb 6 16:48:40 2018 +0000)
Merge branch 'be2net-patch-set'

compiler: gcc (GCC) 7.1.1 20170620
Patch is attached.




[-- Attachment #2: patch.diff --]
[-- Type: text/plain, Size: 1263 bytes --]

--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -230,17 +230,6 @@ clusterip_config_init(struct net *net, const struct ipt_clusterip_tgt_info *i,
 	refcount_set(&c->refcount, 1);
 	refcount_set(&c->entries, 1);
 
-	spin_lock_bh(&cn->lock);
-	if (__clusterip_config_find(net, ip)) {
-		spin_unlock_bh(&cn->lock);
-		kfree(c);
-
-		return ERR_PTR(-EBUSY);
-	}
-
-	list_add_rcu(&c->list, &cn->configs);
-	spin_unlock_bh(&cn->lock);
-
 #ifdef CONFIG_PROC_FS
 	{
 		char buffer[16];
@@ -257,20 +246,31 @@ clusterip_config_init(struct net *net, const struct ipt_clusterip_tgt_info *i,
 	}
 #endif
 
+	spin_lock_bh(&cn->lock);
+	if (__clusterip_config_find(net, ip)) {
+		spin_unlock_bh(&cn->lock);
+		err = -EBUSY;
+		goto err_remove_pte:
+	}
+
+	list_add_rcu(&c->list, &cn->configs);
+	spin_unlock_bh(&cn->lock);
+
 	c->notifier.notifier_call = clusterip_netdev_event;
 	err = register_netdevice_notifier(&c->notifier);
 	if (!err)
 		return c;
 
+	spin_lock_bh(&cn->lock);
+	list_del_rcu(&c->list);
+	spin_unlock_bh(&cn->lock);
+
+err_remove_pte:
 #ifdef CONFIG_PROC_FS
 	proc_remove(c->pde);
 err:
 #endif
-	spin_lock_bh(&cn->lock);
-	list_del_rcu(&c->list);
-	spin_unlock_bh(&cn->lock);
 	kfree(c);
-
 	return ERR_PTR(err);
 }
 

  parent reply	other threads:[~2018-02-07 11:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <65775a4878958a927b7d7d5e31dc240486096f31.1518001993.git.pabeni@redhat.com>
2018-02-07 11:23 ` WARNING: proc registration bug in clusterip_tg_check syzbot
2018-02-07 11:24 ` syzbot [this message]
2022-12-27 15:09 Wei Chen
  -- strict thread matches above, loose matches on Subject: below --
2018-02-06 14:27 syzbot
2018-02-07  6:42 ` Cong Wang
2018-02-07  8:43   ` Paolo Abeni
2018-02-07 15:57     ` Paolo Abeni
2018-02-07 10:41 ` Paolo Abeni
2018-02-07 10:42   ` syzbot
2018-02-07 10:50     ` Dmitry Vyukov
2018-02-07 11:04   ` syzbot
2018-02-07 11:31   ` Florian Westphal

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=f4030437f0e834ba2a05649d88c9@google.com \
    --to=syzbot+03218bcdba6aa76441a3@syzkaller.appspotmail.com \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=xiyou.wangcong@gmail.com \
    --cc=yoshfuji@linux-ipv6.org \
    /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;
as well as URLs for NNTP newsgroup(s).