Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp56859iob; Tue, 17 May 2022 18:37:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyufNsWJf2aZp/tNLADsGkvI9rrkj2biVAiOjYe+SWh2+bkQ52AHCpypgqif6zXCiXpYjIM X-Received: by 2002:a17:90b:4c8a:b0:1dc:6ff1:e2e1 with SMTP id my10-20020a17090b4c8a00b001dc6ff1e2e1mr27483609pjb.217.1652837869874; Tue, 17 May 2022 18:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652837869; cv=none; d=google.com; s=arc-20160816; b=fTPZv9ShUhtimBzYsJr7bI3J9lugZGy6r1NU4wgsEOY4mOmcnwbW7K6V8LAqzbttGc P6UstnBCfm8uDcNlY1nVY4izVoSWLw83H8R3h+jsCkHKRu1wHqyLwS+RtygwjcgtCUHM KTEVAMp4APSUlFOOpivyo2StGqDdVSbv7CwlP8AlJzI0Q2TYtg+sDJSKLYQxxce6bDpY a2eqZydlA6gHIlh32PwUdH8odbPNzZqul7LreyVfRHSC14UffZtcly4TXhZZBUj+QS6A CaE53F2ImacCQqNQcpzeXSqLnK20MeXvV+/LASybTweDPOoe6lO31Nge0nLFnxndu8RM 5JhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uwMrKlO2MqbTE9nwU9Tb94pfbBXuygfDTBIAQ9AIcak=; b=K793xdpzWsGR/zMoPIKAZBjEaeZYod913R7JF0PO6d8jz65oYGLuQOah41+NlRUKgF XU+JnTtP+ZmzdNOmkapAAxNuDWw/s+8h+tDh5hbEaFZEBERhqzkctuWU2E5k/f6Te4cV 33SVk4oPuy8MWbY0LfEwsdq9ZoCHjfY5Qd1xD09Y4jLnA6wRL3To3bvGQFPtBoYmR8CH H6PuZe/bQB9B+z57jUa+94h7XmiC0hcaVvmA4qtKGbOTS81ANN5P9BlilHcJC7C5U1Ou uwBsYfAZ9CmUd6en2mLDKsAyYakXji5cy6SX/IjLmiPZObtK98QWZlfm0SESZZNyuvbJ LEmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=evSRBxjP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b16-20020aa78ed0000000b0050604ac89e3si1069298pfr.345.2022.05.17.18.37.11; Tue, 17 May 2022 18:37:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=evSRBxjP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242746AbiEQNNP (ORCPT + 99 others); Tue, 17 May 2022 09:13:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347575AbiEQNM7 (ORCPT ); Tue, 17 May 2022 09:12:59 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C55BA43499 for ; Tue, 17 May 2022 06:12:46 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id r30so6996403wra.13 for ; Tue, 17 May 2022 06:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uwMrKlO2MqbTE9nwU9Tb94pfbBXuygfDTBIAQ9AIcak=; b=evSRBxjPOwiQhrL4v2tc5BXHcq28KJSKKUUZ8tw4lNVq9aRp8nPvo0pJBUfdetFaXm V1KEXcs4XRianJg/wscukWim/Rvlkp7C612GqnAaSUACxnitN6m/g3d5Ust/ACWw4bWn ssAVJhvdun7xb3pGk1hdC2KNF+7wfne3suLPkda0HabEDbl5vJloWdQeIzfNU9doEx7t J30nZaYKFbeGK1xbb80WR1OVGVf9SvYg5Zow34xbjf69AzuGkqnVP303OajJm3PjJOaD dCIQfCisE9iA7ytzHIjynNnkneq5ope+XqIOD9WHVk0i5oszK/B8QFcB3T2JEFcYTegk Ewyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uwMrKlO2MqbTE9nwU9Tb94pfbBXuygfDTBIAQ9AIcak=; b=lYezxQHNHXcDZh+AqCzYXkkRiULJNeoHsUpJfeOBkJhNsuxvt+ZtRfgnL0h/8TQzEO PYM7BLzw++Kl59XFOgvtVPLdbPlUpMmLMV2btslYkFNR6hgTTrJtX9f5n1iQngxx789U Be47aoJmJ9qtIpoHSkoIR6JMXLyy5ttmJygrRkR81fW0S5J9isKUmblGDIat/FuJgv6/ H7TZGrqs0TVpJ2UVHA1Y2sRCUA7X9bhscciASuWxboUoozRRMyqJTbpma8IgulOFasD3 WncpLUWWulnR1dROxrfohYh7QsMhxRytbwrKtiXv1Y1bst+ELYq0pFFufj13cgLlJk8Y 0Yag== X-Gm-Message-State: AOAM531Mc0xR+rfsKk9F1LGElmmqSi9yO4uZ1nhTKmyg7b1n6eQACup+ P3qEg4b1efADUl+U5h4u6jTpITz4R8ldUhDKWDiV X-Received: by 2002:a5d:5888:0:b0:20c:9868:9d94 with SMTP id n8-20020a5d5888000000b0020c98689d94mr17973192wrf.433.1652793165091; Tue, 17 May 2022 06:12:45 -0700 (PDT) MIME-Version: 1.0 References: <20220517103253.22601-1-ju.orth@gmail.com> <20220517103253.22601-2-ju.orth@gmail.com> In-Reply-To: <20220517103253.22601-2-ju.orth@gmail.com> From: Paul Moore Date: Tue, 17 May 2022 09:12:34 -0400 Message-ID: Subject: Re: [PATCH 1/1] audit,io_uring,io-wq: call __audit_uring_exit for dummy contexts To: Julian Orth Cc: Eric Paris , linux-audit@redhat.com, linux-kernel@vger.kernel.org, Jens Axboe Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 17, 2022 at 6:33 AM Julian Orth wrote: > > Not calling the function for dummy contexts will cause the context to > not be reset. During the next syscall, this will cause an error in > __audit_syscall_entry: > > WARN_ON(context->context != AUDIT_CTX_UNUSED); > WARN_ON(context->name_count); > if (context->context != AUDIT_CTX_UNUSED || context->name_count) { > audit_panic("unrecoverable error in audit_syscall_entry()"); > return; > } > > These problematic dummy contexts are created via the following call > chain: > > exit_to_user_mode_prepare > -> arch_do_signal_or_restart > -> get_signal > -> task_work_run > -> tctx_task_work > -> io_req_task_submit > -> io_issue_sqe > -> audit_uring_entry > > Fixes: 5bd2182d58e9 ("audit,io_uring,io-wq: add some basic audit support to io_uring") > Signed-off-by: Julian Orth > --- > include/linux/audit.h | 2 +- > kernel/auditsc.c | 6 ++++++ > 2 files changed, 7 insertions(+), 1 deletion(-) Hi Julian, Thanks for the report and the patch too! I agree that it does seem a little odd that we haven't seen this before, let me dig into this a bit more today and respond back. -- paul-moore.com