Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262453AbVEMRcK (ORCPT ); Fri, 13 May 2005 13:32:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262454AbVEMRaq (ORCPT ); Fri, 13 May 2005 13:30:46 -0400 Received: from e33.co.us.ibm.com ([32.97.110.131]:47024 "EHLO e33.co.us.ibm.com") by vger.kernel.org with ESMTP id S262453AbVEMR3v (ORCPT ); Fri, 13 May 2005 13:29:51 -0400 Subject: Re: [PATCH] namespace.c: fix bind mount from foreign namespace From: Ram To: Miklos Szeredi Cc: viro@parcelfarce.linux.theplanet.co.uk, Andrew Morton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org In-Reply-To: References: <20050513170602.GI1150@parcelfarce.linux.theplanet.co.uk> Content-Type: multipart/mixed; boundary="=-n2Jpu51d1g8nE4H1MZTr" Organization: IBM Message-Id: <1116005355.6248.372.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Fri, 13 May 2005 10:29:16 -0700 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1569 Lines: 50 --=-n2Jpu51d1g8nE4H1MZTr Content-Type: text/plain Content-Transfer-Encoding: 7bit On Fri, 2005-05-13 at 10:17, Miklos Szeredi wrote: > > > Bind mount from a foreign namespace results in > > > > ... -EINVAL > > Wrong answer. Look again, you wrote the code, so you _should_ know ;) I guess Al agrees that bind mount from foreign namespace must be disallowed. Which means what Jamie pointed to was right. Attached the patch which fixes it. > > Miklos > - > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --=-n2Jpu51d1g8nE4H1MZTr Content-Disposition: attachment; filename=bind.patch Content-Type: text/x-patch; name=bind.patch Content-Transfer-Encoding: 7bit --- /home/linux/views/linux-2.6.12-rc4/fs/namespace.c 2005-05-06 23:22:29.000000000 -0700 +++ 2.6.12-rc4/fs/namespace.c 2005-05-13 10:17:19.000000000 -0700 @@ -633,7 +633,7 @@ static int do_loopback(struct nameidata down_write(¤t->namespace->sem); err = -EINVAL; - if (check_mnt(nd->mnt) && (!recurse || check_mnt(old_nd.mnt))) { + if (check_mnt(nd->mnt) && check_mnt(old_nd.mnt)) { err = -ENOMEM; if (recurse) mnt = copy_tree(old_nd.mnt, old_nd.dentry); --=-n2Jpu51d1g8nE4H1MZTr-- - 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/