diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-04 15:09:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-07 11:56:50 -0400 |
commit | 8792953929b01e82e57bce07cc717a0bf24384bc (patch) | |
tree | a3466b047caff23610fbf0cd5b858aa21138dc22 /fs/hfsplus/catalog.c | |
parent | 7bfac470b517b18d496e96acc90be58353df2159 (diff) |
hfsplus: Fix potential buffer overflows
commit 6f24f892871acc47b40dd594c63606a17c714f77 upstream.
Commit ec81aecb2966 ("hfs: fix a potential buffer overflow") fixed a few
potential buffer overflows in the hfs filesystem. But as Timo Warns
pointed out, these changes also need to be made on the hfsplus
filesystem as well.
Reported-by: Timo Warns <warns@pre-sense.de>
Acked-by: WANG Cong <amwang@redhat.com>
Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Sage Weil <sage@newdream.net>
Cc: Eugene Teo <eteo@redhat.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Dave Anderson <anderson@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hfsplus/catalog.c')
-rw-r--r-- | fs/hfsplus/catalog.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c index b4ba1b31933..408073ae7a2 100644 --- a/fs/hfsplus/catalog.c +++ b/fs/hfsplus/catalog.c | |||
@@ -360,6 +360,10 @@ int hfsplus_rename_cat(u32 cnid, | |||
360 | err = hfs_brec_find(&src_fd); | 360 | err = hfs_brec_find(&src_fd); |
361 | if (err) | 361 | if (err) |
362 | goto out; | 362 | goto out; |
363 | if (src_fd.entrylength > sizeof(entry) || src_fd.entrylength < 0) { | ||
364 | err = -EIO; | ||
365 | goto out; | ||
366 | } | ||
363 | 367 | ||
364 | hfs_bnode_read(src_fd.bnode, &entry, src_fd.entryoffset, | 368 | hfs_bnode_read(src_fd.bnode, &entry, src_fd.entryoffset, |
365 | src_fd.entrylength); | 369 | src_fd.entrylength); |