Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp193412ybv; Tue, 4 Feb 2020 19:22:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzGRaZnFYX9TSXJugYHP4GCUCTqODeDPCfY4CwoC/+VjIN0Ls3uSQPU41WtX6OLmV6CcXHO X-Received: by 2002:a05:6830:16d0:: with SMTP id l16mr24910643otr.83.1580872943833; Tue, 04 Feb 2020 19:22:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580872943; cv=none; d=google.com; s=arc-20160816; b=SnMLUEqMd7oFxku1kyKVRPHgumwJmK61VCvEIhkByeyUkKt1lXbILckJnJ3PJv5spD WeA76mhdLUZ1yhOlTppJRhHDcPE5hP+RDfNMQiLYENeDyj7wJyx6ZvbqAqVKFQB5A7eA woZmGH+JiirbDl59B+FLd8ISRZh7CUxri7DmhaL7rpAycV7WvmpMn4dN0PhwHmJLMyxj eOHojG9JXFPyJBqww3V3Kng73GIZ28uSnAI+CzXBoSyEuo1/+UlGIDFClFjDHoiqs9yk C917li+Gmhq84A3OSTN0b2fHDt/OC/nAUt/NOXEpp+3HkbmMGdsbb3FZcyljW0/3WZ9w QagA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=5hq0VwiFlaOmvZItK695F4+jnVwqiW3Dfxm1dkVkswA=; b=xD+LsBsmEXty3mPJwWh33Kb3Yap5/eG72Z16XPYj4Z8xrKMOJXN3wffI3XM5gKAD0p yF8w5LxkE63MpuMmwRTsbnIJp9wd3VtOr6hJeyLUi9lOIoAqAIWZjzvGarEsVe4B7jJs NkMmAwgp/+UkXW3qexCUgVbvL97YRTF7saKkx+PtkVDWm0sWDWeh/akkuviipU1Gditj dZzXWNTltXFUU02XFMuIRbOkZ5ZtT3oB6JZRMnaIU9ZcDzqdhkPcy4rqhlC5SwYc7sYh dVS1WyCvLWvE+GPAZoYtctvpA9GgxGt4BjwqtTaDT4obuavIU/DJQ9+Ad5BCGPbcvUbh Vn3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Zr4BtkV1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q6si12884852oth.26.2020.02.04.19.22.11; Tue, 04 Feb 2020 19:22:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Zr4BtkV1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727861AbgBEDVQ (ORCPT + 99 others); Tue, 4 Feb 2020 22:21:16 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:58166 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727746AbgBEDVQ (ORCPT ); Tue, 4 Feb 2020 22:21:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5hq0VwiFlaOmvZItK695F4+jnVwqiW3Dfxm1dkVkswA=; b=Zr4BtkV1s02JJJN3KPF9BhlNEc uAfsJMGbPNYPSTb/a677eux5ybug3BN5BqO20YL5bYnFfDd31oA2QXxAOSNQLsp3iblPe87QLoGaV DejyTmjUyDmp8nRsL+wYbk3IoJC3g5V48MgpZ1aGgIMBvIgAI07xn8ysSCA1Vvwe1eKZmeHi3R4W5 UiEYmV5XgUNUdeVpsFfGEyyIWdS7fbuYmI3ALO5AuIwp29exe3kkFraNnkruSotbj0jc/7HCy9Gdn /AvwG6eFjJEGEW4qW902m9/PKxUSM0K56Z4thTdu9Ss7vkOmwCAdk3xmc3cUfkUeam+Qzehzmgc3u p5yJXc1Q==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1izBFW-0005CA-D9; Wed, 05 Feb 2020 03:21:10 +0000 Date: Tue, 4 Feb 2020 19:21:10 -0800 From: Matthew Wilcox To: Ross Zwisler Cc: Raul Rangel , David Howells , linux-kernel , Mattias Nissler , Alexander Viro , linux-fsdevel@vger.kernel.org, Benjamin Gordon , Micah Morton , Dmitry Torokhov , Jan Kara , Aleksa Sarai Subject: Re: [PATCH v5] Add a "nosymfollow" mount option. Message-ID: <20200205032110.GR8731@bombadil.infradead.org> References: <20200204215014.257377-1-zwisler@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 04, 2020 at 04:49:48PM -0700, Ross Zwisler wrote: > On Tue, Feb 4, 2020 at 3:11 PM Ross Zwisler wrote: > > On Tue, Feb 4, 2020 at 2:53 PM Raul Rangel wrote: > > > > --- a/include/uapi/linux/mount.h > > > > +++ b/include/uapi/linux/mount.h > > > > @@ -34,6 +34,7 @@ > > > > #define MS_I_VERSION (1<<23) /* Update inode I_version field */ > > > > #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ > > > > #define MS_LAZYTIME (1<<25) /* Update the on-disk [acm]times lazily */ > > > > +#define MS_NOSYMFOLLOW (1<<26) /* Do not follow symlinks */ > > > Doesn't this conflict with MS_SUBMOUNT below? > > > > > > > > /* These sb flags are internal to the kernel */ > > > > #define MS_SUBMOUNT (1<<26) > > > > Yep. Thanks for the catch, v6 on it's way. > > It actually looks like most of the flags which are internal to the > kernel are actually unused (MS_SUBMOUNT, MS_NOREMOTELOCK, MS_NOSEC, > MS_BORN and MS_ACTIVE). Several are unused completely, and the rest > are just part of the AA_MS_IGNORE_MASK which masks them off in the > apparmor LSM, but I'm pretty sure they couldn't have been set anyway. > > I'll just take over (1<<26) for MS_NOSYMFOLLOW, and remove the rest in > a second patch. > > If someone thinks these flags are actually used by something and I'm > just missing it, please let me know. Afraid you did miss it ... /* * sb->s_flags. Note that these mirror the equivalent MS_* flags where * represented in both. */ ... #define SB_SUBMOUNT (1<<26) It's not entirely clear to me why they need to be the same, but I haven't been paying close attention to the separation of superblock and mount flags, so someone else can probably explain the why of it.