lkml.org 
[lkml]   [2004]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [2.6] Make reiserfs not to crash on oom
On Wed, May 12, 2004 at 07:50:38PM +0300, Oleg Drokin wrote:
> Hello!
>
> Thanks to Standford guys, a case where reiserfs can dereference NULL pointer
> if memory allocation fail during mount was identified.
>
> @@ -2260,8 +2260,10 @@
> INIT_LIST_HEAD (&SB_JOURNAL(p_s_sb)->j_prealloc_list);
> INIT_LIST_HEAD(&SB_JOURNAL(p_s_sb)->j_working_list);
> INIT_LIST_HEAD(&SB_JOURNAL(p_s_sb)->j_journal_list);
> - reiserfs_allocate_list_bitmaps(p_s_sb, SB_JOURNAL(p_s_sb)->j_list_bitmap,
> - SB_BMAP_NR(p_s_sb)) ;
> + if (reiserfs_allocate_list_bitmaps(p_s_sb,
> + SB_JOURNAL(p_s_sb)->j_list_bitmap,
> + SB_BMAP_NR(p_s_sb)))
> + goto free_and_return ;
> allocate_bitmap_nodes(p_s_sb) ;

Are you leaking the 'journal' allocation here?
(Ditto some of the other failure paths too)

There's also a typod 'jornal' a few lines further down.

Dave

-
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/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.036 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site