]> Git Repo - J-linux.git/commitdiff
net/scm: Fix typo in SCM_RIGHTS compat refactoring
authorKees Cook <[email protected]>
Fri, 7 Aug 2020 17:53:54 +0000 (10:53 -0700)
committerKees Cook <[email protected]>
Fri, 7 Aug 2020 19:43:25 +0000 (12:43 -0700)
When refactoring the SCM_RIGHTS code, I accidentally mis-merged my
native/compat diffs, which entirely broke using SCM_RIGHTS in compat
mode. Use the correct helper.

Reported-by: Christian Zigotzky <[email protected]>
Link: https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-August/216156.html
Reported-by: "Alex Xu (Hello71)" <[email protected]>
Link: https://lore.kernel.org/lkml/1596812929.lz7fuo8r2w.none@localhost/
Suggested-by: Thadeu Lima de Souza Cascardo <[email protected]>
Fixes: c0029de50982 ("net/scm: Regularize compat handling of scm_detach_fds()")
Tested-by: Alex Xu (Hello71) <[email protected]>
Acked-by: Thadeu Lima de Souza Cascardo <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
net/compat.c

index 703acb51c698aa9c3cb65b5b65e107c240d60c5f..95ce707a30a31d3c4c434ce77e20c2bddbe94cbf 100644 (file)
@@ -294,7 +294,7 @@ void scm_detach_fds_compat(struct msghdr *msg, struct scm_cookie *scm)
                (struct compat_cmsghdr __user *)msg->msg_control;
        unsigned int o_flags = (msg->msg_flags & MSG_CMSG_CLOEXEC) ? O_CLOEXEC : 0;
        int fdmax = min_t(int, scm_max_fds_compat(msg), scm->fp->count);
-       int __user *cmsg_data = CMSG_USER_DATA(cm);
+       int __user *cmsg_data = CMSG_COMPAT_DATA(cm);
        int err = 0, i;
 
        for (i = 0; i < fdmax; i++) {
This page took 0.057386 seconds and 4 git commands to generate.