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: <20240327090155.873f1ed32700dbdb75f8eada@kernel.org>
Date: Wed, 27 Mar 2024 09:01:55 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Mark Rutland <mark.rutland@....com>
Cc: Jarkko Sakkinen <jarkko@...nel.org>, linux-kernel@...r.kernel.org,
 agordeev@...ux.ibm.com, anil.s.keshavamurthy@...el.com,
 aou@...s.berkeley.edu, bp@...en8.de, catalin.marinas@....com,
 dave.hansen@...ux.intel.com, davem@...emloft.net, gor@...ux.ibm.com,
 hca@...ux.ibm.com, jcalvinowens@...il.com,
 linux-arm-kernel@...ts.infradead.org, mhiramat@...nel.org,
 mingo@...hat.com, mpe@...erman.id.au, naveen.n.rao@...ux.ibm.com,
 palmer@...belt.com, paul.walmsley@...ive.com, tglx@...utronix.de,
 will@...nel.org
Subject: Re: [PATCH 4/4] kprobes: Remove core dependency on modules

On Tue, 26 Mar 2024 17:38:18 +0000
Mark Rutland <mark.rutland@....com> wrote:

> On Tue, Mar 26, 2024 at 07:13:51PM +0200, Jarkko Sakkinen wrote:
> > On Tue Mar 26, 2024 at 6:36 PM EET, Mark Rutland wrote:
> 
> > > +#ifdef CONFIG_MODULES
> > >  	/* Check if 'p' is probing a module. */
> > >  	*probed_mod = __module_text_address((unsigned long) p->addr);
> > >  	if (*probed_mod) {
> > > @@ -1605,6 +1606,8 @@ static int check_kprobe_address_safe(struct kprobe *p,
> > >  			ret = -ENOENT;
> > >  		}
> > >  	}
> > > +#endif
> > 
> > This can be scoped a bit more (see v7 of my patch set).
> 
> > > +#ifdef CONFIG_MODULES
> > >  static nokprobe_inline bool trace_kprobe_module_exist(struct trace_kprobe *tk)
> > >  {
> > >  	char *p;
> > > @@ -129,6 +130,9 @@ static nokprobe_inline bool trace_kprobe_module_exist(struct trace_kprobe *tk)
> > >  
> > >  	return ret;
> > >  }
> > > +#else
> > > +#define trace_kprobe_module_exist(tk) false /* aka a module never exists */
> > > +#endif /* CONFIG_MODULES */
> > >  
> > >  static bool trace_kprobe_is_busy(struct dyn_event *ev)
> > >  {
> > > @@ -670,6 +674,7 @@ static int register_trace_kprobe(struct trace_kprobe *tk)
> > >  	return ret;
> > >  }
> > >  
> > > +#ifdef CONFIG_MODULES
> > >  /* Module notifier call back, checking event on the module */
> > >  static int trace_kprobe_module_callback(struct notifier_block *nb,
> > >  				       unsigned long val, void *data)
> > > @@ -699,6 +704,9 @@ static int trace_kprobe_module_callback(struct notifier_block *nb,
> > >  
> > >  	return NOTIFY_DONE;
> > >  }
> > > +#else
> > > +#define trace_kprobe_module_callback (NULL)
> > > +#endif /* CONFIG_MODULES */
> > 
> > The last two CONFIG_MODULES sections could be combined. This was also in
> > v7.
> 
> > Other than lgtm.
> 
> Great! I've folded your v7 changes in, and pushed that out to:
> 
>   https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=kprobes/without-modules
> 
> I'll hold off sending that out to the list until other folk have had a chance
> to comment.

Yeah, the updated one looks good to me too.

Thanks!

> 
> Mark.


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ