From: Ani Sinha Date: Mon, 8 Sep 2014 21:49:59 +0000 (-0700) Subject: net:socket: set msg_namelen to 0 if msg_name is passed as NULL in msghdr struct from... X-Git-Tag: v3.2.69~40 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d29f1f53e5299e0bbb3e33ef8d35ed657fa633b6;p=pandora-kernel.git net:socket: set msg_namelen to 0 if msg_name is passed as NULL in msghdr struct from userland. commit 6a2a2b3ae0759843b22c929881cc184b00cc63ff upstream. Linux manpage for recvmsg and sendmsg calls does not explicitly mention setting msg_namelen to 0 when msg_name passed set as NULL. When developers don't set msg_namelen member in msghdr, it might contain garbage value which will fail the validation check and sendmsg and recvmsg calls from kernel will return EINVAL. This will break old binaries and any code for which there is no access to source code. To fix this, we set msg_namelen to 0 when msg_name is passed as NULL from userland. Signed-off-by: Ani Sinha Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed