netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] skbuff: fix skb_segment with zero copy skbs
@ 2014-03-10 16:29 Michael S. Tsirkin
  2014-03-10 16:29 ` [PATCH 1/5] skbuff: skb_segment: s/frag/nskb_frag/ Michael S. Tsirkin
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Michael S. Tsirkin @ 2014-03-10 16:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: jbenc, netdev, David Miller

This fixes a bug in skb_segment where it moves frags
between skbs without orphaning them.
This causes userspace to assume it's safe to
reuse the buffer, and receiver gets corrupted data.
This further might leak information from the
transmitter on the wire.

To fix track which skb does a copied frag belong
to, and orphan frags when copying them.

As we are tracking multiple skbs here, using
short names (skb,nskb,fskb,skb_frag,frag) becomes confusing.
So before adding another one, I refactor these names
slightly.

Patch is split out to make it easier to
verify that all trasformations are trivially correct.

The problem was observed in the field,
so I think that the patch is necessary on stable
as well.

Michael S. Tsirkin (5):
  skbuff: skb_segment: s/frag/nskb_frag/
  skbuff: skb_segment: s/skb_frag/frag/
  skbuff: skb_segment: s/skb/head_skb/
  skbuff: skb_segment: s/fskb/list_skb/
  skbuff: skb_segment: orphan frags before copying

 net/core/skbuff.c | 100 +++++++++++++++++++++++++++++-------------------------
 1 file changed, 54 insertions(+), 46 deletions(-)

-- 
MST

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

end of thread, other threads:[~2014-03-11 20:27 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-10 16:29 [PATCH 0/5] skbuff: fix skb_segment with zero copy skbs Michael S. Tsirkin
2014-03-10 16:29 ` [PATCH 1/5] skbuff: skb_segment: s/frag/nskb_frag/ Michael S. Tsirkin
2014-03-10 16:29 ` [PATCH 2/5] skbuff: skb_segment: s/skb_frag/frag/ Michael S. Tsirkin
2014-03-10 16:29 ` [PATCH 3/5] skbuff: skb_segment: s/skb/head_skb/ Michael S. Tsirkin
2014-03-10 17:27 ` [PATCH 4/5] skbuff: skb_segment: s/fskb/list_skb/ Michael S. Tsirkin
2014-03-10 17:40   ` David Miller
2014-03-10 17:43     ` David Miller
2014-03-10 17:56       ` Michael S. Tsirkin
2014-03-10 20:45         ` David Miller
2014-03-10 17:28 ` [PATCH 5/5] skbuff: skb_segment: orphan frags before copying Michael S. Tsirkin
2014-03-10 21:34   ` Herbert Xu
2014-03-10 21:52     ` Michael S. Tsirkin
2014-03-10 21:56       ` Herbert Xu
2014-03-10 22:07         ` Michael S. Tsirkin
2014-03-10 22:12           ` Herbert Xu
2014-03-10 22:30             ` Michael S. Tsirkin
2014-03-11  0:39               ` Herbert Xu
2014-03-11  6:41                 ` Michael S. Tsirkin
2014-03-11  7:21                   ` Herbert Xu
2014-03-11 20:27 ` [PATCH 0/5] skbuff: fix skb_segment with zero copy skbs David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).