public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Will Drewry <wad@chromium.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] seccomp: Stub for !HAVE_ARCH_SECCOMP_FILTER
Date: Mon, 14 Oct 2024 13:54:32 -0700	[thread overview]
Message-ID: <202410141352.7C2783E@keescook> (raw)
In-Reply-To: <20241008-seccomp-compile-error-v1-1-f87de4007095@linaro.org>

On Tue, Oct 08, 2024 at 10:29:43AM +0200, Linus Walleij wrote:
> If we have CONFIG_SECCOMP but not CONFIG_HAVE_ARCH_SECCOMP_FILTER
> we get a compilation error:
> [...]
> +static inline int __secure_computing(const struct seccomp_data *sd) { return 0; }

I don't think this is the right solution (for gaining ARM generic
syscall support). For example see how this is done currently on ARM:

#ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
        if (secure_computing() == -1)
                return -1;
#else
        /* XXX: remove this once OABI gets fixed */
        secure_computing_strict(syscall_get_nr(current, regs));
#endif

If we just return 0, all of seccomp will get ignored. I think the
generic code needs to do something like the above...

-- 
Kees Cook

      reply	other threads:[~2024-10-14 20:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08  8:29 [PATCH] seccomp: Stub for !HAVE_ARCH_SECCOMP_FILTER Linus Walleij
2024-10-14 20:54 ` Kees Cook [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202410141352.7C2783E@keescook \
    --to=kees@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=wad@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox