From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: DoS with unprivileged mounts Date: Wed, 14 Aug 2013 12:26:24 -0700 Message-ID: <520BD9E0.8050304@mit.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: "Eric W. Biederman" , "Serge E. Hallyn" , Al Viro , Linux-Fsdevel , Kernel Mailing List To: Miklos Szeredi Return-path: Received: from mail-pd0-f172.google.com ([209.85.192.172]:52059 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933079Ab3HNT01 (ORCPT ); Wed, 14 Aug 2013 15:26:27 -0400 Received: by mail-pd0-f172.google.com with SMTP id z10so6825648pdj.31 for ; Wed, 14 Aug 2013 12:26:26 -0700 (PDT) In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 08/14/2013 10:42 AM, Miklos Szeredi wrote: > There's a simple and effective way to prevent unlink(2) and rename(2) > from operating on any file or directory by simply mounting something > on it. In any mount instance in any namespace. > > Was this considered in the unprivileged mount design? > > The solution is also theoretically simple: mounts in unpriv namespaces > are marked "volatile" and are dissolved on an unlink type operation. I'd actually prefer the reverse: unprivileged mounts don't prevent unlink and rename. If the dentry goes away, then the mount could still exist, sans underlying file. (This is already supported on network filesystems.) --Andy