Patchwork [3/3] nfnetlink: Unlock a previously locked rcu_read in nfnetlink_rcv_msg

login
register
mail settings
Submitter Tomasz Bursztyka
Date June 28, 2012, 12:57 p.m.
Message ID <1340888269-4926-4-git-send-email-tomasz.bursztyka@linux.intel.com>
Download mbox | patch
Permalink /patch/167871/
State Accepted
Headers show

Comments

Tomasz Bursztyka - June 28, 2012, 12:57 p.m.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
---
 net/netfilter/nfnetlink.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Eric Dumazet - June 28, 2012, 1:30 p.m.
On Thu, 2012-06-28 at 15:57 +0300, Tomasz Bursztyka wrote:
> Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
> ---
>  net/netfilter/nfnetlink.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
> index 4acdd76..a6366ae 100644
> --- a/net/netfilter/nfnetlink.c
> +++ b/net/netfilter/nfnetlink.c
> @@ -169,8 +169,10 @@ replay:
>  
>  		err = nla_parse(cda, ss->cb[cb_id].attr_count,
>  				attr, attrlen, ss->cb[cb_id].policy);
> -		if (err < 0)
> +		if (err < 0) {
> +			rcu_read_unlock();
>  			return err;
> +		}
>  
>  		if (nc->call_rcu) {
>  			err = nc->call_rcu(net->nfnl, skb, nlh,

Nice catch, thanks.

Please someone add in changelog to ease stable team work :

Bug added in commit 6b75e3e8d664a9a (netfilter: nfnetlink: add RCU in
nfnetlink_rcv_msg())

Acked-by: Eric Dumazet <edumazet@google.com>


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pablo Neira - June 29, 2012, 11:13 a.m.
On Thu, Jun 28, 2012 at 03:30:10PM +0200, Eric Dumazet wrote:
> On Thu, 2012-06-28 at 15:57 +0300, Tomasz Bursztyka wrote:
> > Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
> > ---
> >  net/netfilter/nfnetlink.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> > 
> > diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
> > index 4acdd76..a6366ae 100644
> > --- a/net/netfilter/nfnetlink.c
> > +++ b/net/netfilter/nfnetlink.c
> > @@ -169,8 +169,10 @@ replay:
> >  
> >  		err = nla_parse(cda, ss->cb[cb_id].attr_count,
> >  				attr, attrlen, ss->cb[cb_id].policy);
> > -		if (err < 0)
> > +		if (err < 0) {
> > +			rcu_read_unlock();
> >  			return err;
> > +		}
> >  
> >  		if (nc->call_rcu) {
> >  			err = nc->call_rcu(net->nfnl, skb, nlh,
> 
> Nice catch, thanks.
> 
> Please someone add in changelog to ease stable team work :
> 
> Bug added in commit 6b75e3e8d664a9a (netfilter: nfnetlink: add RCU in
> nfnetlink_rcv_msg())
> 
> Acked-by: Eric Dumazet <edumazet@google.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index 4acdd76..a6366ae 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -169,8 +169,10 @@  replay:
 
 		err = nla_parse(cda, ss->cb[cb_id].attr_count,
 				attr, attrlen, ss->cb[cb_id].policy);
-		if (err < 0)
+		if (err < 0) {
+			rcu_read_unlock();
 			return err;
+		}
 
 		if (nc->call_rcu) {
 			err = nc->call_rcu(net->nfnl, skb, nlh,