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 7A07DEB64D9 for ; Thu, 29 Jun 2023 13:49:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbjF2Nt0 (ORCPT ); Thu, 29 Jun 2023 09:49:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231496AbjF2NtY (ORCPT ); Thu, 29 Jun 2023 09:49:24 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2491358A for ; Thu, 29 Jun 2023 06:49:22 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 95DDA1F892; Thu, 29 Jun 2023 13:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1688046561; h=from:from:reply-to: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=xABarwN0L5RHYJ+bXO64WN8ow+NziMypZSpUKtgfS4c=; b=ExptP5+e7NhQm/eHSU0Y5zGAzBHEBLKuA3WYsiy2DIQwzDI3ma96MQUDOCZJGd2AcZ471f DjTE5IrnJRrXgQw/na/ORpuenQ4HKh0+MXoGQ5y31sdCEghZcR6KizU4TG6AL9Ugazy9pc mFR/81yVfmUR079FO08GmcAzREio1bE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1688046561; h=from:from:reply-to: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=xABarwN0L5RHYJ+bXO64WN8ow+NziMypZSpUKtgfS4c=; b=3R8e8IdHN6ZIeuxydQpowUFxqK/AO1z8MJIKawAvFK36HKSl43AOwrrBtnpX7EpRBFxumF TqThP7Nsv2KrosBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 87F02139FF; Thu, 29 Jun 2023 13:49:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id PUgjIeGLnWSvAwAAMHmgww (envelope-from ); Thu, 29 Jun 2023 13:49:21 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 23BF2A0722; Thu, 29 Jun 2023 15:49:21 +0200 (CEST) Date: Thu, 29 Jun 2023 15:49:21 +0200 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , Ahelenia =?utf-8?Q?Ziemia=C5=84ska?= , Christian Brauner , Al Viro , linux-fsdevel@vger.kernel.org Subject: Re: [RFC][PATCH] fanotify: disallow mount/sb marks on kernel internal pseudo fs Message-ID: <20230629134921.aai2vwideeng3fh6@quack3> References: <20230629042044.25723-1-amir73il@gmail.com> <20230629101858.72ftsgnfblb5kv64@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu 29-06-23 15:51:58, Amir Goldstein wrote: > On Thu, Jun 29, 2023 at 3:20 PM Amir Goldstein wrote: > > > > The tricky point in banning anonymous pipes from inotify, which > > > > could have existing users (?), but maybe not, so maybe this is > > > > something that we need to try out. > > > > > > > > I think we can easily get away with banning anonymous pipes from > > > > fanotify altogeter, but I would not like to get to into a situation > > > > where new applications will be written to rely on inotify for > > > > functionaly that fanotify is never going to have. > > > > > > Yeah, so didn't we try to already disable inotify on some virtual inodes > > > and didn't it break something? I have a vague feeling we've already tried > > > that in the past and it didn't quite fly but searching the history didn't > > > reveal anything so maybe I'm mistaking it with something else. > > > > > > > I do have the same memory now that you mention it. > > I will try to track it down. > > > > Here it is: > https://lore.kernel.org/linux-fsdevel/20200629130915.GF26507@quack2.suse.cz/ > > A regression report on Mel's patch: > e9c15badbb7b ("fs: Do not check if there is a fsnotify watcher on > pseudo inodes") > > Chromium needs IN_OPEN/IN_CLOSE on anon pipes. > It does not need IN_ACCESS/IN_MODIFY, but the value of eliminating > those was deemed as marginal after the alternative optimizations by Mel: > > 71d734103edf ("fsnotify: Rearrange fast path to minimise overhead when > there is no watcher") Ah, yes. Thanks for the history digging! My grep-foo over the changelogs was not good enough to find it :) > The reason I would like to ban the "global" watch on all anon inodes > is because it is just wrong and an oversight of sb/mount marks that > needs to be fixed. > > The SB_NOUSER optimization is something that we can consider later. > It's not critical, but just a very low hanging fruit to pick. > > Based on this finding, I would go with this RFC patch as is. > I will let you decide how to CC stable and about the timing > of sending this to Linus. Yes, let's go with the patch as is. Currently I have pull request pending with Linus so I won't merge the patch yet but I plan on merging it early next week and then sending it to Linus towards the end of the next week. Honza -- Jan Kara SUSE Labs, CR