All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Emil Goode <emilgoode@gmail.com>
Cc: Rashika Kheria <rashika.kheria@gmail.com>,
	Valentina Manea <valentina.manea.m@gmail.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Andrea Merello <andrea.merello@gmail.com>,
	devel@driverdev.osuosl.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Staging: rtl8192e: Fix potential NULL pointer dereference
Date: Wed, 02 Jul 2014 17:32:55 +0000	[thread overview]
Message-ID: <20140702173255.GA18649@kroah.com> (raw)
In-Reply-To: <20140702172620.GA4848@lianli>

On Wed, Jul 02, 2014 at 07:26:20PM +0200, Emil Goode wrote:
> Hello Greg,
> 
> On Wed, Jul 02, 2014 at 09:33:34AM -0700, Greg Kroah-Hartman wrote:
> > On Wed, Jul 02, 2014 at 11:25:51AM +0200, Emil Goode wrote:
> > > We need to make sure the struct rtllib_device pointer ieee is not NULL
> > > after the goto rx_dropped label since it is dereferenced there.
> > > 
> > > Signed-off-by: Emil Goode <emilgoode@gmail.com>
> > > ---
> > >  drivers/staging/rtl8192e/rtllib_rx.c |    3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
> > > index 60de54c..7db3e74 100644
> > > --- a/drivers/staging/rtl8192e/rtllib_rx.c
> > > +++ b/drivers/staging/rtl8192e/rtllib_rx.c
> > > @@ -1496,7 +1496,8 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb,
> > >  	return ret;
> > >  
> > >   rx_dropped:
> > > -	ieee->stats.rx_dropped++;
> > > +	if (ieee)
> > > +		ieee->stats.rx_dropped++;
> > >  	return 0;
> > >  }
> > >  EXPORT_SYMBOL(rtllib_rx);
> > 
> > Is this something that is hitting users today in the tree, or is this
> > just a bug you found looking at the code?
> 
> It's a static checker fix and I'm not aware of any impact on users.
> If you want I will resend with that information added?

No, that's fine, just trying to see which kernel to apply this to...

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Emil Goode <emilgoode@gmail.com>
Cc: Rashika Kheria <rashika.kheria@gmail.com>,
	Valentina Manea <valentina.manea.m@gmail.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Andrea Merello <andrea.merello@gmail.com>,
	devel@driverdev.osuosl.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Staging: rtl8192e: Fix potential NULL pointer dereference
Date: Wed, 2 Jul 2014 10:32:55 -0700	[thread overview]
Message-ID: <20140702173255.GA18649@kroah.com> (raw)
In-Reply-To: <20140702172620.GA4848@lianli>

On Wed, Jul 02, 2014 at 07:26:20PM +0200, Emil Goode wrote:
> Hello Greg,
> 
> On Wed, Jul 02, 2014 at 09:33:34AM -0700, Greg Kroah-Hartman wrote:
> > On Wed, Jul 02, 2014 at 11:25:51AM +0200, Emil Goode wrote:
> > > We need to make sure the struct rtllib_device pointer ieee is not NULL
> > > after the goto rx_dropped label since it is dereferenced there.
> > > 
> > > Signed-off-by: Emil Goode <emilgoode@gmail.com>
> > > ---
> > >  drivers/staging/rtl8192e/rtllib_rx.c |    3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
> > > index 60de54c..7db3e74 100644
> > > --- a/drivers/staging/rtl8192e/rtllib_rx.c
> > > +++ b/drivers/staging/rtl8192e/rtllib_rx.c
> > > @@ -1496,7 +1496,8 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb,
> > >  	return ret;
> > >  
> > >   rx_dropped:
> > > -	ieee->stats.rx_dropped++;
> > > +	if (ieee)
> > > +		ieee->stats.rx_dropped++;
> > >  	return 0;
> > >  }
> > >  EXPORT_SYMBOL(rtllib_rx);
> > 
> > Is this something that is hitting users today in the tree, or is this
> > just a bug you found looking at the code?
> 
> It's a static checker fix and I'm not aware of any impact on users.
> If you want I will resend with that information added?

No, that's fine, just trying to see which kernel to apply this to...

thanks,

greg k-h

  reply	other threads:[~2014-07-02 17:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-02  9:25 [PATCH] Staging: rtl8192e: Fix potential NULL pointer dereference Emil Goode
2014-07-02  9:25 ` Emil Goode
2014-07-02 16:33 ` Greg Kroah-Hartman
2014-07-02 16:33   ` Greg Kroah-Hartman
2014-07-02 17:26   ` Emil Goode
2014-07-02 17:26     ` Emil Goode
2014-07-02 17:32     ` Greg Kroah-Hartman [this message]
2014-07-02 17:32       ` Greg Kroah-Hartman

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=20140702173255.GA18649@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andrea.merello@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=emilgoode@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rashika.kheria@gmail.com \
    --cc=valentina.manea.m@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.