]> pilppa.org Git - linux-2.6-omap-h63xx.git/commit
dccp: Silently ignore options with nonsensical lengths
authorGerrit Renker <gerrit@erg.abdn.ac.uk>
Sat, 23 Aug 2008 11:28:27 +0000 (13:28 +0200)
committerGerrit Renker <gerrit@erg.abdn.ac.uk>
Thu, 4 Sep 2008 05:45:24 +0000 (07:45 +0200)
commitfaf61c3319ea336ed47acd6ca86faaaa3a8f4937
tree1882b47335d202597b57ce393049ba9e48fdacb2
parentba1a6c7bc0ff33e405f5156dc8f4145437255f1f
dccp: Silently ignore options with nonsensical lengths

This updates the option-parsing code with regard to RFC 4340, 5.8:
 "[..] options with nonsensical lengths (length byte less than two or more
  than the remaining space in the options portion of the header) MUST be
  ignored, and any option space following an option with nonsensical length
  MUST likewise be ignored."

Hence in the following cases erratic options will be ignored:
 1. The type byte of a multi-byte option is the last byte of the header
    options (i.e. effective option length of 1).
 2. The value of the length byte is less than the minimum 2. This has been
    changed from previously 3: although no multi-byte option with a length
    less than 3 yet exists (cf. table 3 in 5.8), a length of 2 is valid.
    (The switch-statement in dccp_parse has further per-option length checks.)
 3. The option length exceeds the length of the remaining option space.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
net/dccp/options.c