This patch isn't needed since I can't think of any sane reason why the
hdr_delta subtraction would ever cause an error. Similarly, I don't think
David's concerns over the icsk_ext_hdr_len adjustment necessarily apply here
either. Let me try and explain, feel free to point out faults in my logic ...
This function, cipso_v4_sock_delattr(), is only used _to_ remove the CIPSO IP
option from a socket, never to add it. In the code snippet above we see the
following three lines:
hdr_delta = opt->optlen;
opt->optlen = (optlen_new + 3) & ~3;
hdr_delta -= opt->optlen;
The first line sets hdr_delta equal to length of the original IP option list
(length includes the CIPSO option). The second line calculates the new length
of the IP option list (without the CIPSO option), complete with padding. The
third line subtracts the new option length from hdr_delta which is currently
equal to original option length. The only way that hdr_delta could ever be in
danger of going negative would be if the removal of the CIPSO IP option caused
the total IP option length to somehow increase; I just can't think how that
would be possible.
--
paul moore
linux @ hp
--