From: Richard Cochran <richardcochran@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Stefan Sørensen" <stefan.sorensen@spectralink.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Florian Fainelli" <f.fainelli@gmail.com>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] dp83640: don't recieve time stamps twice
Date: Tue, 18 Apr 2017 20:19:17 +0000 [thread overview]
Message-ID: <20170418201917.GA4428@localhost.localdomain> (raw)
In-Reply-To: <20170418191426.GA17838@mwanda>
On Tue, Apr 18, 2017 at 10:14:26PM +0300, Dan Carpenter wrote:
> This patch is prompted by a static checker warning about a potential
> use after free. The concern is that netif_rx_ni() can free "skb" and we
> call it twice.
Right, the code already calls netif_rx_ni() in the list_for_each_safe()
loop just above, in the case that the shhwtstamps pointer has been set.
> When I look at the commit that added this, it looks like some stray
> lines were added accidentally. It doesn't make sense to me that we
> would recieve the same data two times. I asked the author but never
> recieved a response.
Hm, maybe the intent was to move the call to netif_rx_ni() outside of
the spin_lock_irqsave() region (which how I had it before Stefan's
changes).
But calling netif_rx_ni() twice is clearly wrong.
Thanks,
Richard
WARNING: multiple messages have this Message-ID (diff)
From: Richard Cochran <richardcochran@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Stefan Sørensen" <stefan.sorensen@spectralink.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Florian Fainelli" <f.fainelli@gmail.com>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] dp83640: don't recieve time stamps twice
Date: Tue, 18 Apr 2017 22:19:17 +0200 [thread overview]
Message-ID: <20170418201917.GA4428@localhost.localdomain> (raw)
In-Reply-To: <20170418191426.GA17838@mwanda>
On Tue, Apr 18, 2017 at 10:14:26PM +0300, Dan Carpenter wrote:
> This patch is prompted by a static checker warning about a potential
> use after free. The concern is that netif_rx_ni() can free "skb" and we
> call it twice.
Right, the code already calls netif_rx_ni() in the list_for_each_safe()
loop just above, in the case that the shhwtstamps pointer has been set.
> When I look at the commit that added this, it looks like some stray
> lines were added accidentally. It doesn't make sense to me that we
> would recieve the same data two times. I asked the author but never
> recieved a response.
Hm, maybe the intent was to move the call to netif_rx_ni() outside of
the spin_lock_irqsave() region (which how I had it before Stefan's
changes).
But calling netif_rx_ni() twice is clearly wrong.
Thanks,
Richard
next prev parent reply other threads:[~2017-04-18 20:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-18 19:14 [PATCH] dp83640: don't recieve time stamps twice Dan Carpenter
2017-04-18 19:14 ` Dan Carpenter
2017-04-18 20:19 ` Richard Cochran [this message]
2017-04-18 20:19 ` Richard Cochran
2017-04-19 9:16 ` Sørensen, Stefan
2017-04-19 9:16 ` Sørensen, Stefan
2017-04-19 10:31 ` Richard Cochran
2017-04-19 10:31 ` Richard Cochran
2017-04-19 10:53 ` Dan Carpenter
2017-04-19 10:53 ` Dan Carpenter
2017-04-19 11:28 ` Sørensen, Stefan
2017-04-19 11:28 ` Sørensen, Stefan
2017-04-19 11:54 ` Richard Cochran
2017-04-19 11:54 ` Richard Cochran
2017-04-20 20:02 ` David Miller
2017-04-20 20:02 ` David Miller
2017-04-20 21:30 ` Richard Cochran
2017-04-20 21:30 ` Richard Cochran
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=20170418201917.GA4428@localhost.localdomain \
--to=richardcochran@gmail.com \
--cc=andrew@lunn.ch \
--cc=dan.carpenter@oracle.com \
--cc=f.fainelli@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stefan.sorensen@spectralink.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.