From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH] dcache: Translating dentry into pathname without taking rename_lock Date: Wed, 4 Sep 2013 20:43:41 +0100 Message-ID: <20130904194341.GL13318@ZenIV.linux.org.uk> References: <1378321523-40893-1-git-send-email-Waiman.Long@hp.com> <20130904191104.GK13318@ZenIV.linux.org.uk> <52278AEC.2020307@hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, "Chandramouleeswaran, Aswin" , "Norton, Scott J" To: Waiman Long Return-path: Content-Disposition: inline In-Reply-To: <52278AEC.2020307@hp.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wed, Sep 04, 2013 at 03:33:00PM -0400, Waiman Long wrote: > I have thought about that. But if a d_move() is going on, the string > in the buffer will be discarded as the sequence number will change. > So whether or not it have embedded null byte shouldn't matter. That > is why I didn't add code to do byte-by-byte copy at this first > patch. I can add code to do that if you think it is safer to do so. Sigh... Junk in the output is not an issue; reading from invalid address is, since you might not survive to the sequence number check. Again, if p is an address returned by kmalloc(size, ...), dereferencing p + offset is not safe unless offset is less than size.