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] [day] [month] [year] [list]
Message-ID: <Z7nbYcdRKXspX8o2@gmail.com>
Date: Sat, 22 Feb 2025 15:12:49 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc: Michael Jeanson <mjeanson@...icios.com>,
	Peter Zijlstra <peterz@...radead.org>,
	"Paul E. McKenney" <paulmck@...nel.org>,
	Boqun Feng <boqun.feng@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rseq: update kernel fields in lockstep with
 CONFIG_DEBUG_RSEQ


* Mathieu Desnoyers <mathieu.desnoyers@...icios.com> wrote:

> > > -	unsafe_put_user(cpu_id, &rseq->cpu_id_start, efault_end);
> > > -	unsafe_put_user(cpu_id, &rseq->cpu_id, efault_end);
> > > -	unsafe_put_user(node_id, &rseq->node_id, efault_end);
> > > -	unsafe_put_user(mm_cid, &rseq->mm_cid, efault_end);
> > > +
> > > +	unsafe_rseq_set_field(t, cpu_id_start, cpu_id, efault_end);
> > > +	unsafe_rseq_set_field(t, cpu_id, cpu_id, efault_end);
> > > +	unsafe_rseq_set_field(t, node_id, node_id, efault_end);
> > > +	unsafe_rseq_set_field(t, mm_cid, mm_cid, efault_end);
> > 
> > Could we please name the new wrapper rseq_unsafe_put_user(), to make it
> > clear it's a wrapper around unsafe_put_user()?
> 
> If we do this then need to make sure the order of arguments becomes
> similar to unsafe_put_user for consistency.

Absolutely.

> I always find it odd that the "source" argument comes first and
> the "destination" argument comes second in all put_user() APIs,
> compared to memcpy, WRITE_ONCE() and all assignments (e.g.
> operator "=" LHS vs RHS). Choosing a different argument order
> therefore made sense with a naming different from "*put_user",
> but not so much if we use a derived naming.

Yeah, put_user()'s oddity is a random historic idiosyncrasy that we 
want to preserve in derived naming to reduce the potential for 
confusion.

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ