All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Bulwahn <lukas.bulwahn@gmail.com>
To: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Christian Brauner <christian@brauner.io>,
	Linux Kernel Mailing List <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:06:17 +0100	[thread overview]
Message-ID: <CAKXUXMyC163hWT-bf=Nbw3KQspYWo_oTCNBYH-Di5ky+NU190A@mail.gmail.com> (raw)
In-Reply-To: <20201207130449.nbt23aholqebbvux@wittgenstein>

On Mon, Dec 7, 2020 at 2:04 PM Christian Brauner
<christian.brauner@ubuntu.com> wrote:
>
> 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 for letting me know and good to know that Jann is tracking
those sparse warnings as well :)

Lukas

WARNING: multiple messages have this Message-ID (diff)
From: Lukas Bulwahn <lukas.bulwahn@gmail.com>
To: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Christian Brauner <christian@brauner.io>,
	Linux Kernel Mailing List <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:06:17 +0000	[thread overview]
Message-ID: <CAKXUXMyC163hWT-bf=Nbw3KQspYWo_oTCNBYH-Di5ky+NU190A@mail.gmail.com> (raw)
In-Reply-To: <20201207130449.nbt23aholqebbvux@wittgenstein>

On Mon, Dec 7, 2020 at 2:04 PM Christian Brauner
<christian.brauner@ubuntu.com> wrote:
>
> 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 for letting me know and good to know that Jann is tracking
those sparse warnings as well :)

Lukas

  reply	other threads:[~2020-12-07 13:07 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
2020-12-07 13:04   ` Christian Brauner
2020-12-07 13:06   ` Lukas Bulwahn [this message]
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='CAKXUXMyC163hWT-bf=Nbw3KQspYWo_oTCNBYH-Di5ky+NU190A@mail.gmail.com' \
    --to=lukas.bulwahn@gmail.com \
    --cc=arnd@arndb.de \
    --cc=christian.brauner@ubuntu.com \
    --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=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.