Skip to content

get_nr_restart_syscall() should return __NR_ia32_restart_syscall if __USER32_CS

Oleg Nesterov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 25 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1get_nr_restart_syscall() should return __NR_ia32_restart_syscall if __USER32_CSarch/x86/kernel/signal.c+2 -17 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] get_nr_restart_syscall() should return __NR_ia32_restart_syscall if __USER32_CS

Hello,

get_nr_restart_syscall() is still buggy, TS_I386_REGS_POKED can't really help and should probably die.

The fix just adds the __USER32_CS check, but perhaps we can avoid these "fundamentally broken" checks altogether?

Is __NR_ia32_restart_syscall/__NR_restart_syscall the part of ABI? OK, we probaly can't remove them, at least right now. But what if we simply add the new syscall number,

	#define __NR_new_restart_syscall	383
	#define __NR_ia32_new_restart_syscall	383

so that it doesn't depends on bitness and we can just do

	static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs)
	{
		BUILD_BUG_ON(__NR_ia32_new_restart_syscall != __NR_new_restart_syscall);
	#ifdef CONFIG_X86_X32_ABI
		return __NR_new_restart_syscall | (regs->orig_ax & __X32_SYSCALL_BIT);
	#else
		return __NR_new_restart_syscall;
	#endif
	}

?

Oleg.