Re: [PATCH] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-03-03 Thread Mathieu Desnoyers
- On Feb 26, 2021, at 9:11 AM, Piotr Figiel fig...@google.com wrote: > Hi, > > On Mon, Feb 22, 2021 at 09:53:17AM -0500, Mathieu Desnoyers wrote: > >> I notice that other structures defined in this UAPI header are not >> packed as well. Should we add an attribute packed on new structures ?

Re: [PATCH] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-26 Thread Piotr Figiel
Hi, On Mon, Feb 22, 2021 at 09:53:17AM -0500, Mathieu Desnoyers wrote: > I notice that other structures defined in this UAPI header are not > packed as well. Should we add an attribute packed on new structures ? > It seems like it is generally a safer course of action, even though > each field

Re: [PATCH] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-23 Thread Florian Weimer
* Piotr Figiel: > diff --git a/include/uapi/linux/ptrace.h b/include/uapi/linux/ptrace.h > index 83ee45fa634b..d54cf6b6ce7c 100644 > --- a/include/uapi/linux/ptrace.h > +++ b/include/uapi/linux/ptrace.h > @@ -102,6 +102,14 @@ struct ptrace_syscall_info { > }; > }; > > +#define

Re: [PATCH] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-22 Thread Dmitry V. Levin
On Mon, Feb 22, 2021 at 09:53:10AM -0500, Mathieu Desnoyers wrote: > - On Feb 22, 2021, at 6:57 AM, Dmitry V. Levin l...@altlinux.org wrote: > > On Mon, Feb 22, 2021 at 11:04:43AM +0100, Piotr Figiel wrote: [...] > >> +#ifdef CONFIG_RSEQ > >> +static long ptrace_get_rseq_configuration(struct

Re: [PATCH] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-22 Thread Mathieu Desnoyers
- On Feb 22, 2021, at 5:04 AM, Piotr Figiel fig...@google.com wrote: > For userspace checkpoint and restore (C/R) a way of getting process state > containing RSEQ configuration is needed. > > There are two ways this information is going to be used: > - to re-enable RSEQ for threads which

Re: [PATCH] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-22 Thread Mathieu Desnoyers
- On Feb 22, 2021, at 6:57 AM, Dmitry V. Levin l...@altlinux.org wrote: > On Mon, Feb 22, 2021 at 11:04:43AM +0100, Piotr Figiel wrote: > [...] >> --- a/include/uapi/linux/ptrace.h >> +++ b/include/uapi/linux/ptrace.h >> @@ -102,6 +102,14 @@ struct ptrace_syscall_info { >> }; >> }; >>

Re: [PATCH] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-22 Thread Dmitry V. Levin
On Mon, Feb 22, 2021 at 11:04:43AM +0100, Piotr Figiel wrote: [...] > --- a/include/uapi/linux/ptrace.h > +++ b/include/uapi/linux/ptrace.h > @@ -102,6 +102,14 @@ struct ptrace_syscall_info { > }; > }; > > +#define PTRACE_GET_RSEQ_CONFIGURATION0x420f > + > +struct

[PATCH] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-22 Thread Piotr Figiel
For userspace checkpoint and restore (C/R) a way of getting process state containing RSEQ configuration is needed. There are two ways this information is going to be used: - to re-enable RSEQ for threads which had it enabled before C/R - to detect if a thread was in a critical section during