From patchwork Fri Jan 27 17:23:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Guy Briggs X-Patchwork-Id: 13119087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D0F8C61DA4 for ; Fri, 27 Jan 2023 17:25:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235180AbjA0RZH (ORCPT ); Fri, 27 Jan 2023 12:25:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235185AbjA0RZF (ORCPT ); Fri, 27 Jan 2023 12:25:05 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABBEE78AC7 for ; Fri, 27 Jan 2023 09:24:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674840256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qTj1NY9uDDolSfOmg33hPPt92c/gJa5SVLegok4bxCs=; b=OQhmyBdK0VMo3+zDT8b3POmQx9aCF8487T5Wm8cnpqrVtynMAZ5tw8f2xKuNkjPsVS2OCE YB5BPd+TKFVKuaragHfd4alYV6EktEb3L2PUL0/dIc/9DchT/rCK04qLPVLc3r5Uq3GpZv Z5ZEfq3VousMYrwUsJA5QlwsLbyTN7k= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-246-XDUGUybROuewq9juZwbq5A-1; Fri, 27 Jan 2023 12:24:13 -0500 X-MC-Unique: XDUGUybROuewq9juZwbq5A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1F61885A588; Fri, 27 Jan 2023 17:24:13 +0000 (UTC) Received: from madcap2.tricolour.com (ovpn-0-3.rdu2.redhat.com [10.22.0.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id A60262166B26; Fri, 27 Jan 2023 17:24:11 +0000 (UTC) From: Richard Guy Briggs To: Linux-Audit Mailing List , LKML , io-uring@vger.kernel.org Cc: Paul Moore , Eric Paris , Steve Grubb , Richard Guy Briggs , Stefan Roesch , Christian Brauner , Jens Axboe , Pavel Begunkov Subject: [PATCH v1 1/2] io_uring,audit: audit IORING_OP_FADVISE but not IORING_OP_MADVISE Date: Fri, 27 Jan 2023 12:23:45 -0500 Message-Id: <68eb0c2dd50bca1af91203669f7f1f8312331f38.1674682056.git.rgb@redhat.com> In-Reply-To: References: MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Since FADVISE can truncate files and MADVISE operates on memory, reverse the audit_skip tags. Fixes: 5bd2182d58e9 ("audit,io_uring,io-wq: add some basic audit support to io_uring") Signed-off-by: Richard Guy Briggs --- io_uring/opdef.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/opdef.c b/io_uring/opdef.c index 3aa0d65c50e3..a2bf53b4a38a 100644 --- a/io_uring/opdef.c +++ b/io_uring/opdef.c @@ -306,12 +306,12 @@ const struct io_op_def io_op_defs[] = { }, [IORING_OP_FADVISE] = { .needs_file = 1, - .audit_skip = 1, .name = "FADVISE", .prep = io_fadvise_prep, .issue = io_fadvise, }, [IORING_OP_MADVISE] = { + .audit_skip = 1, .name = "MADVISE", .prep = io_madvise_prep, .issue = io_madvise, From patchwork Fri Jan 27 17:23:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Guy Briggs X-Patchwork-Id: 13119086 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B212C61D97 for ; Fri, 27 Jan 2023 17:25:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234116AbjA0RZF (ORCPT ); Fri, 27 Jan 2023 12:25:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231701AbjA0RZD (ORCPT ); Fri, 27 Jan 2023 12:25:03 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96A5227492 for ; Fri, 27 Jan 2023 09:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674840259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eX6Cm8kNYSgck1tuSa55reiDXfLO+860Yz9cAHbWxZ0=; b=I3RPb+csFthXzPXDL/v6X6LHaHCHx7iHXTncAeOxgdC+pZmRoycFG519G4nn3KjC1R5IgY 9W/BMC8kczKNN4vqHotLklFuf+to8FJB69Ao4bmxaQ39JpaaVHAsW1Fm4yu7eC4JA10xCU E69XA+VByF4ESJUp+5Pz1omOVO5BGIY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-437-OGMzI3qxM8SD5hKBXp2rUw-1; Fri, 27 Jan 2023 12:24:15 -0500 X-MC-Unique: OGMzI3qxM8SD5hKBXp2rUw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D34D8101A521; Fri, 27 Jan 2023 17:24:14 +0000 (UTC) Received: from madcap2.tricolour.com (ovpn-0-3.rdu2.redhat.com [10.22.0.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54BD72166B26; Fri, 27 Jan 2023 17:24:13 +0000 (UTC) From: Richard Guy Briggs To: Linux-Audit Mailing List , LKML , io-uring@vger.kernel.org Cc: Paul Moore , Eric Paris , Steve Grubb , Richard Guy Briggs , Stefan Roesch , Christian Brauner , Jens Axboe , Pavel Begunkov Subject: [PATCH v1 2/2] io_uring,audit: do not log IORING_OP_*GETXATTR Date: Fri, 27 Jan 2023 12:23:46 -0500 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Getting XATTRs is not particularly interesting security-wise. Suggested-by: Steve Grubb Fixes: a56834e0fafe ("io_uring: add fgetxattr and getxattr support") Signed-off-by: Richard Guy Briggs --- io_uring/opdef.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/io_uring/opdef.c b/io_uring/opdef.c index a2bf53b4a38a..f6bfe2cf078c 100644 --- a/io_uring/opdef.c +++ b/io_uring/opdef.c @@ -462,12 +462,14 @@ const struct io_op_def io_op_defs[] = { }, [IORING_OP_FGETXATTR] = { .needs_file = 1, + .audit_skip = 1, .name = "FGETXATTR", .prep = io_fgetxattr_prep, .issue = io_fgetxattr, .cleanup = io_xattr_cleanup, }, [IORING_OP_GETXATTR] = { + .audit_skip = 1, .name = "GETXATTR", .prep = io_getxattr_prep, .issue = io_getxattr,