Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp338337ybl; Tue, 7 Jan 2020 20:40:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzl77OTA+7Cr598gbBzrKD0YlnFUA6m3GFr0NyLUzkNn5AAdBabhyqsnERD+UYglyOBCzi4 X-Received: by 2002:a05:6830:158:: with SMTP id j24mr2888562otp.316.1578458442603; Tue, 07 Jan 2020 20:40:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578458442; cv=none; d=google.com; s=arc-20160816; b=yPPHxlEb4/rQA8AlYvKfeAZ4Zj+Jf0GCONq2Uia2PSxmPIlrc1LfLYOtnWAB/OI1bk 3U9vk4/CY9L8mYbHSSNW7xbfX1VBfMqE4GfS5hVMZcqs9UxgEnpZUzz2iTDZLbC9f2Ix 6roGQphIr0pfuuz5R+XpEggw40OzGVBHre5SBi6RaBzdpiWAcPAbjPyUknGb6tNnwoir 84s2+5r0H/jiow19kogrVYP+RFN96gezlP2dKruNRhv394cdR5D9thasS3JXmBpvpp/c sUsEE99bxeQg3cfp0dpTQE2+XZ8PP6xbio5BJpDLQKFxkt/4qkGPRnRpqHrQ+l2z1zgy d5WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=484oG99YJeCftwgOSTI5kLnVIg1r0jPAOgSUB6Fytew=; b=SQKEdaZAc1odMd23X8TCqzle3HYiaszOUbbacNI0Av7xa7N/WsxoPw9ZUWWvJ/0175 scbULWPOhpc6eAGRF07jNK+Jb6jlh8YWEp5cFChFzoInoX8KQ2DNEfsosWfRNDZDzdib XcbpFfB7tu4gZpZ78nQ5M8ybe5yOdDYV8//40f5hAqZWOo+t+cj6SjUWKwLyDJwhReOE 06K7p9YPcT8aO4KnQgnT2aVM59g2kgJfTFioS3s7kqa6s/No19HtLK0K/ODG5Eva/QXn bgM/ppsdiq1NE2kNMfVMLVrBjTTcZhBkC7c40tX4jaL0Xf+/UuBtXlCIrqyQ1xBE2FoW HkKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="zo2q/guK"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u188si1273509oia.80.2020.01.07.20.40.29; Tue, 07 Jan 2020 20:40:42 -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=pass header.i=@kernel.org header.s=default header.b="zo2q/guK"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726719AbgAHEj1 (ORCPT + 99 others); Tue, 7 Jan 2020 23:39:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:58168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726149AbgAHEj1 (ORCPT ); Tue, 7 Jan 2020 23:39:27 -0500 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8E17920848 for ; Wed, 8 Jan 2020 04:39:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578458366; bh=dPkwsTHDSFh/AlhLKMu8SfXypcftv+MrrSXdjB8TlCg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=zo2q/guK0Te/iTqGXf3SvyqyWLZnZryXPvlKdFXdNJdGBBy8ctLeTY2cPwgEHE06N NPJbRd8JxRD23NLJgsLXpSJawO2dNwLgMoXyn5etXhzNfdNtiX8KV8gXLwFHH5Jmj7 K3TYOsWq2pU0Xxc8rWGq+IHMRapADDP2TTdSFTko= Received: by mail-wm1-f54.google.com with SMTP id m24so1043344wmc.3 for ; Tue, 07 Jan 2020 20:39:26 -0800 (PST) X-Gm-Message-State: APjAAAXIgqyJqw/AZVuWRjyJAUtnEJSxsZ5n0rjWSH+LbVnlBKmXc2Cb OOPdAuF1CP6CtQDuHXdjeytzqdsP+5QPscB1X6zbiA== X-Received: by 2002:a1c:7ed0:: with SMTP id z199mr1421925wmc.58.1578458364943; Tue, 07 Jan 2020 20:39:24 -0800 (PST) MIME-Version: 1.0 References: <20191230052036.8765-1-cyphar@cyphar.com> <20191230052036.8765-2-cyphar@cyphar.com> <20191230082847.dkriyisvu7wwxqqu@yavin.dot.cyphar.com> In-Reply-To: <20191230082847.dkriyisvu7wwxqqu@yavin.dot.cyphar.com> From: Andy Lutomirski Date: Tue, 7 Jan 2020 20:39:10 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC 1/1] mount: universally disallow mounting over symlinks To: Aleksa Sarai Cc: Linus Torvalds , Al Viro , David Howells , Eric Biederman , stable , Christian Brauner , Serge Hallyn , dev@opencontainers.org, Linux Containers , Linux API , linux-fsdevel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 30, 2019 at 12:29 AM Aleksa Sarai wrote: > > On 2019-12-29, Linus Torvalds wrote: > > On Sun, Dec 29, 2019 at 9:21 PM Aleksa Sarai wrote: > > If allowing bind-mounts over symlinks is allowed (which I don't have a > problem with really), it just means we'll need a few more kernel pieces > to get this hardening to work. But these features would be useful > outside of the problems I'm dealing with (O_EMPTYPATH and some kind of > pidfd-based interface to grab the equivalent of /proc/self/exe and a few > other such magic-link targets). As one data point, I would use this ability in virtme: this would allow me to more reliably mount over /etc/resolve.conf even when it's a symlink. (Perhaps I should use overlayfs instead. Hmm.)