]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6/exthdrs: strict Pad1 and PadN check
authorEldad Zack <eldad@fogrefinery.com>
Sun, 20 May 2012 01:59:33 +0000 (01:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 20 May 2012 20:58:39 +0000 (16:58 -0400)
commitbd914d586e6aaf62b326f9ad0a81a81744f646ed
tree307801197cf9ce8b520a026962bf1e73f0019f9f
parent937d785df73bb77a01bc028e80397cec895a8a24
ipv6/exthdrs: strict Pad1 and PadN check

The following tightens the padding check from commit
6f012452c9af1f5cfab40bbed1b65715924f4609 :

* Take into account combinations of consecutive Pad1 and PadN.

* Catch the corner case of when only padding is present in the
  header, when the extention header length is 0 (i.e., 8 bytes).
  In this case, the header would have exactly 6 bytes of padding:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
:  Next Header  : Hdr Ext Len=0 :                               :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
:                        Padding (Pad1 or PadN)                 :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/exthdrs.c