From: Christian Brauner <christian.brauner@ubuntu.com>
To: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: Christian Brauner <christian@brauner.io>,
linux-kernel@vger.kernel.org, Tycho Andersen <tycho@tycho.ws>,
Kees Cook <keescook@chromium.org>,
David Howells <dhowells@redhat.com>,
Arnd Bergmann <arnd@arndb.de>,
Thomas Gleixner <tglx@linutronix.de>,
Serge Hallyn <serge@hallyn.com>, Aleksa Sarai <cyphar@cyphar.com>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] signal: propagate __user annotations properly
Date: Mon, 7 Dec 2020 14:04:49 +0100 [thread overview]
Message-ID: <20201207130449.nbt23aholqebbvux@wittgenstein> (raw)
In-Reply-To: <20201207123610.18246-1-lukas.bulwahn@gmail.com>
On Mon, Dec 07, 2020 at 01:36:10PM +0100, Lukas Bulwahn wrote:
> Commit 3eb39f47934f ("signal: add pidfd_send_signal() syscall") introduced
> copy_siginfo_from_user_any(), but missed to add the __user annotation to
> the user pointer that is passed as second argument.
>
> Hence, when copy_siginfo_from_user_any() calls copy_siginfo_from_user(),
> sparse warns:
>
> kernel/signal.c:3716:46: warning: incorrect type in argument 2 (different address spaces)
> kernel/signal.c:3716:46: expected struct siginfo const [noderef] [usertype] __user *from
> kernel/signal.c:3716:46: got struct siginfo [usertype] *info
>
> And when pidfd_send_signal() calls copy_siginfo_from_user_any(), sparse
> warns as well:
>
> kernel/signal.c:3776:58: warning: incorrect type in argument 2 (different address spaces)
> kernel/signal.c:3776:58: expected struct siginfo [usertype] *info
> kernel/signal.c:3776:58: got struct siginfo [noderef] [usertype] __user *info
>
> Add the __user annotation to repair this chain of propagating __user
> annotations.
>
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> ---
> applies cleanly on current master (v5.10-rc7) and next-20201204
>
> Christian, please pick this minor non-urgent clean-up patch.
Thanks for the patch. Unfortunately I already picked up Jann's patch who
sent it yesterday or this morning:
https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git/commit/?h=pidfd
Thanks!
Christian
WARNING: multiple messages have this Message-ID (diff)
From: Christian Brauner <christian.brauner@ubuntu.com>
To: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: Christian Brauner <christian@brauner.io>,
linux-kernel@vger.kernel.org, Tycho Andersen <tycho@tycho.ws>,
Kees Cook <keescook@chromium.org>,
David Howells <dhowells@redhat.com>,
Arnd Bergmann <arnd@arndb.de>,
Thomas Gleixner <tglx@linutronix.de>,
Serge Hallyn <serge@hallyn.com>, Aleksa Sarai <cyphar@cyphar.com>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] signal: propagate __user annotations properly
Date: Mon, 07 Dec 2020 13:04:49 +0000 [thread overview]
Message-ID: <20201207130449.nbt23aholqebbvux@wittgenstein> (raw)
In-Reply-To: <20201207123610.18246-1-lukas.bulwahn@gmail.com>
On Mon, Dec 07, 2020 at 01:36:10PM +0100, Lukas Bulwahn wrote:
> Commit 3eb39f47934f ("signal: add pidfd_send_signal() syscall") introduced
> copy_siginfo_from_user_any(), but missed to add the __user annotation to
> the user pointer that is passed as second argument.
>
> Hence, when copy_siginfo_from_user_any() calls copy_siginfo_from_user(),
> sparse warns:
>
> kernel/signal.c:3716:46: warning: incorrect type in argument 2 (different address spaces)
> kernel/signal.c:3716:46: expected struct siginfo const [noderef] [usertype] __user *from
> kernel/signal.c:3716:46: got struct siginfo [usertype] *info
>
> And when pidfd_send_signal() calls copy_siginfo_from_user_any(), sparse
> warns as well:
>
> kernel/signal.c:3776:58: warning: incorrect type in argument 2 (different address spaces)
> kernel/signal.c:3776:58: expected struct siginfo [usertype] *info
> kernel/signal.c:3776:58: got struct siginfo [noderef] [usertype] __user *info
>
> Add the __user annotation to repair this chain of propagating __user
> annotations.
>
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> ---
> applies cleanly on current master (v5.10-rc7) and next-20201204
>
> Christian, please pick this minor non-urgent clean-up patch.
Thanks for the patch. Unfortunately I already picked up Jann's patch who
sent it yesterday or this morning:
https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git/commit/?h=pidfd
Thanks!
Christian
next prev parent reply other threads:[~2020-12-07 13:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-07 12:36 [PATCH] signal: propagate __user annotations properly Lukas Bulwahn
2020-12-07 12:36 ` Lukas Bulwahn
2020-12-07 13:04 ` Christian Brauner [this message]
2020-12-07 13:04 ` Christian Brauner
2020-12-07 13:06 ` Lukas Bulwahn
2020-12-07 13:06 ` Lukas Bulwahn
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=20201207130449.nbt23aholqebbvux@wittgenstein \
--to=christian.brauner@ubuntu.com \
--cc=arnd@arndb.de \
--cc=christian@brauner.io \
--cc=cyphar@cyphar.com \
--cc=dhowells@redhat.com \
--cc=keescook@chromium.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=serge@hallyn.com \
--cc=tglx@linutronix.de \
--cc=tycho@tycho.ws \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.