Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17024671ybl; Wed, 1 Jan 2020 20:00:41 -0800 (PST) X-Google-Smtp-Source: APXvYqw5LKRNa8QumR/sARdHvHZ4psvCxoVmO1jb0VRiFTh/SUQHHWCURmeYkTqnO1ztNEMZ82Wc X-Received: by 2002:a9d:f26:: with SMTP id 35mr93775847ott.260.1577937641167; Wed, 01 Jan 2020 20:00:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577937641; cv=none; d=google.com; s=arc-20160816; b=znkA6NP+4Zlu7lpHtAZRmg0iMgcO/09ZIK1DmIbkDlY0XMs7LXAtQAKxRWp5Nyw3eE l4So6scJi75wqjfTUnwM5xjLIaNhmEYMW/Hh1x9i2ColpPB1x41dqnZUu+NkZvBotg3R RuOv2V0QhBbR5uZJRlAh1PqYMS04x+/sVozsanmPEYCSfbTEQqmnwrXhJM5PCQ7/lhPU IlCpGk98v2eeo+vYQEz25Tcr64sCPcyDRxmptv8QwBZlq/rw/rmwzHqFZaRTWyVHq2Xx lYtcoDLiecqqD31xMndYKBgCkMbCiTaexBWbh1L4BImtSXHkl7z6ybzkqBWTkMkCaKo4 /c/w== 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; bh=YHtY38MGSyItrFXJKAqMtS6sjglhxgl/XhnQI+JY92k=; b=B/X5Mobib4kWnlSfMmKJg3Ei6tLwX6Jfi6w3JrBeuqwPnLYCtXkO6qJ26VK6ttsp1l DUTZLYMz7n8WR5D9FsxeYDM08Opn7mnSAPoEpYk0MNra8yHvd4KtOewc/UZgDopl+EUn KbI4VQ9qTIWO9VNma4w4VnJ27V7FAW1WM+0r+XzBJYBBtclUmQGaKJZAo/Y29tdb97ZA QyCz+NFywGYdWLSEaRBN1kkdJtofltetDKuLlV8VLRYv6YJlKKFUFrX8oAJX93LhXbV7 lMIBD77lzlA9i+zfoIjTJy+FhySWx3dSuITuSyD332EHTAUWmsFHTgI4XRWAz9h9pF2a t3tw== ARC-Authentication-Results: i=1; mx.google.com; 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 18si1049474oir.123.2020.01.01.20.00.29; Wed, 01 Jan 2020 20:00:41 -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; 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 S1727599AbgABD7k (ORCPT + 99 others); Wed, 1 Jan 2020 22:59:40 -0500 Received: from mout-p-201.mailbox.org ([80.241.56.171]:16274 "EHLO mout-p-201.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727509AbgABD7k (ORCPT ); Wed, 1 Jan 2020 22:59:40 -0500 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 47pDnP4gX9zQlB7; Thu, 2 Jan 2020 04:59:37 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter04.heinlein-hosting.de (spamfilter04.heinlein-hosting.de [80.241.56.122]) (amavisd-new, port 10030) with ESMTP id 86V7dup9i5m4; Thu, 2 Jan 2020 04:59:33 +0100 (CET) Date: Thu, 2 Jan 2020 14:59:20 +1100 From: Aleksa Sarai To: Al Viro Cc: David Howells , Eric Biederman , Linus Torvalds , stable@vger.kernel.org, Christian Brauner , Serge Hallyn , dev@opencontainers.org, containers@lists.linux-foundation.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 0/1] mount: universally disallow mounting over symlinks Message-ID: <20200102035920.dsycgxnb6ba2jhz2@yavin.dot.cyphar.com> References: <20191230052036.8765-1-cyphar@cyphar.com> <20191230054413.GX4203@ZenIV.linux.org.uk> <20191230054913.c5avdjqbygtur2l7@yavin.dot.cyphar.com> <20191230072959.62kcojxpthhdwmfa@yavin.dot.cyphar.com> <20200101004324.GA11269@ZenIV.linux.org.uk> <20200101005446.GH4203@ZenIV.linux.org.uk> <20200101030815.GA17593@ZenIV.linux.org.uk> <20200101144407.ugjwzk7zxrucaa6a@yavin.dot.cyphar.com> <20200101234009.GB8904@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tef6rv2ffqcfqgo6" Content-Disposition: inline In-Reply-To: <20200101234009.GB8904@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --tef6rv2ffqcfqgo6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2020-01-01, Al Viro wrote: > On Thu, Jan 02, 2020 at 01:44:07AM +1100, Aleksa Sarai wrote: >=20 > > Thanks, this fixes the issue for me (and also fixes another reproducer I > > found -- mounting a symlink on top of itself then trying to umount it). > >=20 > > Reported-by: Aleksa Sarai > > Tested-by: Aleksa Sarai >=20 > Pushed into #fixes. Thanks. One other thing I noticed is that umount applies to the underlying symlink rather than the mountpoint on top. So, for example (using the same scripts I posted in the thread): # ln -s /tmp/foo link # ./mount_to_symlink /etc/passwd link # umount -l link # will attempt to unmount "/tmp/foo" Is that intentional? --=20 Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH --tef6rv2ffqcfqgo6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSxZm6dtfE8gxLLfYqdlLljIbnQEgUCXg1qlQAKCRCdlLljIbnQ EjpjAP9+cSE8vOT4mUYl4IC31Io/0FRApXDAbaIGxDhJ1uYJQAD+IuziuN4KXZzb 2vUrlYkc86XaKC4oX0suOlWHXbaUdgE= =iYvs -----END PGP SIGNATURE----- --tef6rv2ffqcfqgo6--