Vegard Nossum 619e803d3c netlink: fix (theoretical) overrun in message iteration
See commit 1045b03e07d85f3545118510a587035536030c1c ("netlink: fix
overrun in attribute iteration") for a detailed explanation of why
this patch is necessary.

In short, nlmsg_next() can make "remaining" go negative, and the
remaining >= sizeof(...) comparison will promote "remaining" to an
unsigned type, which means that the expression will evaluate to
true for negative numbers, even though it was not intended.

I put "theoretical" in the title because I have no evidence that
this can actually happen, but I suspect that a crafted netlink
packet can trigger some badness.

Note that the last test, which seemingly has the exact same
problem (also true for nla_ok()), is perfectly OK, since we
already know that remaining is positive.

Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-25 17:21:17 -08:00
..
2008-10-22 18:54:47 -05:00
2008-09-12 16:30:20 -07:00
2006-12-02 21:22:55 -08:00
2007-10-10 16:53:56 -07:00
2008-12-19 15:22:54 -05:00
2008-11-25 17:35:18 -08:00
2008-11-25 17:35:18 -08:00
2008-07-05 21:26:57 -07:00
2008-06-11 21:00:38 -07:00
2008-06-11 21:00:38 -07:00
2008-11-25 18:00:48 -08:00
2008-06-11 21:00:38 -07:00
2008-02-29 11:46:17 -08:00
2008-03-28 16:28:36 -07:00
2008-11-12 00:54:54 -08:00
2008-11-16 23:01:49 -08:00
2008-12-15 23:41:09 -08:00
2008-06-11 21:00:38 -07:00
2008-07-05 21:25:39 -07:00
2008-12-15 23:43:36 -08:00
2008-11-16 19:39:21 -08:00
2008-11-25 18:00:48 -08:00