On Fri, Jan 17, 2025 at 6:10 AM Oleg Nesterov <oleg@xxxxxxxxxx> wrote: > > On 01/17, Masami Hiramatsu wrote: > > > > On Fri, 17 Jan 2025 02:39:28 +0100 > > Oleg Nesterov <oleg@xxxxxxxxxx> wrote: > > > > > A note for the seccomp maintainers... > > > > > > I don't know what do you think, but I agree in advance that the very fact this > > > patch adds "#ifdef CONFIG_X86_64" into __secure_computing() doesn't look nice. > > > > > > > Indeed. in_ia32_syscall() depends arch/x86 too. > > We can add an inline function like; > > > > ``` uprobes.h > > static inline bool is_uprobe_syscall(int syscall) > > { > > We can, and this is what I tried to suggest from the very beginning. > But I agree with Eyal who decided to send the most trivial fix for > -stable, we can add the helper later. > > I don't think it should live in uprobes.h and I'd prefer something > like arch_seccomp_ignored(int) but I won't insist. yep, I think this is the way, keeping it as a general category. Should we also put rt_sigreturn there explicitly as well? Also, wouldn't it be better to have it as a non-arch-specific function for something like rt_sigreturn where defining it per each arch is cumbersome, and have the default implementation also call into an arch-specific function? > > > // arch_is_uprobe_syscall check can be replaced by Kconfig, > > // something like CONFIG_ARCH_URETPROBE_SYSCALL. > > Or sysctl or both. This is another issue. > > > ``` arch/x86/include/asm/uprobes.h > > #define arch_is_uprobe_syscall(syscall) \ > > (IS_ENABLED(CONFIG_X86_64) && syscall == __NR_uretprobe && !in_ia32_syscall()) > > ``` > > This won't compile if IS_ENABLED(CONFIG_X86_64) == false, __NR_uretprobe > will be undefined. > > > > The problem is that we need a simple patch for -stable which fixes the real > > > problem. We can cleanup this logic later, I think. > > > > Hmm, at least we should make it is_uprobe_syscall() in uprobes.h so that > > do not pollute the seccomp subsystem with #ifdef. > > See above. But I won't insist. > > Oleg. >