lkml.org 
[lkml]   [2008]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] Fix allocation sizes of knfsd raparm hash
From
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?)

--b.

>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
>
> ---
> 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;


\
 
 \ /
  Last update: 2008-08-15 21:05    [W:0.084 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site