From: Jesper Juhl Subject: Re: [PATCH] NFS4: Avoid potential NULL pointer dereference in decode_and_add_ds(). Date: Mon, 17 Jan 2011 19:42:26 +0100 (CET) Message-ID: References: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: linux-nfs@vger.kernel.org, Trond Myklebust , linux-kernel@vger.kernel.org To: Fred Isaman Return-path: Received: from swampdragon.chaosbits.net ([90.184.90.115]:14848 "EHLO swampdragon.chaosbits.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751791Ab1AQSm0 (ORCPT ); Mon, 17 Jan 2011 13:42:26 -0500 In-Reply-To: Sender: linux-nfs-owner@vger.kernel.org List-ID: On Mon, 17 Jan 2011, Fred Isaman wrote: > On Sun, Jan 16, 2011 at 3:50 PM, Jesper Juhl wrote: > > strrchr() can return NULL if nothing is found. If this happens we'll > > dereference a NULL pointer in > > fs/nfs/nfs4filelayoutdev.c::decode_and_add_ds(). > > > > I tried to find some other code that guarantees that this can never > > happen but I was unsuccessful. So, unless someone else can point to some > > code that ensures this can never be a problem, I believe this patch is > > needed. > > > > The only guarantee is the assumption that the server isn't sending > garbage. As such, this patch looks good to me. > Thanks. Can I add your Acked-by: if/when I resend the patch? -- Jesper Juhl http://www.chaosbits.net/ Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please.