]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.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:33:30 +0000 (13:33 -0800)
commit9398085155dfc475ba9a5e1c4da10ad3dd009380
tree2291a703739fc2bd034399a5d369039db6921382
parentba4395a3649c3cd730b43351061892f96fadd16d
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