]> git.karo-electronics.de Git - karo-tx-linux.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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Dec 2010 21:27:10 +0000 (13:27 -0800)
commit73c9362424d1273be28adedbdab7f52052450ab7
tree4bd205fec78e71f7ca138195564b018c59d02dd4
parent7c119c7e373988b0fd80244fdcbfc7846522d1c9
x25: Prevent crashing when parsing bad X.25 facilities

commit 5ef41308f94dcbb3b7afc56cdef1c2ba53fa5d2f upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/x25/x25_facilities.c