aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hfsplus')
-rw-r--r--fs/hfsplus/bitmap.c12
-rw-r--r--fs/hfsplus/catalog.c5
-rw-r--r--fs/hfsplus/options.c2
-rw-r--r--fs/hfsplus/super.c2
4 files changed, 19 insertions, 2 deletions
diff --git a/fs/hfsplus/bitmap.c b/fs/hfsplus/bitmap.c
index d128a25b74d2..ea30afc2a03c 100644
--- a/fs/hfsplus/bitmap.c
+++ b/fs/hfsplus/bitmap.c
@@ -32,6 +32,10 @@ int hfsplus_block_allocate(struct super_block *sb, u32 size, u32 offset, u32 *ma
32 mutex_lock(&HFSPLUS_SB(sb).alloc_file->i_mutex); 32 mutex_lock(&HFSPLUS_SB(sb).alloc_file->i_mutex);
33 mapping = HFSPLUS_SB(sb).alloc_file->i_mapping; 33 mapping = HFSPLUS_SB(sb).alloc_file->i_mapping;
34 page = read_mapping_page(mapping, offset / PAGE_CACHE_BITS, NULL); 34 page = read_mapping_page(mapping, offset / PAGE_CACHE_BITS, NULL);
35 if (IS_ERR(page)) {
36 start = size;
37 goto out;
38 }
35 pptr = kmap(page); 39 pptr = kmap(page);
36 curr = pptr + (offset & (PAGE_CACHE_BITS - 1)) / 32; 40 curr = pptr + (offset & (PAGE_CACHE_BITS - 1)) / 32;
37 i = offset % 32; 41 i = offset % 32;
@@ -73,6 +77,10 @@ int hfsplus_block_allocate(struct super_block *sb, u32 size, u32 offset, u32 *ma
73 break; 77 break;
74 page = read_mapping_page(mapping, offset / PAGE_CACHE_BITS, 78 page = read_mapping_page(mapping, offset / PAGE_CACHE_BITS,
75 NULL); 79 NULL);
80 if (IS_ERR(page)) {
81 start = size;
82 goto out;
83 }
76 curr = pptr = kmap(page); 84 curr = pptr = kmap(page);
77 if ((size ^ offset) / PAGE_CACHE_BITS) 85 if ((size ^ offset) / PAGE_CACHE_BITS)
78 end = pptr + PAGE_CACHE_BITS / 32; 86 end = pptr + PAGE_CACHE_BITS / 32;
@@ -120,6 +128,10 @@ found:
120 offset += PAGE_CACHE_BITS; 128 offset += PAGE_CACHE_BITS;
121 page = read_mapping_page(mapping, offset / PAGE_CACHE_BITS, 129 page = read_mapping_page(mapping, offset / PAGE_CACHE_BITS,
122 NULL); 130 NULL);
131 if (IS_ERR(page)) {
132 start = size;
133 goto out;
134 }
123 pptr = kmap(page); 135 pptr = kmap(page);
124 curr = pptr; 136 curr = pptr;
125 end = pptr + PAGE_CACHE_BITS / 32; 137 end = pptr + PAGE_CACHE_BITS / 32;
diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c
index ba117c445e78..f6874acb2cf2 100644
--- a/fs/hfsplus/catalog.c
+++ b/fs/hfsplus/catalog.c
@@ -168,6 +168,11 @@ int hfsplus_find_cat(struct super_block *sb, u32 cnid,
168 return -EIO; 168 return -EIO;
169 } 169 }
170 170
171 if (be16_to_cpu(tmp.thread.nodeName.length) > 255) {
172 printk(KERN_ERR "hfs: catalog name length corrupted\n");
173 return -EIO;
174 }
175
171 hfsplus_cat_build_key_uni(fd->search_key, be32_to_cpu(tmp.thread.parentID), 176 hfsplus_cat_build_key_uni(fd->search_key, be32_to_cpu(tmp.thread.parentID),
172 &tmp.thread.nodeName); 177 &tmp.thread.nodeName);
173 return hfs_brec_find(fd); 178 return hfs_brec_find(fd);
diff --git a/fs/hfsplus/options.c b/fs/hfsplus/options.c
index 9997cbf8beb5..9699c56d323f 100644
--- a/fs/hfsplus/options.c
+++ b/fs/hfsplus/options.c
@@ -25,7 +25,7 @@ enum {
25 opt_force, opt_err 25 opt_force, opt_err
26}; 26};
27 27
28static match_table_t tokens = { 28static const match_table_t tokens = {
29 { opt_creator, "creator=%s" }, 29 { opt_creator, "creator=%s" },
30 { opt_type, "type=%s" }, 30 { opt_type, "type=%s" },
31 { opt_umask, "umask=%o" }, 31 { opt_umask, "umask=%o" },
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index e834e578c93f..eb74531a0a8e 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -356,7 +356,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
356 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { 356 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
357 printk(KERN_WARNING "hfs: Filesystem is marked locked, mounting read-only.\n"); 357 printk(KERN_WARNING "hfs: Filesystem is marked locked, mounting read-only.\n");
358 sb->s_flags |= MS_RDONLY; 358 sb->s_flags |= MS_RDONLY;
359 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) { 359 } else if ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) && !(sb->s_flags & MS_RDONLY)) {
360 printk(KERN_WARNING "hfs: write access to a journaled filesystem is not supported, " 360 printk(KERN_WARNING "hfs: write access to a journaled filesystem is not supported, "
361 "use the force option at your own risk, mounting read-only.\n"); 361 "use the force option at your own risk, mounting read-only.\n");
362 sb->s_flags |= MS_RDONLY; 362 sb->s_flags |= MS_RDONLY;