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 Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.133.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DD3F5C433F5 for ; Fri, 6 May 2022 12:09:27 +0000 (UTC) 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-118-G9-jkE8zPUC0KrjJq-cDPw-1; Fri, 06 May 2022 08:09:23 -0400 X-MC-Unique: G9-jkE8zPUC0KrjJq-cDPw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 67C80811E78; Fri, 6 May 2022 12:09:22 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D2FD5C27E8E; Fri, 6 May 2022 12:09:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 89CC61947057; Fri, 6 May 2022 12:09:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 16FFA1947056 for ; Fri, 6 May 2022 08:35:30 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0309CC1D3AD; Fri, 6 May 2022 08:35:30 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F192DC28119 for ; Fri, 6 May 2022 08:35:29 +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 D5AD62919EA4 for ; Fri, 6 May 2022 08:35:29 +0000 (UTC) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-544-BOrK4q9KPWqNQuorwg6O8g-1; Fri, 06 May 2022 04:35:27 -0400 X-MC-Unique: BOrK4q9KPWqNQuorwg6O8g-1 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id B066A21A32; Fri, 6 May 2022 08:35:25 +0000 (UTC) Received: from quack3.suse.cz (unknown [10.100.224.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 2B9D12C142; Fri, 6 May 2022 08:35:25 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id D0378A0629; Fri, 6 May 2022 10:35:23 +0200 (CEST) Date: Fri, 6 May 2022 10:35:23 +0200 From: Jan Kara To: Amir Goldstein Subject: Re: [PATCH v2 2/3] fanotify: define struct members to hold response decision context Message-ID: <20220506083523.drdj2ahjw6abimus@quack3.lan> References: <17660b3f2817e5c0a19d1e9e5d40b53ff4561845.1651174324.git.rgb@redhat.com> <20220505144456.nw6slyqw4pjizl5p@quack3.lan> 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.85 on 10.11.54.8 X-Mailman-Approved-At: Fri, 06 May 2022 12:09:19 +0000 X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Kara , Richard Guy Briggs , LKML , Linux-Audit Mailing List , linux-fsdevel , Eric Paris Errors-To: linux-audit-bounces@redhat.com Sender: "Linux-audit" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Thu 05-05-22 20:34:06, Amir Goldstein wrote: > > One open question I have is what should the kernel do with 'info_type' in > > response it does not understand (in the future when there are possibly more > > different info types). It could just skip it because this should be just > > additional info for introspection (the only mandatory part is in > > fanotify_response, however it could surprise userspace that passed info is > > just getting ignored. To solve this we would have to somewhere report > > supported info types (maybe in fanotify fdinfo in proc). I guess we'll > > cross that bridge when we get to it. > > > > Amir, what do you think? > > Regardless if and how we provide a way to enumerate supported info types, > I would prefer to reject (EINVAL) unknown info types. OK, agreed. I will be also calmer when we do that because then we can be certain userspace does not pass bogus data for unknown info types. > We can provide a command FAN_RESPONSE_TEST to write a test response with > FAN_NOFD and some extra info so the program can test if certain info > types are supported. Hum, that would be an option as well. We don't even need the FAN_RESPONSE_TEST command, do we? The write to fanotify fd for FAN_NOFD fd would just perform validation of the response and either accept it (do nothing) or return EINVAL. Honza -- Jan Kara SUSE Labs, CR -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit