All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: dp83640: Avoid NULL pointer dereference.
@ 2017-06-23 15:51 Richard Cochran
  2017-06-23 18:38 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Cochran @ 2017-06-23 15:51 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Manfred Rudigier, Stefan Sørensen

The function, skb_complete_tx_timestamp(), used to allow passing in a
NULL pointer for the time stamps, but that was changed in commit
62bccb8cdb69051b95a55ab0c489e3cab261c8ef ("net-timestamp: Make the
clone operation stand-alone from phy timestamping"), and the existing
call sites, all of which are in the dp83640 driver, were fixed up.

Even though the kernel-doc was subsequently updated in commit
7a76a021cd5a292be875fbc616daf03eab1e6996 ("net-timestamp: Update
skb_complete_tx_timestamp comment"), still a bug fix from Manfred
Rudigier came into the driver using the old semantics.  Probably
Manfred derived that patch from an older kernel version.

This fix should be applied to the stable trees as well.

Fixes: 81e8f2e930fe ("net: dp83640: Fix tx timestamp overflow handling.")
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/phy/dp83640.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index ed0d10f54f26..c3065236ffcc 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -908,7 +908,7 @@ static void decode_txts(struct dp83640_private *dp83640,
 	if (overflow) {
 		pr_debug("tx timestamp queue overflow, count %d\n", overflow);
 		while (skb) {
-			skb_complete_tx_timestamp(skb, NULL);
+			kfree_skb(skb);
 			skb = skb_dequeue(&dp83640->tx_queue);
 		}
 		return;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: dp83640: Avoid NULL pointer dereference.
  2017-06-23 15:51 [PATCH net] net: dp83640: Avoid NULL pointer dereference Richard Cochran
@ 2017-06-23 18:38 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-06-23 18:38 UTC (permalink / raw)
  To: richardcochran; +Cc: netdev, Manfred.Rudigier, stefan.sorensen

From: Richard Cochran <richardcochran@gmail.com>
Date: Fri, 23 Jun 2017 17:51:31 +0200

> The function, skb_complete_tx_timestamp(), used to allow passing in a
> NULL pointer for the time stamps, but that was changed in commit
> 62bccb8cdb69051b95a55ab0c489e3cab261c8ef ("net-timestamp: Make the
> clone operation stand-alone from phy timestamping"), and the existing
> call sites, all of which are in the dp83640 driver, were fixed up.
> 
> Even though the kernel-doc was subsequently updated in commit
> 7a76a021cd5a292be875fbc616daf03eab1e6996 ("net-timestamp: Update
> skb_complete_tx_timestamp comment"), still a bug fix from Manfred
> Rudigier came into the driver using the old semantics.  Probably
> Manfred derived that patch from an older kernel version.
> 
> This fix should be applied to the stable trees as well.
> 
> Fixes: 81e8f2e930fe ("net: dp83640: Fix tx timestamp overflow handling.")
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>

Applied and queued up for -stable, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-23 18:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-23 15:51 [PATCH net] net: dp83640: Avoid NULL pointer dereference Richard Cochran
2017-06-23 18:38 ` David Miller

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.