Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4691207iob; Sun, 8 May 2022 22:09:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyffvoXIjGHz84AcosUAmwG15u+/IQYQ4pRmdzTf4XmCEpPsThWcxYP9Eofc363X0tFksgJ X-Received: by 2002:a17:90a:2f84:b0:1dd:940:50e7 with SMTP id t4-20020a17090a2f8400b001dd094050e7mr6585408pjd.210.1652072973917; Sun, 08 May 2022 22:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652072973; cv=none; d=google.com; s=arc-20160816; b=BvMPOoPBezFIe/SmXxrUqs1aUFzVbYrQjSdyND6DqXRZALDrMRsIeuCSWByX50Inr2 PJgcwySwRSMSzYzbelEkfHfWxy+7rPQOmqtqlm4V154yjYm4gAKHlVlYU+NXISCXmWll wlzF7mJrSmqllVy3PD+2LEaGxRcoBZTtVgaz+fvex+Ynds/ph+d6Qar6Mk2eOl1SL+Rl Ci98SUge7pCrIu15G8j35vhWk4Azkd/vEEZ7Wt3S+g9sVHhgmCKiNyoj07geXxNbcH1H uuVzvY6px7Yt7MVM/Zprr1dv0UWvWOCI7+eIheMZlxR4IjmtU00U64SymyhYLVncgu9X OdKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=oLTw3J5HqlJGXaem/7/GBVpCJVJMfm3k1q3z73ZMkPw=; b=Tjkws1I9R/fBYk1RPVUNgQ2Vmc2jOA/kOGNly8BPbYz9k4g4Uq+WpTn5DaXe24mmJi Vibagu+BtRWAO8IPxeku5yj8agZIJOSBC3yC5rZS3nnRYox/ajD7+VkybTn8myFWv6D4 Q+IabNEIIyIe+t6OhNVNISd7bqo1mXrpOvdmQ7XDSlTgVB33PbayzR58ni4JhXjCatUP OOB+uw6D+I8MwQECVXQxzSV9w3x2UGcSS5ME7UiwYxAAZaC77YWC6pXuXMUIooopGcdF otpWNrq8ceqdla6jSfHgLccGcPQeuRjgt8c2bl6U/ftStYOiJLmjHzE2FW8JKeKu80p4 wtEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="1Yy/gjrY"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a72-20020a63904b000000b003c62371dfa2si6479526pge.271.2022.05.08.22.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 22:09:33 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="1Yy/gjrY"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 95E5EAAE19; Sun, 8 May 2022 22:03:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390188AbiEFIjU (ORCPT + 99 others); Fri, 6 May 2022 04:39:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1390195AbiEFIjN (ORCPT ); Fri, 6 May 2022 04:39:13 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7489AF21; Fri, 6 May 2022 01:35:27 -0700 (PDT) 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1651826125; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oLTw3J5HqlJGXaem/7/GBVpCJVJMfm3k1q3z73ZMkPw=; b=1Yy/gjrYQLm4DghIDFhD/IrLawONoyxXP5fOdpWyFVG4MSJevaI5r46X34PjzhRQ8GDjJ0 eIo/wkkeVpmBxFTPWOi5XkpXYNGx+tQQBEF6QIRloZ2cfaf/2ELMa8SyrummqomKCkpYaJ aiakOCQQYpN+Slsuwruruoq1Uc8N6Rk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1651826125; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oLTw3J5HqlJGXaem/7/GBVpCJVJMfm3k1q3z73ZMkPw=; b=l0VFkJAOc+cqSSLs18nzyG9/resunTOXRHoe0KSkn9/d64u9N6r2B5secCGatv/Bk+14Fm M3NdS/OdqZ7Bc+CA== 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 Cc: Jan Kara , Richard Guy Briggs , Paul Moore , Linux-Audit Mailing List , LKML , linux-fsdevel , Eric Paris , Steve Grubb 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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