]> 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)
commitee8c7a266075664633019458a0dfee36c9a20bf9
tree307801197cf9ce8b520a026962bf1e73f0019f9f
parent10114f4a63489065cef34b25627c41a2a6c8953f
ipv6/exthdrs: strict Pad1 and PadN check

The following tightens the padding check from commit
8094d0b3dff20835f988daf512bdf9165f64de0c :

* 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