lkml.org 
[lkml]   [2021]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 13/96] seccomp: Fix setting loaded filter count during TSYNC
    Date
    From: Hsuan-Chi Kuo <hsuanchikuo@gmail.com>

    commit b4d8a58f8dcfcc890f296696cadb76e77be44b5f upstream.

    The desired behavior is to set the caller's filter count to thread's.
    This value is reported via /proc, so this fixes the inaccurate count
    exposed to userspace; it is not used for reference counting, etc.

    Signed-off-by: Hsuan-Chi Kuo <hsuanchikuo@gmail.com>
    Link: https://lore.kernel.org/r/20210304233708.420597-1-hsuanchikuo@gmail.com
    Co-developed-by: Wiktor Garbacz <wiktorg@google.com>
    Signed-off-by: Wiktor Garbacz <wiktorg@google.com>
    Link: https://lore.kernel.org/lkml/20210810125158.329849-1-wiktorg@google.com
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Cc: stable@vger.kernel.org
    Fixes: c818c03b661c ("seccomp: Report number of loaded filters in /proc/$pid/status")
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    kernel/seccomp.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/kernel/seccomp.c
    +++ b/kernel/seccomp.c
    @@ -511,7 +511,7 @@ static inline void seccomp_sync_threads(
    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

    \
     
     \ /
      Last update: 2021-08-16 15:11    [W:2.085 / U:0.916 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site