From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0788C47096 for ; Wed, 2 Jun 2021 08:27:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C94BA613CA for ; Wed, 2 Jun 2021 08:27:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232566AbhFBI2q (ORCPT ); Wed, 2 Jun 2021 04:28:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232553AbhFBI2p (ORCPT ); Wed, 2 Jun 2021 04:28:45 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8395FC061574; Wed, 2 Jun 2021 01:27:02 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id z137-20020a1c7e8f0000b02901774f2a7dc4so893695wmc.0; Wed, 02 Jun 2021 01:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=CU0B/oJqWatyP0iZPnko3W/2+Dczj4WeybZjMPNiDQQ=; b=rKx8sgq/rksoQjxuVTAKCHOfo2duG70cbNLuuSluZsvBLfiYMJtrJSrGjKppMtlVJK RAGPaqCXs/QgB3CY4i1rV7Emto/AFXxMeQUI9OeCaP/UnGdIDZ8M3M0nOL6thFM9s9tv kBb7C6pH0YzsalcmK4FytfGrf2BU9jTqeIvBqDqSo5DbmI+/LbSdr96vK3scCXH5fFmm GwpSaX7wkmczKYhMeoidYZPTn+jHwUp5i+5QGzst1vDZqrkCEtk3WugJ1t9LdVVfnOzS TiFOLBlqdIi4A15XeAS1npIJQR/YM5ZgwWiXNJPDhxbAGozSCrc4a1ECzZcYbcDks8fd gePw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CU0B/oJqWatyP0iZPnko3W/2+Dczj4WeybZjMPNiDQQ=; b=hDxdD5VZnVj2tGT7g4pUOLqC7bYyvyuiceWaClBkB+0SrrrWg6soiSnXBiD36DgFId soGa53AGyHqzPY4AK+oTcZ6P/c7889mcew00F7wKW8r4KETmiOLVUyts2/3EPL8DbQkx 0yEv/8iiPxCPCKiTNnG/F2wIEy8LTJ6ViFu1T2k517WzCBCxryoXuDEsduQk2kIZNbIT MDwzMS+1vud5lC9APvbSWRSKLQj4Ms/nnRIqSITcLo0jNp3NFOLfGlW7ZQtZrDi2ZzPJ i2/fsAwJicVnqBeM4p7bWf7kbEg19gVhHI5n8RQQtjvHRdNNRGLsB/KCOD+57lG6uuAA kPNg== X-Gm-Message-State: AOAM533QmNpvDySkwnq0EtkTe9QUCXACRrYQBKvf9bt20Yz/FRSDfmx0 nzAdKuOGFFQ74raBpgYnM9M= X-Google-Smtp-Source: ABdhPJwvZTlPfMn4KfCZxEL6JOqJss24Kw5hd2byShk3vARpVOt44/VQKL7R2Fd+bHQ8mGGIyyYhbA== X-Received: by 2002:a1c:4304:: with SMTP id q4mr3746995wma.89.1622622421178; Wed, 02 Jun 2021 01:27:01 -0700 (PDT) Received: from [192.168.8.197] ([85.255.237.139]) by smtp.gmail.com with ESMTPSA id p187sm1942070wmp.28.2021.06.02.01.27.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Jun 2021 01:27:00 -0700 (PDT) To: Paul Moore , Jens Axboe Cc: linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-audit@redhat.com, io-uring@vger.kernel.org, linux-fsdevel@vger.kernel.org, Kumar Kartikeya Dwivedi , Alexander Viro References: <162163367115.8379.8459012634106035341.stgit@sifl> <162163379461.8379.9691291608621179559.stgit@sifl> <162219f9-7844-0c78-388f-9b5c06557d06@gmail.com> <8943629d-3c69-3529-ca79-d7f8e2c60c16@kernel.dk> <9e69e4b6-2b87-a688-d604-c7f70be894f5@kernel.dk> <3bef7c8a-ee70-d91d-74db-367ad0137d00@kernel.dk> From: Pavel Begunkov Subject: Re: [RFC PATCH 2/9] audit,io_uring,io-wq: add some basic audit support to io_uring Message-ID: <94e50554-f71a-50ab-c468-418863d2b46f@gmail.com> Date: Wed, 2 Jun 2021 09:26:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 5/28/21 5:02 PM, Paul Moore wrote: > On Wed, May 26, 2021 at 4:19 PM Paul Moore wrote: >> ... If we moved the _entry >> and _exit calls into the individual operation case blocks (quick >> openat example below) so that only certain operations were able to be >> audited would that be acceptable assuming the high frequency ops were >> untouched? My initial gut feeling was that this would involve >50% of >> the ops, but Steve Grubb seems to think it would be less; it may be >> time to look at that a bit more seriously, but if it gets a NACK >> regardless it isn't worth the time - thoughts? >> >> case IORING_OP_OPENAT: >> audit_uring_entry(req->opcode); >> ret = io_openat(req, issue_flags); >> audit_uring_exit(!ret, ret); >> break; > > I wanted to pose this question again in case it was lost in the > thread, I suspect this may be the last option before we have to "fix" > things at the Kconfig level. I definitely don't want to have to go > that route, and I suspect most everyone on this thread feels the same, > so I'm hopeful we can find a solution that is begrudgingly acceptable > to both groups. May work for me, but have to ask how many, and what is the criteria? I'd think anything opening a file or manipulating fs: IORING_OP_ACCEPT, IORING_OP_CONNECT, IORING_OP_OPENAT[2], IORING_OP_RENAMEAT, IORING_OP_UNLINKAT, IORING_OP_SHUTDOWN, IORING_OP_FILES_UPDATE + coming mkdirat and others. IORING_OP_CLOSE? IORING_OP_SEND IORING_OP_RECV? What about? IORING_OP_FSYNC, IORING_OP_SYNC_FILE_RANGE, IORING_OP_FALLOCATE, IORING_OP_STATX, IORING_OP_FADVISE, IORING_OP_MADVISE, IORING_OP_EPOLL_CTL Another question, io_uring may exercise asynchronous paths, i.e. io_issue_sqe() returns before requests completes. Shouldn't be the case for open/etc at the moment, but was that considered? I don't see it happening, but would prefer to keep it open async reimplementation in a distant future. Does audit sleep? -- Pavel Begunkov From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0127C4708F for ; Wed, 2 Jun 2021 12:59:55 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4031F613F3 for ; Wed, 2 Jun 2021 12:59:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4031F613F3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=linux-audit-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-45-xa84yoIwM-a34cT1usWwEw-1; Wed, 02 Jun 2021 08:59:52 -0400 X-MC-Unique: xa84yoIwM-a34cT1usWwEw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E2418803F50; Wed, 2 Jun 2021 12:59:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0AA690BA; Wed, 2 Jun 2021 12:59:46 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 14AAE1801264; Wed, 2 Jun 2021 12:59:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1528R6FI026862 for ; Wed, 2 Jun 2021 04:27:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 94FEC1017CD8; Wed, 2 Jun 2021 08:27:06 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 90667111F3BE for ; Wed, 2 Jun 2021 08:27:04 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 623F9801E8D for ; Wed, 2 Jun 2021 08:27:04 +0000 (UTC) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-422-9q7a_3I9PzeILC-StDQiJg-1; Wed, 02 Jun 2021 04:27:02 -0400 X-MC-Unique: 9q7a_3I9PzeILC-StDQiJg-1 Received: by mail-wm1-f45.google.com with SMTP id n17-20020a7bc5d10000b0290169edfadac9so3209137wmk.1 for ; Wed, 02 Jun 2021 01:27:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CU0B/oJqWatyP0iZPnko3W/2+Dczj4WeybZjMPNiDQQ=; b=JSWSVunlaBuStAWCcpcRwtOIe/FPk+vtCGalDTzS+yczjWjm4oPSntY2HQoyKuUgmy 1YfZauTAmbOymTt1VHgAo0Al7Kn4Kv/cgc0qymw+Fu1QqoaBzegCM0XXdLAvfNp/rYWm FoWS1OfUcW3GmM/oH6Rw3PxSqLKV808v/DeUz0gRhthiHOwwQgjjF10Ut8NQ63jrdCjB X4Oz9y0wZkfuKg+AJw8GmdkqfxlQJ7rbYowamaTIzcDQ8llXlA/WVmT3zc59bqZDK3Od rmXyMJK6F2UD7I+NvbsEJ5pSv/Wz1HbeqO4eNpPWJum3IWfYM2mAgwB4iNAjgGcnibpE 9jdg== X-Gm-Message-State: AOAM5300owh4AJvIX0n4HLR2wU6KybNcjndsGdPDe/1xTnbLWXlFo5Xz +O+QQ8adBixXb/aORwlN4sP3rCL0iaAFKA== X-Google-Smtp-Source: ABdhPJwvZTlPfMn4KfCZxEL6JOqJss24Kw5hd2byShk3vARpVOt44/VQKL7R2Fd+bHQ8mGGIyyYhbA== X-Received: by 2002:a1c:4304:: with SMTP id q4mr3746995wma.89.1622622421178; Wed, 02 Jun 2021 01:27:01 -0700 (PDT) Received: from [192.168.8.197] ([85.255.237.139]) by smtp.gmail.com with ESMTPSA id p187sm1942070wmp.28.2021.06.02.01.27.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Jun 2021 01:27:00 -0700 (PDT) To: Paul Moore , Jens Axboe References: <162163367115.8379.8459012634106035341.stgit@sifl> <162163379461.8379.9691291608621179559.stgit@sifl> <162219f9-7844-0c78-388f-9b5c06557d06@gmail.com> <8943629d-3c69-3529-ca79-d7f8e2c60c16@kernel.dk> <9e69e4b6-2b87-a688-d604-c7f70be894f5@kernel.dk> <3bef7c8a-ee70-d91d-74db-367ad0137d00@kernel.dk> From: Pavel Begunkov Subject: Re: [RFC PATCH 2/9] audit,io_uring,io-wq: add some basic audit support to io_uring Message-ID: <94e50554-f71a-50ab-c468-418863d2b46f@gmail.com> Date: Wed, 2 Jun 2021 09:26:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: linux-audit@redhat.com X-Mailman-Approved-At: Wed, 02 Jun 2021 08:59:43 -0400 Cc: selinux@vger.kernel.org, linux-security-module@vger.kernel.org, linux-audit@redhat.com, Kumar Kartikeya Dwivedi , linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, Alexander Viro X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 5/28/21 5:02 PM, Paul Moore wrote: > On Wed, May 26, 2021 at 4:19 PM Paul Moore wrote: >> ... If we moved the _entry >> and _exit calls into the individual operation case blocks (quick >> openat example below) so that only certain operations were able to be >> audited would that be acceptable assuming the high frequency ops were >> untouched? My initial gut feeling was that this would involve >50% of >> the ops, but Steve Grubb seems to think it would be less; it may be >> time to look at that a bit more seriously, but if it gets a NACK >> regardless it isn't worth the time - thoughts? >> >> case IORING_OP_OPENAT: >> audit_uring_entry(req->opcode); >> ret = io_openat(req, issue_flags); >> audit_uring_exit(!ret, ret); >> break; > > I wanted to pose this question again in case it was lost in the > thread, I suspect this may be the last option before we have to "fix" > things at the Kconfig level. I definitely don't want to have to go > that route, and I suspect most everyone on this thread feels the same, > so I'm hopeful we can find a solution that is begrudgingly acceptable > to both groups. May work for me, but have to ask how many, and what is the criteria? I'd think anything opening a file or manipulating fs: IORING_OP_ACCEPT, IORING_OP_CONNECT, IORING_OP_OPENAT[2], IORING_OP_RENAMEAT, IORING_OP_UNLINKAT, IORING_OP_SHUTDOWN, IORING_OP_FILES_UPDATE + coming mkdirat and others. IORING_OP_CLOSE? IORING_OP_SEND IORING_OP_RECV? What about? IORING_OP_FSYNC, IORING_OP_SYNC_FILE_RANGE, IORING_OP_FALLOCATE, IORING_OP_STATX, IORING_OP_FADVISE, IORING_OP_MADVISE, IORING_OP_EPOLL_CTL Another question, io_uring may exercise asynchronous paths, i.e. io_issue_sqe() returns before requests completes. Shouldn't be the case for open/etc at the moment, but was that considered? I don't see it happening, but would prefer to keep it open async reimplementation in a distant future. Does audit sleep? -- Pavel Begunkov -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit