Re: [PATCH] ptrace/x86: introduce TS_COMPAT_RESTART to fix get_nr_restart_syscall()

From: Linus Torvalds
Date: Thu Nov 28 2019 - 14:26:10 EST


On Thu, Nov 28, 2019 at 7:36 AM Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> You misunderstood my question, I do not see a good place for the code
> above. So I am going to uglify */signal.[ch] files.

Ahh, ok, I thought that was kind of understood.

> --- a/arch/x86/include/asm/signal.h
> +++ b/arch/x86/include/asm/signal.h
> @@ -5,6 +5,10 @@
> #ifndef __ASSEMBLY__
> #include <linux/linkage.h>
>
> +struct restart_block;
> +extern void arch_set_restart_data(struct restart_block *);
> +#define arch_set_restart_data arch_set_restart_data

I'd just replace this with

/* We need to save TS_COMPAT at the time of the call */
#define arch_set_restart_data(blk) (blk)->arch_data =
current_thread_info()->status

or something like that.

Linus