]> git.hungrycats.org Git - linux/commitdiff
net: sendmsg: fix failed backport of "fix NULL pointer dereference"
authorWilly Tarreau <w@1wt.eu>
Sat, 6 Dec 2014 14:14:58 +0000 (15:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 13 Dec 2014 14:16:06 +0000 (15:16 +0100)
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 <a.ryabinin@samsung.com>
Cc: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/compat.c

index 71ed8393d884b37fb4fb9a81d790f6689ac3819e..a5848acc1738d54bf070de55a7f896ce315e4da5 100644 (file)
@@ -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,