Commit d0980c12 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix reiserfs oom crash

From: Oleg Drokin <green@linuxhacker.ru>

Thanks to Standford guys, a case where reiserfs can dereference NULL
pointer if memory allocation fail during mount was identified.
parent deb2ae4a
...@@ -2260,8 +2260,10 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo ...@@ -2260,8 +2260,10 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
INIT_LIST_HEAD (&SB_JOURNAL(p_s_sb)->j_prealloc_list); 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_working_list);
INIT_LIST_HEAD(&SB_JOURNAL(p_s_sb)->j_journal_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, if (reiserfs_allocate_list_bitmaps(p_s_sb,
SB_BMAP_NR(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) ; allocate_bitmap_nodes(p_s_sb) ;
/* reserved for journal area support */ /* reserved for journal area support */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment