From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756244AbYHPIqP (ORCPT ); Sat, 16 Aug 2008 04:46:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752437AbYHPIp7 (ORCPT ); Sat, 16 Aug 2008 04:45:59 -0400 Received: from ns2.suse.de ([195.135.220.15]:36233 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752204AbYHPIp6 (ORCPT ); Sat, 16 Aug 2008 04:45:58 -0400 Date: Sat, 16 Aug 2008 10:45:56 +0200 Message-ID: From: Takashi Iwai To: "J. Bruce Fields" Cc: Stephen Rothwell , linux-next@vger.kernel.org, LKML , Jeff Layton Subject: Re: [PATCH] Fix allocation sizes of knfsd raparm hash In-Reply-To: <20080815190221.GB26563@fieldses.org> References: <20080815184032.3acd8032.sfr@canb.auug.org.au> <20080815190221.GB26563@fieldses.org> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/22.2 (x86_64-suse-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Fri, 15 Aug 2008 15:02:21 -0400, J. Bruce Fields wrote: > > On Fri, Aug 15, 2008 at 03:34:39PM +0200, Takashi Iwai wrote: > > The raparm was allocated in a wrong size in the commit > > > > ca80290ebda9009aedc4bd93ede5d397cb1853dc > > nfsd: permit unauthenticated stat of export root > > > > and thus it resulted in memory corruption, eventually Oopsing. > > This patch fixes the allocation size. > > Whoops, my fault, now fixed; thanks! > > (Out of curiosity--how did you find this?) Actually I hit the related Oops with the latest linux-next tree. Since this bug appears first on that tree and didn't occur on the previous tree, it was apparently a regression. So, I looked through changes over knfsd since the previous tree, found a suspicious one, and tried to fix. The linux-next tree is pretty helpful to catch a regression if one eats own dog foods everyday. BTW, I've been building linux-next SUSE kernel packages at every linux-next release. The packages are found in the following URL: http://ftp.suse.com/pub/people/tiwai/kernel-next/ If anyone has a SUSE system and would like to try linux-next kernel, just installs the package in addition. It won't conflict with existing standard kernel packages. thanks, Takashi > > --b. > > > > > Signed-off-by: Takashi Iwai > > > > --- > > diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c > > index bfa5453..30d606f 100644 > > --- a/fs/nfsd/vfs.c > > +++ b/fs/nfsd/vfs.c > > @@ -2093,7 +2093,7 @@ nfsd_racache_init(int cache_size) > > > > raparm = &raparm_hash[i].pb_head; > > for (j = 0; j < nperbucket; j++) { > > - *raparm = kzalloc(sizeof(*raparm), GFP_KERNEL); > > + *raparm = kzalloc(sizeof(**raparm), GFP_KERNEL); > > if (!*raparm) > > goto out_nomem; > > raparm = &(*raparm)->p_next; >