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: <20200827205028.964ca2ac4cd79d4e6cee7f9f@kernel.org>
Date:   Thu, 27 Aug 2020 20:50:28 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     peterz@...radead.org
Cc:     linux-kernel@...r.kernel.org, Eddy Wu <Eddy_Wu@...ndmicro.com>,
        x86@...nel.org, "David S . Miller" <davem@...emloft.net>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ingo Molnar <mingo@...hat.com>,
        "Naveen N . Rao" <naveen.n.rao@...ux.ibm.com>,
        Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
        linux-arch@...r.kernel.org
Subject: Re: [PATCH v2 15/15] kprobes: Free kretprobe_instance with rcu
 callback

On Thu, 27 Aug 2020 13:48:07 +0200
peterz@...radead.org wrote:

> On Thu, Aug 27, 2020 at 08:37:49PM +0900, Masami Hiramatsu wrote:
> > Free kretprobe_instance with rcu callback instead of directly
> > freeing the object in the kretprobe handler context.
> > 
> > This will make kretprobe run safer in NMI context.
> > 
> > Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> > ---
> >  include/linux/kprobes.h |    3 ++-
> >  kernel/kprobes.c        |   25 ++++++-------------------
> >  2 files changed, 8 insertions(+), 20 deletions(-)
> > 
> > diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
> > index 46a7afcf5ec0..97557f820d9b 100644
> > --- a/include/linux/kprobes.h
> > +++ b/include/linux/kprobes.h
> > @@ -160,6 +160,7 @@ struct kretprobe_instance {
> >  	struct kretprobe *rp;
> >  	kprobe_opcode_t *ret_addr;
> >  	struct task_struct *task;
> > +	struct rcu_head rcu;
> >  	void *fp;
> >  	char data[];
> >  };
> 
> You can stick the rcu_head in a union with hlist.

Indeed. OK, I'll update it.

Thank you!


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ