mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hsuan-Chi Kuo <hsuanchikuo@gmail.com>
To: Kees Cook <keescook@chromium.org>, Wiktor Garbacz <wiktorg@google.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Will Drewry <wad@chromium.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] seccomp: Fix setting number of loaded filters
Date: Wed, 11 Aug 2021 13:48:50 -0500	[thread overview]
Message-ID: <96d45778-6011-81e2-2fec-3f07ee8b6e15@gmail.com> (raw)
In-Reply-To: <202108111144.3519134B5@keescook>

Thanks.

I was just trying to understand how seccomp works by code reading and 
spotted this bug.


On 8/11/21 1:46 PM, Kees Cook wrote:
> On Tue, Aug 10, 2021 at 02:51:58PM +0200, Wiktor Garbacz wrote:
>> The value is only reported through procfs so this
>> is purely cosmetic.
> Hi,
>
> Thanks for the patch! I thought this had already been fixed, but I see I
> dropped the ball. :( Sorry!
>
> I'll get the original fix landed[1], and add you as a reporter.
>
> Out of curiosity, how did you (or Hsuan-Chi Kuo) find this? Broken
> behavior, code reading, static analysis?
>
> Thanks!
>
> -Kees
>
> [1] https://lore.kernel.org/lkml/20210304233708.420597-1-hsuanchikuo@gmail.com/
>
>> Signed-off-by: Wiktor Garbacz <wiktorg@google.com>
>> ---
>>   kernel/seccomp.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/seccomp.c b/kernel/seccomp.c
>> index 057e17f3215d..6469eca8078c 100644
>> --- a/kernel/seccomp.c
>> +++ b/kernel/seccomp.c
>> @@ -602,7 +602,7 @@ static inline void seccomp_sync_threads(unsigned long flags)
>>   		smp_store_release(&thread->seccomp.filter,
>>   				  caller->seccomp.filter);
>>   		atomic_set(&thread->seccomp.filter_count,
>> -			   atomic_read(&thread->seccomp.filter_count));
>> +			   atomic_read(&caller->seccomp.filter_count));
>>   
>>   		/*
>>   		 * Don't let an unprivileged task work around
>> -- 
>> 2.32.0.605.g8dce9f2422-goog
>>

      reply	other threads:[~2021-08-11 18:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 12:51 Wiktor Garbacz
2021-08-11 18:46 ` Kees Cook
2021-08-11 18:48   ` Hsuan-Chi Kuo [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=96d45778-6011-81e2-2fec-3f07ee8b6e15@gmail.com \
    --to=hsuanchikuo@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=wad@chromium.org \
    --cc=wiktorg@google.com \
    /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®