lkml.org 
[lkml]   [2022]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 6.0 246/862] audit: explicitly check audit_context->context enum value
    Date
    From: Richard Guy Briggs <rgb@redhat.com>

    [ Upstream commit 3ed66951f952ed8f1a5d03e171722bf2631e8d58 ]

    Be explicit in checking the struct audit_context "context" member enum
    value rather than assuming the order of context enum values.

    Fixes: 12c5e81d3fd0 ("audit: prepare audit_context for use in calling contexts beyond syscalls")
    Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
    Signed-off-by: Paul Moore <paul@paul-moore.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    kernel/auditsc.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/kernel/auditsc.c b/kernel/auditsc.c
    index 79a5da1bc5bb..0ee09447ad04 100644
    --- a/kernel/auditsc.c
    +++ b/kernel/auditsc.c
    @@ -2069,7 +2069,7 @@ void __audit_syscall_exit(int success, long return_code)
    /* run through both filters to ensure we set the filterkey properly */
    audit_filter_syscall(current, context);
    audit_filter_inodes(current, context);
    - if (context->current_state < AUDIT_STATE_RECORD)
    + if (context->current_state != AUDIT_STATE_RECORD)
    goto out;

    audit_log_exit();
    --
    2.35.1


    \
     
     \ /
      Last update: 2022-10-19 15:59    [W:2.062 / U:0.496 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site