lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201118223755.b8e4f8e8f72a251d670a8a2e@kernel.org>
Date:   Wed, 18 Nov 2020 22:37:55 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc:     Luo Meng <luomeng12@...wei.com>, Josef Bacik <jbacik@...com>,
        Alexei Starovoitov <ast@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>, stable@...nel.vger.org
Subject: Re: [PATCH] fail_function: remove a redundant mutex unlock

Hi,

On Tue, 17 Nov 2020 20:08:08 -0800
Alexei Starovoitov <alexei.starovoitov@...il.com> wrote:

> On Wed, Nov 11, 2020 at 1:31 AM Masami Hiramatsu <mhiramat@...nel.org> wrote:
> >
> > Hi Luo,
> >
> > On Tue, 10 Nov 2020 16:42:45 +0800
> > Luo Meng <luomeng12@...wei.com> wrote:
> >
> > > Fix a mutex_unlock() issue where before copy_from_user() is
> > > not called mutex_locked.
> >
> > Oops, thank you for the fix.
> >
> > Acked-by: Masami Hiramatsu <mhiramat@...nel.org>
> 
> Did anyone pick this up?
> If not, please resend cc-ing bpf@...r so it can get into patchwork and
> be processed by bpf maintainers.

OK, I'll resend this to the bpf@...r. 

Thank you,

> 
> Thanks!
> 
> > >
> > > Fixes: 4b1a29a7f542 ("error-injection: Support fault injection framework")
> > > Reported-by: Hulk Robot <hulkci@...wei.com>
> > > Signed-off-by: Luo Meng <luomeng12@...wei.com>
> > > ---
> > >  kernel/fail_function.c | 5 +++--
> > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/kernel/fail_function.c b/kernel/fail_function.c
> > > index 63b349168da7..b0b1ad93fa95 100644
> > > --- a/kernel/fail_function.c
> > > +++ b/kernel/fail_function.c
> > > @@ -253,7 +253,7 @@ static ssize_t fei_write(struct file *file, const char __user *buffer,
> > >
> > >       if (copy_from_user(buf, buffer, count)) {
> > >               ret = -EFAULT;
> > > -             goto out;
> > > +             goto out_free;
> > >       }
> > >       buf[count] = '\0';
> > >       sym = strstrip(buf);
> > > @@ -307,8 +307,9 @@ static ssize_t fei_write(struct file *file, const char __user *buffer,
> > >               ret = count;
> > >       }
> > >  out:
> > > -     kfree(buf);
> > >       mutex_unlock(&fei_lock);
> > > +out_free:
> > > +     kfree(buf);
> > >       return ret;
> > >  }
> > >
> > > --
> > > 2.25.4
> > >
> >
> >
> > --
> > Masami Hiramatsu <mhiramat@...nel.org>


-- 
Masami Hiramatsu <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ