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: <D0AMARUFBCNN.21GJ0PXUDK0F6@kernel.org>
Date: Wed, 03 Apr 2024 19:10:58 +0300
From: "Jarkko Sakkinen" <jarkko@...nel.org>
To: "Mark Rutland" <mark.rutland@....com>, <linux-kernel@...r.kernel.org>
Cc: <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 Wed Apr 3, 2024 at 2:20 PM EEST, Mark Rutland wrote:
> On Tue, Mar 26, 2024 at 04:36:24PM +0000, Mark Rutland wrote:
> > From: Jarkko Sakkinen <jarkko@...nel.org>
> > 
> > Tracing with kprobes while running a monolithic kernel is currently
> > impossible because KPROBES depends on MODULES. While this dependency is
> > necessary when KPROBES_USE_MODULE_ALLOC=y, all the other module-specific
> > code only exist to handle the case when MODULES=y, and can be hidden
> > behind ifdeffery.
> > 
> > Add the necessary ifdeffery, and remove the dependency on MODULES=N when
> > KPROBES_USE_MODULE_ALLOC=n.
> > 
> > Currently this allows kprobes to be used when CONFIG_MODULES=n on arm64
> > and riscv, and other architectures can enable support by implementing
> > their own kprobes_alloc_insn_page() and kprobes_free_insn_page() which
> > do not depend on MODULES.
> > 
> > Signed-off-by: Jarkko Sakkinen <jarkko@...nel.org>
> > Link: https://lore.kernel.org/all/20240326012102.27438-1-jarkko@kernel.org/
> > [Mark: Remove execmem changes, depend on !KPROBES_USE_MODULE_ALLOC]
> > Signed-off-by: Mark Rutland <mark.rutland@....com>
> > Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>
> > Cc: David S. Miller <davem@...emloft.net>
> > Cc: Jarkko Sakkinen <jarkko@...nel.org>
> > Cc: Masami Hiramatsu <mhiramat@...nel.org>
> > Cc: Naveen N. Rao <naveen.n.rao@...ux.ibm.com>
> > ---
> >  arch/Kconfig                |  2 +-
> >  kernel/kprobes.c            | 12 +++++++++++-
> >  kernel/trace/trace_kprobe.c | 15 +++++++++++++--
> >  3 files changed, 25 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/Kconfig b/arch/Kconfig
> > index 85bb59f7b8c07..cf43de9ffb5b9 100644
> > --- a/arch/Kconfig
> > +++ b/arch/Kconfig
> > @@ -52,7 +52,7 @@ config GENERIC_ENTRY
> >  
> >  config KPROBES
> >  	bool "Kprobes"
> > -	depends on MODULES
> > +	depends on MODULES || !KPROBES_USE_MODULE_ALLOC
>
> Whoops; that should be:
>
> 	depends on MODULES || HAVE_KPROBES_ALLOC
>
> ... with similar fixups in the commit message to describe HAVE_KPROBES_ALLOC
> rather than KPROBES_USE_MODULE_ALLOC (which does not exist in any version of
> the series that got sent to the list).
>
> I'll send a v2 with that fixed (and the other changes from Jarkko's v7 base
> patch) once I've locally tested that for architectures with and without
> HAVE_KPROBES_ALLOC.

OK, please put to me to the CC list as I'm not ATM subscribed
to the tracing list.

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ