From: Dan Carpenter Date: Wed, 27 Nov 2013 12:40:21 +0000 (+0300) Subject: net: clamp ->msg_namelen instead of returning an error X-Git-Tag: v3.13-rc3~28^2~22 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db31c55a6fb245fdbb752a2ca4aefec89afabb06;p=pandora-kernel.git net: clamp ->msg_namelen instead of returning an error If kmsg->msg_namelen > sizeof(struct sockaddr_storage) then in the original code that would lead to memory corruption in the kernel if you had audit configured. If you didn't have audit configured it was harmless. There are some programs such as beta versions of Ruby which use too large of a buffer and returning an error code breaks them. We should clamp the ->msg_namelen value instead. Fixes: 1661bf364ae9 ("net: heap overflow in __audit_sockaddr()") Reported-by: Eric Wong Signed-off-by: Dan Carpenter Tested-by: Eric Wong Acked-by: Eric Dumazet Signed-off-by: David S. Miller --- Reading git-diff-tree failed