mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Christian Zigotzky <chzigotzky@xenosoft.de>,
	"Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>
Cc: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Aleksa Sarai <cyphar@cyphar.com>,
	Chris Palmer <palmer@google.com>,
	Christian Brauner <christian.brauner@ubuntu.com>,
	Christoph Hellwig <hch@lst.de>, Matt Denton <mpdenton@google.com>,
	Robert Sesek <rsesek@google.com>,
	Sargun Dhillon <sargun@sargun.me>, Shuah Khan <shuah@kernel.org>,
	Tycho Andersen <tycho@tycho.ws>, Will Deacon <will@kernel.org>,
	Will Drewry <wad@chromium.org>, Yonghong Song <yhs@fb.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] net/scm: Fix typo in SCM_RIGHTS compat refactoring
Date: Fri, 7 Aug 2020 11:20:05 -0700	[thread overview]
Message-ID: <202008071117.56ADE58@keescook> (raw)

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 <chzigotzky@xenosoft.de>
Link: https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-August/216156.html
Reported-by: "Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>
Link: https://lore.kernel.org/lkml/1596812929.lz7fuo8r2w.none@localhost/
Suggested-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fixes: c0029de50982 ("net/scm: Regularize compat handling of scm_detach_fds()")
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 net/compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/compat.c b/net/compat.c
index 703acb51c698..95ce707a30a3 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -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++) {
-- 
2.25.1


-- 
Kees Cook

             reply	other threads:[~2020-08-07 18:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 18:20 Kees Cook [this message]
2020-08-07 18:29 ` Thadeu Lima de Souza Cascardo
2020-08-07 19:46 ` Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202008071117.56ADE58@keescook \
    --to=keescook@chromium.org \
    --cc=alex_y_xu@yahoo.ca \
    --cc=cascardo@canonical.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=chzigotzky@xenosoft.de \
    --cc=cyphar@cyphar.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpdenton@google.com \
    --cc=palmer@google.com \
    --cc=rsesek@google.com \
    --cc=sargun@sargun.me \
    --cc=shuah@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tycho@tycho.ws \
    --cc=wad@chromium.org \
    --cc=will@kernel.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®