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

From: Oleg Nesterov
Date: Tue Nov 26 2019 - 06:08:11 EST


On 11/26, Oleg Nesterov wrote:
>
> This patch adds the sticky TS_COMPAT_RESTART flag which survives after
> return to user mode, hopefully it allows us to kill TS_I386_REGS_POKED
> but this needs another patch.

Alternatively we could add ->compat_restart into struct restart_block,
logically this is the same thing.

Rather than changing syscall_return_slowpath() we could introduce a new
helper, say,

void set_restart_block_fn(struct restart_block *restart, fn)
{
restart->fn = fn;

set/clear TS_COMPAT_RESTART or restart->compat_restart
depending on TS_COMPAT
}

but this patch looks simpler to me.

Oleg.