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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 11 Sep 2018 15:36:32 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     Ingo Molnar <mingo@...hat.com>,
        "Naveen N . Rao" <naveen.n.rao@...ux.vnet.ibm.com>,
        Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
        "David S . Miller" <davem@...emloft.net>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH -tip 5/5] kprobes: Don't call BUG_ON if there is a
 kprobe in use on free list

On Mon, 10 Sep 2018 14:23:56 +0200
Ingo Molnar <mingo@...nel.org> wrote:

> 
> * Masami Hiramatsu <mhiramat@...nel.org> wrote:
> 
> > Instead of calling BUG_ON, if we find a kprobe in use on free kprobe
> > list, just remove it from the list and keep it on kprobe hash list
> > as same as other in-use kprobes.
> > 
> > Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> > ---
> >  kernel/kprobes.c |    8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> > index 63c342e5e6c3..e3420364b415 100644
> > --- a/kernel/kprobes.c
> > +++ b/kernel/kprobes.c
> > @@ -546,8 +546,14 @@ static void do_free_cleaned_kprobes(void)
> >  	struct optimized_kprobe *op, *tmp;
> >  
> >  	list_for_each_entry_safe(op, tmp, &freeing_list, list) {
> > -		BUG_ON(!kprobe_unused(&op->kp));
> >  		list_del_init(&op->list);
> > +		if (!kprobe_unused(&op->kp)) {
> > +			/*
> > +			 * This must not happen, but if there is a kprobe
> > +			 * still in use, keep it on kprobes hash list.
> > +			 */
> > +			continue;
> 
> If this is an 'impossible' code path then I think it would make sense to add a WARN_ON_ONCE() 
> here.

I agree. This means something goes wrong. That is enough reason to warn user.

Thank you!

> 
> Thanks,
> 
> 	Ingo


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ