Description of problem: 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.
Created attachment 373294 [details] patch for rhel-5
Created attachment 373295 [details] patch for kernel 2.6.31.6
The patch has been added to the -mm tree: http://marc.info/?l=linux-mm-commits&m=125987755823047&w=2
Upstream commit: http://git.kernel.org/linus/ec81aecb29668ad71f699f4e7b96ec46691895b6
Fixed in 2.6.32.2, 2.6.31.9 and 2.6.27.42: hfs-fix-a-potential-buffer-overflow.patch
This issue has been addressed in following products: Red Hat Enterprise Linux 5 Via RHSA-2010:0046 https://rhn.redhat.com/errata/RHSA-2010-0046.html
We don't have hfs or hfs+ enabled in RHEL6.
This issue has been addressed in following products: Red Hat Enterprise Linux 4 Via RHSA-2010:0076 https://rhn.redhat.com/errata/RHSA-2010-0076.html