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: <20250114153237.8a64048fe378e96f08cd1a8c@kernel.org>
Date: Tue, 14 Jan 2025 15:32:37 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Yicong Yang <yangyicong@...wei.com>
Cc: Qinxin Xia <xiaqinxin@...wei.com>, <catalin.marinas@....com>,
 <will@...nel.org>, <naveen.n.rao@...ux.ibm.com>,
 <anil.s.keshavamurthy@...el.com>, <davem@...emloft.net>,
 <linuxarm@...wei.com>, <yangyicong@...ilicon.com>,
 <linux-kernel@...r.kernel.org>, <fanghao11@...wei.com>,
 <prime.zeng@...ilicon.com>, <xuwei5@...wei.com>,
 <jonathan.cameron@...wei.com>
Subject: Re: [PATCH v6] arm64: kprobe: Enable OPTPROBE for arm64

On Tue, 14 Jan 2025 11:56:38 +0800
Yicong Yang <yangyicong@...wei.com> wrote:

> > diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> > index 62b5b08d809d..45287e185ce3 100644
> > --- a/kernel/kprobes.c
> > +++ b/kernel/kprobes.c
> > @@ -425,6 +425,24 @@ void opt_pre_handler(struct kprobe *p, struct pt_regs *regs)
> >  }
> >  NOKPROBE_SYMBOL(opt_pre_handler);
> >  
> > +void optprobe_optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs)
> > +{
> > +	if (kprobe_disabled(&op->kp))
> > +		return;
> > +
> > +	guard(preempt)();
> > +
> > +	if (kprobe_running()) {
> > +		kprobes_inc_nmissed_count(&op->kp);
> > +	} else {
> > +		__this_cpu_write(current_kprobe, &op->kp);
> > +		get_kprobe_ctlblk()->kprobe_status = KPROBE_HIT_ACTIVE;
> > +		opt_pre_handler(&op->kp, regs);
> > +		__this_cpu_write(current_kprobe, NULL);
> > +	}
> > +}
> > +NOKPROBE_SYMBOL(optprobe_optimized_callback)
> > +
> 
> should we make this function arch specific rather than in the framework? it's only
> used in the arm64 code in this patch currently.

Good catch. This should be in arch/arm64 at least in this patch.
If we consolidate the optprobe callback, it should be done in
a different patch. 

> 
> Thanks.
> 
> >  /* Free optimized instructions and optimized_kprobe */
> >  static void free_aggr_kprobe(struct kprobe *p)
> >  {
> > 
> 


-- 
Masami Hiramatsu (Google) <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ