Neal Cardwell 5e1f54201c inet_diag: validate port comparison byte code to prevent unsafe reads
Add logic to verify that a port comparison byte code operation
actually has the second inet_diag_bc_op from which we read the port
for such operations.

Previously the code blindly referenced op[1] without first checking
whether a second inet_diag_bc_op struct could fit there. So a
malicious user could make the kernel read 4 bytes beyond the end of
the bytecode array by claiming to have a whole port comparison byte
code (2 inet_diag_bc_op structs) when in fact the bytecode was not
long enough to hold both.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-12-09 19:00:48 -05:00
..
2012-08-31 16:14:33 -04:00
2012-07-19 10:48:00 -07:00
2012-06-15 15:30:15 -07:00
2012-05-17 18:45:20 -04:00
2012-10-09 13:57:23 -04:00
2012-11-28 11:13:40 -05:00
2012-09-17 13:00:13 -04:00
2012-09-26 21:10:25 -04:00