]> git.karo-electronics.de Git - karo-tx-linux.git/commit
l2tp: Fix potential memory corruption in pppol2tp_recvmsg()
authorJames Chapman <jchapman@katalix.com>
Thu, 24 Jul 2008 06:52:47 +0000 (23:52 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 28 Jul 2008 17:58:17 +0000 (10:58 -0700)
commit0c9b216d1ce5c322631c21bd6656ec35047ffc87
tree610befc9cdd058c96242d1472cb79da90f8ea7c4
parentc8330bc571d037b43e116ddfc5ba4a93f334df52
l2tp: Fix potential memory corruption in pppol2tp_recvmsg()

[ Upstream commit 6b6707a50c7598a83820077393f8823ab791abf8 ]

This patch fixes a potential memory corruption in
pppol2tp_recvmsg(). If skb->len is bigger than the caller's buffer
length, memcpy_toiovec() will go into unintialized data on the kernel
heap, interpret it as an iovec and start modifying memory.

The fix is to change the memcpy_toiovec() call to
skb_copy_datagram_iovec() so that paged packets (rare for PPPOL2TP)
are handled properly. Also check that the caller's buffer is big
enough for the data and set the MSG_TRUNC flag if it is not so.

Reported-by: Ilja <ilja@netric.org>
Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/pppol2tp.c