mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Luo Meng <luomeng12@huawei.com>, Josef Bacik <jbacik@fb.com>,
	Alexei Starovoitov <ast@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	stable@kernel.vger.org
Subject: Re: [PATCH] fail_function: remove a redundant mutex unlock
Date: Wed, 18 Nov 2020 22:37:55 +0900	[thread overview]
Message-ID: <20201118223755.b8e4f8e8f72a251d670a8a2e@kernel.org> (raw)
In-Reply-To: <CAADnVQ+u0bxvAC+EpdGTsg023UtVAcXyUcV4kKWF+ia6ZxBJ5Q@mail.gmail.com>

Hi,

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

> On Wed, Nov 11, 2020 at 1:31 AM Masami Hiramatsu <mhiramat@kernel.org> wrote:
> >
> > Hi Luo,
> >
> > On Tue, 10 Nov 2020 16:42:45 +0800
> > Luo Meng <luomeng12@huawei.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@kernel.org>
> 
> Did anyone pick this up?
> If not, please resend cc-ing bpf@vger so it can get into patchwork and
> be processed by bpf maintainers.

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

Thank you,

> 
> Thanks!
> 
> > >
> > > Fixes: 4b1a29a7f542 ("error-injection: Support fault injection framework")
> > > Reported-by: Hulk Robot <hulkci@huawei.com>
> > > Signed-off-by: Luo Meng <luomeng12@huawei.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@kernel.org>


-- 
Masami Hiramatsu <mhiramat@kernel.org>

  reply	other threads:[~2020-11-18 13:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10  8:42 Luo Meng
2020-11-11  9:31 ` Masami Hiramatsu
2020-11-18  4:08   ` Alexei Starovoitov
2020-11-18 13:37     ` Masami Hiramatsu [this message]
2020-11-18 13:49 ` Masami Hiramatsu
2020-11-19 19:10   ` patchwork-bot+netdevbpf

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=20201118223755.b8e4f8e8f72a251d670a8a2e@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=jbacik@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luomeng12@huawei.com \
    --cc=stable@kernel.vger.org \
    /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

Powered by JetHome