From: Willy Tarreau Date: Sat, 6 Dec 2014 14:14:58 +0000 (+0100) Subject: net: sendmsg: fix failed backport of "fix NULL pointer dereference" X-Git-Tag: v2.6.32.65~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25761523045b78fec26626d85ae44539538bbc6c;p=thirdparty%2Fkernel%2Fstable.git net: sendmsg: fix failed backport of "fix NULL pointer dereference" Luis Henriques reported that while backporting commit 40eea80 ("net: sendmsg: fix NULL pointer dereference") and applying the diff by hand, I made a typo resulting in the same test being done twice, and msg_name not being tested. This fixes cf90357 ("net: sendmsg: fix NULL pointer dereference") which was merged into 2.6.32.64. Cc: Andrey Ryabinin Cc: Luis Henriques Signed-off-by: Willy Tarreau --- diff --git a/net/compat.c b/net/compat.c index 71ed8393d884b..a5848acc1738d 100644 --- a/net/compat.c +++ b/net/compat.c @@ -83,7 +83,7 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov, { int tot_len; - if (kern_msg->msg_namelen && kern_msg->msg_namelen) { + if (kern_msg->msg_name && kern_msg->msg_namelen) { if (mode==VERIFY_READ) { int err = move_addr_to_kernel(kern_msg->msg_name, kern_msg->msg_namelen,