lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 30 Mar 2010 23:55:55 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	paulius.zaleckas@...il.com
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH] skb_put: remove not needed check for skb linearity

From: Paulius Zaleckas <paulius.zaleckas@...il.com>
Date: Tue, 30 Mar 2010 16:01:31 +0300

> It is safe to call skb_put() on packets containing fragments.
> 
> Actually I have a case where I allocate packet header with some
> extra headroom and then I dynamically add data as frag_list. After
> adding frags I have to add more data to header and skb_put()
> just BUG's on me :)
> 
> And we will save couple instructions for CPU.
> 
> Signed-off-by: Paulius Zaleckas <paulius.zaleckas@...il.com>

No, you really cannot do this, that check is very much intentional and
needs to be there.  Otherwise we will allow violations of the
semantics of the SKB data area.

Once you put even one byte of non-linear data into the skb, all data
must be "put" to the end of that non-linear area, without exception.

You can't just stuff arbitrary things "in-between" the linear and the
non-linear stuff.

You'll need to find a way to construct your SKBs properly such that
the entirety of the linear area is constructed before you start
adding non-linear elements.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists