lkml.org 
[lkml]   [2006]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] panic() instead of crashing on a null pointer deref in mount_block_root()
Date

If __getname() fails in mount_block_root() we are dead in the water, but
a panic() seems a little nicer than crashing due to a NULL pointer deref.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

init/do_mounts.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)


--- linux-2.6.17-rc4-git2-orig/init/do_mounts.c 2006-05-13 21:28:53.000000000 +0200
+++ linux-2.6.17-rc4-git2/init/do_mounts.c 2006-05-14 02:05:52.000000000 +0200
@@ -286,6 +286,8 @@ void __init mount_block_root(char *name,
char *p;
char b[BDEVNAME_SIZE];

+ if (!fs_names)
+ panic("VFS: Failed memory allocation in mount_block_root()");
get_fs_names(fs_names);
retry:
for (p = fs_names; *p; p += strlen(p)+1) {
@@ -425,4 +427,3 @@ out:
security_sb_post_mountroot();
mount_devfs_fs ();
}
-



-
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: 2006-05-14 02:10    [W:1.153 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site