Amerigo Wang ec81aecb29 hfs: fix a potential buffer overflow
A specially-crafted Hierarchical File System (HFS) filesystem could cause
a buffer overflow to occur in a process's kernel stack during a memcpy()
call within the hfs_bnode_read() function (at fs/hfs/bnode.c:24).  The
attacker can provide the source buffer and length, and the destination
buffer is a local variable of a fixed length.  This local variable (passed
as "&entry" from fs/hfs/dir.c:112 and allocated on line 60) is stored in
the stack frame of hfs_bnode_read()'s caller, which is hfs_readdir().
Because the hfs_readdir() function executes upon any attempt to read a
directory on the filesystem, it gets called whenever a user attempts to
inspect any filesystem contents.

[amwang@redhat.com: modify this patch and fix coding style problems]
Signed-off-by: WANG Cong <amwang@redhat.com>
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: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-15 08:53:10 -08:00
..
2009-06-11 21:36:14 -04:00
2009-12-10 15:02:50 +01:00
2009-07-12 12:22:34 -07:00
2009-06-17 00:36:36 -04:00
2009-12-10 09:59:23 +02:00
2009-07-12 12:22:34 -07:00
2009-12-03 12:00:12 +00:00
2009-12-15 08:53:10 -08:00
2009-07-12 12:22:34 -07:00
2009-09-24 08:41:47 -04:00
2009-06-17 00:36:37 -04:00
2009-12-14 21:40:04 +01:00
2009-06-18 13:03:46 -07:00
2009-09-24 08:41:47 -04:00
2008-12-31 18:07:43 -05:00
2009-01-03 11:45:54 -08:00
2009-09-24 07:21:03 -07:00
2009-12-03 12:03:40 +05:30
2009-03-31 23:00:26 -04:00
2009-04-07 08:31:16 -07:00
2009-10-22 08:11:44 +09:00
2009-10-04 15:05:10 -07:00
2009-04-20 23:02:52 -04:00
2009-12-10 15:02:50 +01:00
2009-02-18 15:37:53 -08:00