x25: add a sanity check parsing X.25 facilities
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 3 Sep 2013 09:03:40 +0000 (12:03 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Sep 2013 04:27:27 +0000 (00:27 -0400)
commit80aa4e10963cc7d9b5dd5b2568ce28d74af20bf9
tree5c864aa3c95f575287ea2f37da2e0589f85a1c1c
parentcab6ce9ebe89303bbf5eff442776188070a22771
x25: add a sanity check parsing X.25 facilities

This was found with a manual audit and I don't have a reproducer.  We
limit ->calling_len and ->called_len when we get them from
copy_from_user() in x25_ioctl() so when they come from skb->data then
we should cap them there as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/x25/x25_facilities.c