linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Wiktor Garbacz <wiktorg@google.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Will Drewry <wad@chromium.org>,
	linux-kernel@vger.kernel.org,
	Hsuan-Chi Kuo <hsuanchikuo@gmail.com>
Subject: Re: [PATCH] seccomp: Fix setting number of loaded filters
Date: Wed, 11 Aug 2021 11:46:44 -0700	[thread overview]
Message-ID: <202108111144.3519134B5@keescook> (raw)
In-Reply-To: <20210810125158.329849-1-wiktorg@google.com>

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
> 

-- 
Kees Cook

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 12:51 [PATCH] seccomp: Fix setting number of loaded filters Wiktor Garbacz
2021-08-11 18:46 ` Kees Cook [this message]
2021-08-11 18:48   ` Hsuan-Chi Kuo

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=202108111144.3519134B5@keescook \
    --to=keescook@chromium.org \
    --cc=hsuanchikuo@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).