mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: luto@amacapital.net, wad@chromium.org, Mateusz Guzik <mjguzik@gmail.com>
Cc: Kees Cook <kees@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] seccomp: avoid the lock trip seccomp_filter_release in common case
Date: Mon, 24 Feb 2025 11:18:04 -0800	[thread overview]
Message-ID: <174042468261.3899124.11197404704577449998.b4-ty@kernel.org> (raw)
In-Reply-To: <20250213170911.1140187-1-mjguzik@gmail.com>

On Thu, 13 Feb 2025 18:09:10 +0100, Mateusz Guzik wrote:
> Vast majority of threads don't have any seccomp filters, all while the
> lock taken here is shared between all threads in given process and
> frequently used.
> 
> Safety of the check relies on the following:
> - seccomp_filter_release is only legally called for PF_EXITING threads
> - SIGNAL_GROUP_EXIT is only ever set with the sighand lock held
> - PF_EXITING is only ever set with the sighand lock held *or* after
>   SIGNAL_GROUP_EXIT is set *or* the process is single-threaded
> - seccomp_sync_threads holds the sighand lock and skips all threads if
>   SIGNAL_GROUP_EXIT is set, PF_EXITING threads if not
> 
> [...]

Applied to for-next/seccomp, thanks!

[1/1] seccomp: avoid the lock trip seccomp_filter_release in common case
      https://git.kernel.org/kees/c/8f19331384e6

Take care,

-- 
Kees Cook


      reply	other threads:[~2025-02-24 19:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-13 17:09 Mateusz Guzik
2025-02-24 19:18 ` 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=174042468261.3899124.11197404704577449998.b4-ty@kernel.org \
    --to=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mjguzik@gmail.com \
    --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

all inboxes | Powered by JetHome®