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] [day] [month] [year] [list]
Message-ID: <CAD8CoPBRQ1cU1+DngGd5wyvAxZgk78zmfMUM9WeuUZ2S-UHdYw@mail.gmail.com>
Date:   Mon, 3 Jul 2023 17:26:45 +0800
From:   Ze Gao <zegao2021@...il.com>
To:     Masami Hiramatsu <mhiramat@...nel.org>
Cc:     Steven Rostedt <rostedt@...dmis.org>, linux-kernel@...r.kernel.org,
        linux-trace-kernel@...r.kernel.org, Ze Gao <zegao@...cent.com>,
        Yafang <laoar.shao@...il.com>
Subject: Re: [PATCH] fprobe: add unlock to match a succeeded ftrace_test_recursion_trylock

Good suggestion! Will amend and push v2 ASAP.

Thanks,
Ze

On Mon, Jul 3, 2023 at 4:19 PM Masami Hiramatsu <mhiramat@...nel.org> wrote:
>
> On Mon,  3 Jul 2023 15:16:40 +0800
> Ze Gao <zegao2021@...il.com> wrote:
>
> Good catch! but please add description here, something like;
>
> ----
> Unlock ftrace recursion lock when fprobe_kprobe_handler() is failed
> because another kprobe is running.
> ----
>
> The code itself is OK to me.
>
>
> > Fixes: 3cc4e2c5fbae ("fprobe: make fprobe_kprobe_handler recursion free")
> > Reported-by: Yafang <laoar.shao@...il.com>
> > Closes: https://lore.kernel.org/linux-trace-kernel/CALOAHbC6UpfFOOibdDiC7xFc5YFUgZnk3MZ=3Ny6we=AcrNbew@mail.gmail.com/
> > Signed-off-by: Ze Gao <zegao@...cent.com>
> > ---
> >  kernel/trace/fprobe.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
> > index 18d36842faf5..93b3e361bb97 100644
> > --- a/kernel/trace/fprobe.c
> > +++ b/kernel/trace/fprobe.c
> > @@ -102,12 +102,14 @@ static void fprobe_kprobe_handler(unsigned long ip, unsigned long parent_ip,
> >
> >       if (unlikely(kprobe_running())) {
> >               fp->nmissed++;
> > -             return;
> > +             goto recursion_unlock;
> >       }
> >
> >       kprobe_busy_begin();
> >       __fprobe_handler(ip, parent_ip, ops, fregs);
> >       kprobe_busy_end();
> > +
> > +recursion_unlock:
> >       ftrace_test_recursion_unlock(bit);
> >  }
> >
> > --
> > 2.40.1
> >
>
>
> --
> Masami Hiramatsu (Google) <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ