Re: [PATCH 1/2] entry: Fix CONFIG_SECCOMP assumption

From: Ingo Molnar
Date: Sun Jul 26 2020 - 13:47:40 EST



* Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:

> Ingo Molnar <mingo@xxxxxxxxxx> writes:
> > The __secure_computing() callback only exists on CONFIG_SECCOMP=y,
>
> No. There is a stub function for the SECCOMP=n case.

Which was buggy:

static inline int __secure_computing(void) { return 0; }

Note the 'void' argument, while it should take an argument.

For example on x86-64 allnoconfig there's !CONFIG_SECCOMP.

> > and on architectures that have CONFIG_HAVE_ARCH_SECCOMP_FILTER.
>
> which is a prerequiste for converting over.

Yeah, and the patch I sent makes this explicit instead of implicit.

> > Instead of complicating the #ifdef within the generic entry code,
>
> There is no #ifdef in the generic code and there is none required.

I simply carried that #ifdef over from the x86 code, but indeed fixing
the stub is a bit cleaner.

> > make the generic entry code depend on the availability of a modern
> > seccomp framework. This was implicit in the generic code due to
> > x86 being a modern seccomp-filter architecture.
> >
> > Also move the Kconfig entry to after its HAVE_ARCH_SECCOMP_FILTER
> > dependency and fix minor whitespace damage while at it.
> >
> > Fixes: 142781e108b1: ("entry: Provide generic syscall entry
> > functionality")
>
> I don't see what that fixes.

A build bug.

Thanks,

Ingo