Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754623AbYLIRS1 (ORCPT ); Tue, 9 Dec 2008 12:18:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753469AbYLIRSR (ORCPT ); Tue, 9 Dec 2008 12:18:17 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:60208 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751700AbYLIRSQ (ORCPT ); Tue, 9 Dec 2008 12:18:16 -0500 Date: Tue, 9 Dec 2008 12:18:14 -0500 From: Christoph Hellwig To: Andrew Morton Cc: Duane Griffin , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: Re: Checking link targets are NULL-terminated Message-ID: <20081209171814.GA8667@infradead.org> References: <20081205144810.GA25585@dastardly.home.dghda.com> <20081208143003.9449bc77.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081208143003.9449bc77.akpm@linux-foundation.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 958 Lines: 19 On Mon, Dec 08, 2008 at 02:30:03PM -0800, Andrew Morton wrote: > Perhaps nd_set_link() is a suitable place? Change that function so > that it is passed a third argument (max_len) and then check that within > nd_set_link(). Change nd_set_link() to return a __must_check-marked > errno, change callers to handle errors appropriately. > > Or something totally different ;) But along those lines? Note that XFS and possibly other filesystem don't store the NULL termination on disk. So having a follow_link interface that uses a counted string would be a nice little optimization for the XFS follow_link / readlink implementation. But I'm not really sure it's worth complicating the VFS for that little gem. -- 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/