[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zc0Ca5te+QFBZ1U6@tycho.pizza>
Date: Wed, 14 Feb 2024 11:11:55 -0700
From: Tycho Andersen <tycho@...ho.pizza>
To: Oleg Nesterov <oleg@...hat.com>
Cc: coverity-bot <keescook@...omium.org>,
Christian Brauner <brauner@...nel.org>,
Nicholas Piggin <npiggin@...il.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Peng Zhang <zhangpeng.00@...edance.com>,
Ard Biesheuvel <ardb@...nel.org>,
Luis Chamberlain <mcgrof@...nel.org>,
Heiko Carstens <hca@...ux.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Suren Baghdasaryan <surenb@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Mateusz Guzik <mjguzik@...il.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Tycho Andersen <tandersen@...flix.com>,
Mike Christie <michael.christie@...cle.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
linux-kernel@...r.kernel.org,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>,
linux-next@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: Coverity: __do_sys_pidfd_send_signal(): UNINIT
On Wed, Feb 14, 2024 at 06:55:55PM +0100, Oleg Nesterov wrote:
> Hi Tycho,
>
> let me repeat just in case, I am fine either way, whatever you and
> Christian prefer. In particular, I agree in advance if you decide
> to not change the current code, it is correct even if it can fool
> the tools.
>
> That said,
>
> On 02/14, Tycho Andersen wrote:
> >
> > On Wed, Feb 14, 2024 at 10:06:41AM +0100, Oleg Nesterov wrote:
> > >
> > > - /* Ensure that only a single signal scope determining flag is set. */
> > > - if (hweight32(flags & PIDFD_SEND_SIGNAL_FLAGS) > 1)
> > > + switch (flags) {
> > > + case 0:
> > > + /* but see the PIDFD_THREAD check below */
> >
> > Why not put that bit inline?
>
> Not sure I understand what does "inline" mean... but let me reply
> anyway.
>
> We want to check the "flags" argument at the start, we do not want to
> delay the "case 0:" check until we have f.file (so that we can check
> f.file->f_flags).
Fair point. I was thinking delaying it would make it simpler, but then
you have to free the file and it's less fast in the EINVAL case. I
also don't have a strong opinion here.
Tycho
Powered by blists - more mailing lists