mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Hromatka <tom.hromatka@oracle.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Kees Cook <kees@kernel.org>,
	Andy Lutomirski <luto@amacapital.net>,
	Will Drewry <wad@chromium.org>, Sargun Dhillon <sargun@sargun.me>,
	Jonathan Corbet <corbet@lwn.net>, Shuah Khan <shuah@kernel.org>,
	Christian Brauner <brauner@kernel.org>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"open list:KERNEL SELFTEST FRAMEWORK"
	<linux-kselftest@vger.kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH] seccomp: Add SECCOMP_CLONE_FILTER operation
Date: Wed, 3 Sep 2025 14:51:54 -0600	[thread overview]
Message-ID: <42cf76db-6cda-4606-9128-6f433da57d48@oracle.com> (raw)
In-Reply-To: <CAADnVQLve3KgrqNqSqVrmL-wz6Jj1QUdjAcE5P26Z4wvh9e4HA@mail.gmail.com>

On 9/3/25 2:45 PM, Alexei Starovoitov wrote:
> On Wed, Sep 3, 2025 at 1:38 PM Tom Hromatka <tom.hromatka@oracle.com> wrote:
>>
>> +
>> +       spin_lock_irq(&current->sighand->siglock);
>> +       spin_lock_irq(&task->sighand->siglock);
>> +
>> +       if (atomic_read(&task->seccomp.filter_count) == 0) {
>> +               spin_unlock_irq(&task->sighand->siglock);
>> +               spin_unlock_irq(&current->sighand->siglock);
> 
> did you copy this pattern from somewhere ?
> It's obviously buggy.

I tried to mimic the logic in copy_seccomp() in kernel/fork.c,
but as you point out, I probably messed it up :).

Do you have recommendations for a better design pattern?

Thanks!

Tom

  reply	other threads:[~2025-09-03 20:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-03 20:38 Tom Hromatka
2025-09-03 20:45 ` Alexei Starovoitov
2025-09-03 20:51   ` Tom Hromatka [this message]
2025-09-03 22:44     ` Alexei Starovoitov
2025-09-04 12:08       ` Tom Hromatka
2025-09-04 14:26       ` Tom Hromatka
2025-09-04 14:54         ` Al Viro
2025-09-04 18:10           ` Tom Hromatka
2025-09-04 11:53 ` kernel test robot
2025-09-04 16:26 ` Kees Cook
2025-09-04 18:19   ` Tom Hromatka
2025-09-04 17:51 ` Al Viro
2025-09-05 21:03   ` YiFei Zhu

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=42cf76db-6cda-4606-9128-6f433da57d48@oracle.com \
    --to=tom.hromatka@oracle.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=corbet@lwn.net \
    --cc=kees@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=sargun@sargun.me \
    --cc=shuah@kernel.org \
    --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®