From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Serge E. Hallyn" Subject: Re: [RFC v9][PATCH 05/13] Dump memory address space Date: Mon, 10 Nov 2008 14:12:51 -0600 Message-ID: <20081110201251.GA7471@us.ibm.com> References: <1226335060-7061-1-git-send-email-orenl@cs.columbia.edu> <1226335060-7061-6-git-send-email-orenl@cs.columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1226335060-7061-6-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Oren Laadan Cc: Andrew Morton , Linus Torvalds , containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Thomas Gleixner , Dave Hansen , Ingo Molnar , "H. Peter Anvin" , Alexander Viro List-Id: linux-api@vger.kernel.org Quoting Oren Laadan (orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org): > +/** > + * cr_fill_fname - return pathname of a given file > + * @path: path name > + * @root: relative root > + * @buf: buffer for pathname > + * @n: buffer length (in) and pathname length (out) > + */ > +static char * > +cr_fill_fname(struct path *path, struct path *root, char *buf, int *n) > +{ > + struct path tmp = *root; > + char *fname; > + > + BUG_ON(!buf); > + fname = __d_path(path, &tmp, buf, *n); > + if (!IS_ERR(fname)) > + *n = (buf + (*n) - fname); > + /* > + * FIXME: if __d_path() changed these, it must have stepped out of > + * init's namespace. Since currently we require a unified namespace > + * within the container: simply fail. > + */ > + if (tmp.mnt != root->mnt || tmp.dentry != root->dentry) > + fname = ERR_PTR(-EBADF); > + > + return fname; > +} You still are not taking the dcache_lock around __d_path. -serge -- To unsubscribe from this list: send the line "unsubscribe linux-api" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752204AbYKJUNS (ORCPT ); Mon, 10 Nov 2008 15:13:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750827AbYKJUNB (ORCPT ); Mon, 10 Nov 2008 15:13:01 -0500 Received: from e32.co.us.ibm.com ([32.97.110.150]:34842 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750787AbYKJUNA (ORCPT ); Mon, 10 Nov 2008 15:13:00 -0500 Date: Mon, 10 Nov 2008 14:12:51 -0600 From: "Serge E. Hallyn" To: Oren Laadan Cc: Andrew Morton , Linus Torvalds , containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, Thomas Gleixner , Dave Hansen , Ingo Molnar , "H. Peter Anvin" , Alexander Viro Subject: Re: [RFC v9][PATCH 05/13] Dump memory address space Message-ID: <20081110201251.GA7471@us.ibm.com> References: <1226335060-7061-1-git-send-email-orenl@cs.columbia.edu> <1226335060-7061-6-git-send-email-orenl@cs.columbia.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1226335060-7061-6-git-send-email-orenl@cs.columbia.edu> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Oren Laadan (orenl@cs.columbia.edu): > +/** > + * cr_fill_fname - return pathname of a given file > + * @path: path name > + * @root: relative root > + * @buf: buffer for pathname > + * @n: buffer length (in) and pathname length (out) > + */ > +static char * > +cr_fill_fname(struct path *path, struct path *root, char *buf, int *n) > +{ > + struct path tmp = *root; > + char *fname; > + > + BUG_ON(!buf); > + fname = __d_path(path, &tmp, buf, *n); > + if (!IS_ERR(fname)) > + *n = (buf + (*n) - fname); > + /* > + * FIXME: if __d_path() changed these, it must have stepped out of > + * init's namespace. Since currently we require a unified namespace > + * within the container: simply fail. > + */ > + if (tmp.mnt != root->mnt || tmp.dentry != root->dentry) > + fname = ERR_PTR(-EBADF); > + > + return fname; > +} You still are not taking the dcache_lock around __d_path. -serge From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e35.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id mAAKCOOB015367 for ; Mon, 10 Nov 2008 13:12:24 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mAAKCwaK077420 for ; Mon, 10 Nov 2008 13:12:58 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mAAKCS7T008941 for ; Mon, 10 Nov 2008 13:12:29 -0700 Date: Mon, 10 Nov 2008 14:12:51 -0600 From: "Serge E. Hallyn" Subject: Re: [RFC v9][PATCH 05/13] Dump memory address space Message-ID: <20081110201251.GA7471@us.ibm.com> References: <1226335060-7061-1-git-send-email-orenl@cs.columbia.edu> <1226335060-7061-6-git-send-email-orenl@cs.columbia.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1226335060-7061-6-git-send-email-orenl@cs.columbia.edu> Sender: owner-linux-mm@kvack.org Return-Path: To: Oren Laadan Cc: Andrew Morton , Linus Torvalds , containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, Thomas Gleixner , Dave Hansen , Ingo Molnar , "H. Peter Anvin" , Alexander Viro List-ID: Quoting Oren Laadan (orenl@cs.columbia.edu): > +/** > + * cr_fill_fname - return pathname of a given file > + * @path: path name > + * @root: relative root > + * @buf: buffer for pathname > + * @n: buffer length (in) and pathname length (out) > + */ > +static char * > +cr_fill_fname(struct path *path, struct path *root, char *buf, int *n) > +{ > + struct path tmp = *root; > + char *fname; > + > + BUG_ON(!buf); > + fname = __d_path(path, &tmp, buf, *n); > + if (!IS_ERR(fname)) > + *n = (buf + (*n) - fname); > + /* > + * FIXME: if __d_path() changed these, it must have stepped out of > + * init's namespace. Since currently we require a unified namespace > + * within the container: simply fail. > + */ > + if (tmp.mnt != root->mnt || tmp.dentry != root->dentry) > + fname = ERR_PTR(-EBADF); > + > + return fname; > +} You still are not taking the dcache_lock around __d_path. -serge -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org