Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp49300ybl; Thu, 30 Jan 2020 16:47:09 -0800 (PST) X-Google-Smtp-Source: APXvYqxhOGj1DJ/x+AyKHp9ZMlHsMWhq7sUWd+Lbff7TY3bDaI+GI7JOCv3tuIqo7dHb3vYO2YRm X-Received: by 2002:a05:6830:1d7b:: with SMTP id l27mr5402550oti.251.1580431628960; Thu, 30 Jan 2020 16:47:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580431628; cv=none; d=google.com; s=arc-20160816; b=M/H7LnhkoL0JF2G1XuO8TZcw74a7zoPfx+1hLR/dMtcolyHC9sB5byvGjvkPVgJy6S A6srxR4WcbhlkRenzNvaMmloadIqnhjHcjDK/FObeBjUVe1uCL2P5+Bf/PqP/7Ehytqt r1btKxsnA22tUHml9fKB7s6llv14xPhW8KI9/GHDn3ufdAVdNuYNUen5Dzy7kS2RogzZ rY/LXgZPMFHqCHO8Vnn+F93HBi+lsbqFFwgXZ2jsNNe6kcFu8Eph8QaMMywUI0A7vplX Gybh+EffpaRNYR1Q/0Yf05BYdvx59J9VFR1JQA3Nbp3RKKP/a2BYlwXDl1S8N2mh5JPR s+tg== 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=UpM7VFG/zdQEWVczMpq8Y9+PdpJOLXC1FfE6Cj2VPL4=; b=zcmXEYUdx2IoGM6DkrR2fZpbUCZiFXHIt7skiOHn1M4MJYqFADcFg3c5wSHOmldHWB hOTlDMQIRqi8tNSDDioVFiPnUpu+UFOdC/+oDK3/4juhu16j9Frild/21AxhImJHbIQr GpwMGrSypjSYQcRZeFZRC0mPloM1S0N9sxxBr0dwEEGzzCInaIpxq3Yp5ZseYhu+lGMT SEiFdHT+KXxxvWKmGWpLmprxSEmMtm+87WdyqjEbUg3FTSiiFUvG4f3KHKnb5IoqWYnV 8E2ZIh8BMyaA1uq947VCjD9KE+v5b7OWa1AR6Vgvt8bYBhP955R+N6R8HZnn8QiKpNUt W2Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Z812Ip8G; 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 i8si3655923otp.254.2020.01.30.16.46.56; Thu, 30 Jan 2020 16:47:08 -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=Z812Ip8G; 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 S1727715AbgAaAqA (ORCPT + 99 others); Thu, 30 Jan 2020 19:46:00 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:44910 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727610AbgAaAp7 (ORCPT ); Thu, 30 Jan 2020 19:45:59 -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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UpM7VFG/zdQEWVczMpq8Y9+PdpJOLXC1FfE6Cj2VPL4=; b=Z812Ip8GK0i5I8as4kw56sgX1 n6Ne/Zw7lxZtjj+iT596InY105gESqowa+uCnSoDBxwNVxF2Q+p17ay+d2scn0QoEjXEqoiEFf7JT tgOA9YkX1Q3PHUjqLY+69kfFFtiCpHfnMckNHWpgWawts9G5aNdhXob8zDSA21eOFPLYxXEPL1CnW Maq6hg6OVAAUf7H72tDIu4MG6I3qTgC09FBslJWTJDLHve78n3QL2vJss5KfhD7t04Nmcf3b4WTtJ BTG2BJvG83AtARHWOYeKQ8MAvLOVvOFtfcY0gihDYrEmFbIBEV9rCIHf9Y2reWcYn0IUxwDiTDVv8 ldUDGHLLQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1ixKRa-0006mu-L4; Fri, 31 Jan 2020 00:45:58 +0000 Date: Thu, 30 Jan 2020 16:45:58 -0800 From: Matthew Wilcox To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, Mattias Nissler , Benjamin Gordon , Ross Zwisler , Raul Rangel , Micah Morton , Dmitry Torokhov , Jan Kara , Alexander Viro , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v4] Add a "nosymfollow" mount option. Message-ID: <20200131004558.GA6699@bombadil.infradead.org> References: <20200131002750.257358-1-zwisler@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200131002750.257358-1-zwisler@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 30, 2020 at 05:27:50PM -0700, Ross Zwisler wrote: > For mounts that have the new "nosymfollow" option, don't follow > symlinks when resolving paths. The new option is similar in spirit to > the existing "nodev", "noexec", and "nosuid" options. Various BSD > variants have been supporting the "nosymfollow" mount option for a > long time with equivalent implementations. > > Note that symlinks may still be created on file systems mounted with > the "nosymfollow" option present. readlink() remains functional, so > user space code that is aware of symlinks can still choose to follow > them explicitly. > > Setting the "nosymfollow" mount option helps prevent privileged > writers from modifying files unintentionally in case there is an > unexpected link along the accessed path. The "nosymfollow" option is > thus useful as a defensive measure for systems that need to deal with > untrusted file systems in privileged contexts. The openat2 series was just merged yesterday which includes a LOOKUP_NO_SYMLINKS option. Is this enough for your needs, or do you need the mount option? https://lore.kernel.org/linux-fsdevel/20200129142709.GX23230@ZenIV.linux.org.uk/