]> git.kernelconcepts.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)
committerAndi Kleen <ak@linux.intel.com>
Tue, 14 Dec 2010 22:40:17 +0000 (23:40 +0100)
commit47a671800b5c4bca9c5826fc18d9a2ac090a5e3c
tree3a8317643cc1dd49424938ee80f0a41971a1f9e7
parentc4b9d85475fe417aa1d4325e350b6bff78a70c17
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>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
net/x25/x25_facilities.c