All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] get_nr_restart_syscall() should return __NR_ia32_restart_syscall if __USER32_CS
@ 2017-03-28 14:54 Oleg Nesterov
  2017-03-28 14:54 ` [PATCH 1/1] " Oleg Nesterov
  2017-03-29 16:33 ` syscall_get_error() && TS_ checks Oleg Nesterov
  0 siblings, 2 replies; 27+ messages in thread
From: Oleg Nesterov @ 2017-03-28 14:54 UTC (permalink / raw)
  To: Andrew Morton, Andy Lutomirski, Linus Torvalds
  Cc: Denys Vlasenko, H. Peter Anvin, Ingo Molnar, Jan Kratochvil,
	Pedro Alves, Thomas Gleixner, x86, linux-kernel

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.

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2017-03-30 19:29 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28 14:54 [PATCH 0/1] get_nr_restart_syscall() should return __NR_ia32_restart_syscall if __USER32_CS Oleg Nesterov
2017-03-28 14:54 ` [PATCH 1/1] " Oleg Nesterov
2017-03-28 15:03   ` Andy Lutomirski
2017-03-28 16:27     ` Oleg Nesterov
2017-03-28 17:10       ` Andy Lutomirski
2017-03-29 15:05       ` Oleg Nesterov
2017-03-29 16:59         ` Andy Lutomirski
2017-03-30 15:28           ` Oleg Nesterov
2017-03-30 18:36             ` Andy Lutomirski
2017-03-29 16:33 ` syscall_get_error() && TS_ checks Oleg Nesterov
2017-03-29 16:45   ` Linus Torvalds
2017-03-29 16:55     ` Oleg Nesterov
2017-03-29 16:59       ` Linus Torvalds
2017-03-29 17:04         ` Oleg Nesterov
2017-03-29 17:16           ` Linus Torvalds
2017-03-29 18:50             ` Oleg Nesterov
2017-03-29 18:56               ` Linus Torvalds
2017-03-30 13:51                 ` Oleg Nesterov
2017-03-30 15:49                   ` Oleg Nesterov
2017-03-30 17:46                     ` Linus Torvalds
2017-03-30 18:23                       ` Andy Lutomirski
2017-03-30 18:35                         ` Linus Torvalds
2017-03-30 18:59                           ` Andy Lutomirski
2017-03-30 19:11                             ` Linus Torvalds
2017-03-30 19:21                               ` Andy Lutomirski
2017-03-30 19:29                                 ` Linus Torvalds
2017-03-29 16:56     ` Andy Lutomirski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.