All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] net: remove erroneous sk null assignment in timestamping
@ 2011-10-07 17:11 Johannes Berg
  2011-10-07 17:33 ` David Miller
  2011-10-12 18:36 ` [PATCH 1/1] net: hold sock reference while processing tx timestamps Richard Cochran
  0 siblings, 2 replies; 56+ messages in thread
From: Johannes Berg @ 2011-10-07 17:11 UTC (permalink / raw)
  To: netdev; +Cc: Richard Cochran

From: Johannes Berg <johannes.berg@intel.com>

skb->sk is obviously required to be non-NULL
when we get into skb_complete_tx_timestamp().
sock_queue_err_skb() will call skb_orphan()
first thing which sets skb->sk = NULL itself.
This may crash if the skb is still charged to
the socket (skb->destructor is sk_wfree).

The assignment here thus seems to not only be
pointless (due to the skb_orphan() call) but
also dangerous (due to the crash).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/core/timestamping.c |    1 -
 1 file changed, 1 deletion(-)

--- a/net/core/timestamping.c	2011-10-07 18:59:12.000000000 +0200
+++ b/net/core/timestamping.c	2011-10-07 19:07:06.000000000 +0200
@@ -85,7 +85,6 @@ void skb_complete_tx_timestamp(struct sk
 	memset(serr, 0, sizeof(*serr));
 	serr->ee.ee_errno = ENOMSG;
 	serr->ee.ee_origin = SO_EE_ORIGIN_TIMESTAMPING;
-	skb->sk = NULL;
 	err = sock_queue_err_skb(sk, skb);
 	if (err)
 		kfree_skb(skb);

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

end of thread, other threads:[~2011-10-24 23:17 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-07 17:11 [RFC] net: remove erroneous sk null assignment in timestamping Johannes Berg
2011-10-07 17:33 ` David Miller
2011-10-07 17:40   ` Johannes Berg
2011-10-07 17:47     ` Johannes Berg
2011-10-07 17:53       ` Johannes Berg
2011-10-07 18:42     ` Johannes Berg
2011-10-08  7:59       ` Richard Cochran
2011-10-08  7:57   ` Richard Cochran
2011-10-08  8:16     ` Johannes Berg
2011-10-08  8:57       ` Eric Dumazet
2011-10-08 10:32         ` Johannes Berg
2011-10-11 13:34           ` Richard Cochran
2011-10-08 10:35         ` Richard Cochran
2011-10-12 18:36 ` [PATCH 1/1] net: hold sock reference while processing tx timestamps Richard Cochran
2011-10-12 19:25   ` Eric Dumazet
2011-10-12 19:27   ` Johannes Berg
2011-10-12 19:52     ` Eric Dumazet
2011-10-13  8:54       ` Johannes Berg
2011-10-13  4:51     ` Richard Cochran
2011-10-13  9:46   ` [PATCH 0/3] net: time stamping fixes Richard Cochran
2011-10-13  9:46     ` [PATCH 1/3] net: hold sock reference while processing tx timestamps Richard Cochran
2011-10-19  4:42       ` Eric Dumazet
2011-10-13  9:46     ` [PATCH 2/3] dp83640: use proper function to free transmit time stamping packets Richard Cochran
2011-10-19  4:47       ` Eric Dumazet
2011-10-13  9:46     ` [PATCH 3/3] dp83640: free packet queues on remove Richard Cochran
2011-10-19  4:48       ` Eric Dumazet
2011-10-19  4:16     ` [PATCH 0/3] net: time stamping fixes David Miller
2011-10-19  5:15       ` Johannes Berg
2011-10-19 11:50         ` Richard Cochran
2011-10-19 12:33           ` Eric Dumazet
2011-10-19 12:38           ` Eric Dumazet
2011-10-19 12:58             ` Johannes Berg
2011-10-19 13:09               ` Johannes Berg
2011-10-19 13:25                 ` Eric Dumazet
2011-10-19 13:35                   ` Johannes Berg
2011-10-19 13:44                     ` Eric Dumazet
2011-10-19 13:57                       ` Johannes Berg
2011-10-19 14:08                         ` Eric Dumazet
2011-10-19 14:24                           ` Johannes Berg
2011-10-19 14:27                             ` Richard Cochran
2011-10-19 14:33                               ` Eric Dumazet
2011-10-19 13:21               ` Eric Dumazet
2011-10-19 13:25                 ` Johannes Berg
2011-10-19 13:27                   ` Eric Dumazet
2011-10-19 13:32                     ` Johannes Berg
2011-10-19 14:25                       ` Richard Cochran
2011-10-21 10:49   ` [PATCH v2 " Richard Cochran
2011-10-21 10:49     ` [PATCH v2 1/3] net: hold sock reference while processing tx timestamps Richard Cochran
2011-10-21 11:31       ` Eric Dumazet
2011-10-24  6:55         ` David Miller
2011-10-21 11:44       ` Johannes Berg
2011-10-21 10:49     ` [PATCH v2 2/3] dp83640: use proper function to free transmit time stamping packets Richard Cochran
2011-10-24  6:55       ` David Miller
2011-10-24 17:47         ` Richard Cochran
2011-10-24 23:16           ` David Miller
2011-10-21 10:49     ` [PATCH v2 3/3] dp83640: free packet queues on remove Richard Cochran

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.