Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753184Ab3GXPrJ (ORCPT ); Wed, 24 Jul 2013 11:47:09 -0400 Received: from mail-ve0-f181.google.com ([209.85.128.181]:55259 "EHLO mail-ve0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752239Ab3GXPrH (ORCPT ); Wed, 24 Jul 2013 11:47:07 -0400 MIME-Version: 1.0 In-Reply-To: <87li4wpi2b.fsf@xmission.com> References: <877gghruwq.fsf@xmission.com> <87li4wpi2b.fsf@xmission.com> From: Andy Lutomirski Date: Wed, 24 Jul 2013 08:46:45 -0700 Message-ID: Subject: Re: [REVIEW][PATCH] vfs: Lock in place mounts from more privileged users To: "Eric W. Biederman" Cc: Linux Containers , "Serge E. Hallyn" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1444 Lines: 33 On Tue, Jul 23, 2013 at 11:50 PM, Eric W. Biederman wrote: > Andy Lutomirski writes: >> On Tue, Jul 23, 2013 at 11:30 AM, Eric W. Biederman >> wrote: >>> >>> When creating a less privileged mount namespace or propogating mounts >>> from a more privileged to a less privileged mount namespace lock the >>> submounts so they may not be unmounted individually in the child mount >>> namespace revealing what is under them. >> >> I would propose a different rule: if vfsmount b is mounted on vfsmount >> a, then to unmount b, you must be ns_capable(CAP_SYS_MOUNT) on either >> a's namespace or b's namespace. The idea is that you should be able >> to see under a mount if you own the parent (because it's yours) or if >> you own the child (because you, or someone no more privileged than >> you, put it there). This may result in a simpler patch and should do >> much the same thing. > > It definitely won't result in a simpler patch as the information you are > basing the decision on is not available. > Ah, I see -- mnt_ns gets changed when the namespace is duplicated. Acked-by: Andy Lutomirski --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/