All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hsuan-Chi Kuo <hsuanchikuo@gmail.com>
To: keescook@chromium.org
Cc: hsuanchikuo@gmail.com, Andy Lutomirski <luto@amacapital.net>,
	Will Drewry <wad@chromium.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] seccomp: Fix resetting filter count at seccomp_sync_threads()
Date: Thu,  4 Mar 2021 17:37:08 -0600	[thread overview]
Message-ID: <20210304233708.420597-1-hsuanchikuo@gmail.com> (raw)

The desired behavior is to set the caller's filter count to thread's.

Signed-off-by: Hsuan-Chi Kuo <hsuanchikuo@gmail.com>
---
 kernel/seccomp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index 1d60fc2c99..3dde1aa173 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -597,7 +597,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.30.1


             reply	other threads:[~2021-03-04 23:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 23:37 Hsuan-Chi Kuo [this message]
2021-08-11 19:00 ` [PATCH] seccomp: Fix resetting filter count at seccomp_sync_threads() Kees Cook

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=20210304233708.420597-1-hsuanchikuo@gmail.com \
    --to=hsuanchikuo@gmail.com \
    --cc=keescook@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.