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: <0f216140-f3b4-418e-b93c-e6b05ee4d8de@efficios.com>
Date: Mon, 25 Aug 2025 14:32:49 -0400
From: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To: Thomas Gleixner <tglx@...utronix.de>, LKML <linux-kernel@...r.kernel.org>
Cc: Jens Axboe <axboe@...nel.dk>, Peter Zijlstra <peterz@...radead.org>,
 "Paul E. McKenney" <paulmck@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
 Paolo Bonzini <pbonzini@...hat.com>, Sean Christopherson
 <seanjc@...gle.com>, Wei Liu <wei.liu@...nel.org>,
 Dexuan Cui <decui@...rosoft.com>, x86@...nel.org,
 Arnd Bergmann <arnd@...db.de>, Heiko Carstens <hca@...ux.ibm.com>,
 Christian Borntraeger <borntraeger@...ux.ibm.com>,
 Sven Schnelle <svens@...ux.ibm.com>, Huacai Chen <chenhuacai@...nel.org>,
 Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt <palmer@...belt.com>
Subject: Re: [patch V2 16/37] rseq: Provide tracepoint wrappers for inline
 code

On 2025-08-23 12:39, Thomas Gleixner wrote:
> Provide tracepoint wrappers for the upcoming RSEQ exit to user space inline
> fast path, so that the header can be safely included by code which defines
> actual trace points.
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
>   include/linux/rseq_entry.h |   30 ++++++++++++++++++++++++++++++
>   kernel/rseq.c              |   17 +++++++++++++++++
>   2 files changed, 47 insertions(+)
> 
> --- a/include/linux/rseq_entry.h
> +++ b/include/linux/rseq_entry.h
> @@ -5,6 +5,36 @@
>   #ifdef CONFIG_RSEQ
>   #include <linux/rseq.h>
>   
> +#include <linux/tracepoint-defs.h>
> +
> +#ifdef CONFIG_TRACEPOINTS
> +DECLARE_TRACEPOINT(rseq_update);
> +DECLARE_TRACEPOINT(rseq_ip_fixup);
> +void __rseq_trace_update(struct task_struct *t);
> +void __rseq_trace_ip_fixup(unsigned long ip, unsigned long start_ip,
> +			   unsigned long offset, unsigned long abort_ip);
> +
> +static inline void rseq_trace_update(struct task_struct *t, struct rseq_ids *ids)
> +{
> +	if (tracepoint_enabled(rseq_update)) {
> +		if (ids)

Does it work if you do:

if (tracepoint_enabled(rseq_update) && ids) {

or is there some macro magic preventing this ?

Otherwise:

Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>

> +			__rseq_trace_update(t);
> +	}
> +}
> +
> +static inline void rseq_trace_ip_fixup(unsigned long ip, unsigned long start_ip,
> +				       unsigned long offset, unsigned long abort_ip)
> +{
> +	if (tracepoint_enabled(rseq_ip_fixup))
> +		__rseq_trace_ip_fixup(ip, start_ip, offset, abort_ip);
> +}
> +
> +#else /* CONFIG_TRACEPOINT */
> +static inline void rseq_trace_update(struct task_struct *t) { }
> +static inline void rseq_trace_ip_fixup(unsigned long ip, unsigned long start_ip,
> +				       unsigned long offset, unsigned long abort_ip) { }
> +#endif /* !CONFIG_TRACEPOINT */
> +
>   static __always_inline void rseq_note_user_irq_entry(void)
>   {
>   	if (IS_ENABLED(CONFIG_GENERIC_IRQ_ENTRY))
> --- a/kernel/rseq.c
> +++ b/kernel/rseq.c
> @@ -91,6 +91,23 @@
>   				  RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL | \
>   				  RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE)
>   
> +#ifdef CONFIG_TRACEPOINTS
> +/*
> + * Out of line, so the actual update functions can be in a header to be
> + * inlined into the exit to user code.
> + */
> +void __rseq_trace_update(struct task_struct *t)
> +{
> +	trace_rseq_update(t);
> +}
> +
> +void __rseq_trace_ip_fixup(unsigned long ip, unsigned long start_ip,
> +			   unsigned long offset, unsigned long abort_ip)
> +{
> +	trace_rseq_ip_fixup(ip, start_ip, offset, abort_ip);
> +}
> +#endif /* CONFIG_TRACEPOINTS */
> +
>   #ifdef CONFIG_DEBUG_RSEQ
>   static struct rseq *rseq_kernel_fields(struct task_struct *t)
>   {
> 


-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ