]> git.baikalelectronics.ru Git - kernel.git/commit
x25: Prevent crashing when parsing bad X.25 facilities
authorDan Rosenberg <drosenberg@vsecurity.com>
Fri, 12 Nov 2010 20:44:42 +0000 (12:44 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Nov 2010 20:44:42 +0000 (12:44 -0800)
commit276a81fe5f247e83e1ac5174a09e333bc34eab9d
treec21d9c1c7f2792b0889432988d42e9b90f953358
parent26a03f85377100992b3b6f52f295f05336cbc5c2
x25: Prevent crashing when parsing bad X.25 facilities

Now with improved comma support.

On parsing malformed X.25 facilities, decrementing the remaining length
may cause it to underflow.  Since the length is an unsigned integer,
this will result in the loop continuing until the kernel crashes.

This patch adds checks to ensure decrementing the remaining length does
not cause it to wrap around.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/x25/x25_facilities.c