projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cfce660
)
hugetlbfs: add NULL check in hugetlb_zero_setup()
author
Akinobu Mita
<
[email protected]
>
Sun, 6 May 2007 21:50:18 +0000
(14:50 -0700)
committer
Linus Torvalds
<
[email protected]
>
Mon, 7 May 2007 19:12:57 +0000
(12:12 -0700)
If hugetlbfs module_init() fails, hugetlbfs_vfsmount is not initialized and
shmget() with SHM_HUGETLB flag will cause NULL pointer dereference.
Signed-off-by: Akinobu Mita <
[email protected]
>
Acked-by: William Irwin <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
fs/hugetlbfs/inode.c
patch
|
blob
|
history
diff --git
a/fs/hugetlbfs/inode.c
b/fs/hugetlbfs/inode.c
index 842a4ed4052d1d2039684b2bd0fefefa4bb70f32..98959b87cdf8f1f674c668673b10bf110a7bf653 100644
(file)
--- a/
fs/hugetlbfs/inode.c
+++ b/
fs/hugetlbfs/inode.c
@@
-747,6
+747,9
@@
struct file *hugetlb_zero_setup(size_t size)
char buf[16];
static atomic_t counter;
+ if (!hugetlbfs_vfsmount)
+ return ERR_PTR(-ENOENT);
+
if (!can_do_hugetlb_shm())
return ERR_PTR(-EPERM);