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]
Date:   Fri, 26 Feb 2021 17:06:29 +0100
From:   Piotr Figiel <figiel@...gle.com>
To:     Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Peter Zijlstra <peterz@...radead.org>,
        paulmck <paulmck@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
        Oleg Nesterov <oleg@...hat.com>,
        "Dmitry V. Levin" <ldv@...linux.org>,
        Florian Weimer <fweimer@...hat.com>,
        Alexey Dobriyan <adobriyan@...il.com>,
        Andrei Vagin <avagin@...il.com>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Peter Oskolkov <posk@...gle.com>,
        Kamil Yurtsever <kyurtsever@...gle.com>,
        Chris Kennelly <ckennelly@...gle.com>,
        Paul Turner <pjt@...gle.com>, emmir <emmir@...gle.com>,
        linux-man <linux-man@...r.kernel.org>,
        linux-api <linux-api@...r.kernel.org>
Subject: Re: [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

Hi,

On Fri, Feb 26, 2021 at 10:32:35AM -0500, Mathieu Desnoyers wrote:
> > +static long ptrace_get_rseq_configuration(struct task_struct *task,
> > +					  unsigned long size, void __user *data)
> > +{
> > +	struct ptrace_rseq_configuration conf = {
> > +		.rseq_abi_pointer = (u64)(uintptr_t)task->rseq,
> > +		.rseq_abi_size = sizeof(*task->rseq),
> > +		.signature = task->rseq_sig,
> > +		.flags = 0,
> > +	};
> > +
> > +	size = min_t(unsigned long, size, sizeof(conf));
> > +	if (copy_to_user(data, &conf, size))
> > +		return -EFAULT;
> > +	return sizeof(conf);
> > +}
> 
> I think what Florian was after would be:
> 
> struct ptrace_rseq_configuration {
> 	__u32 size;  /* size of struct ptrace_rseq_configuration */
> 	__u32 flags;
> 	__u64 rseq_abi_pointer;
> 	__u32 signature;
> 	__u32 pad;
> };
> 
> where:
> 
>     .size = sizeof(struct ptrace_rseq_configuration),
> 
> This way, the configuration structure can be expanded in the future. The
> rseq ABI structure is by definition fixed-size, so there is no point in
> having its size here.

Still rseq syscall accepts the rseq ABI structure size as a paremeter.
I think this way the information returned from ptrace is consistent with
the userspace view of the rseq state and allows expansion in case the
ABI structure would have to be extended (in spite of it's current
definition).

The configuration structure still can be expanded as its size is
reported to userspace as return value from the request (in line with
Dmitry's comments).

Best regards, Piotr.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ