Re: Redzone overwritten with CONFIG_SECURITY

From: Chris Wright
Date: Sat May 31 2008 - 19:24:39 EST


* Chris Wright (chrisw@xxxxxxxxxxxx) wrote:
> * Eric Sesterhenn (snakebyte@xxxxxx) wrote:
> > Is it possible that this was caused because a file didnt
> > get rebuild correctly? I can still reproduce it with the
> > old checkout. Sorry if this causes unessecary noise :(
>
> I had wondered that, since data structures will grow w/ CONFIG_SECURITY
> set (like inode, for example). I haven't encountered a Kbuild dependency
> bug in quite a while though.

Yeah, this thing is miscompiled (thanks for the vmlinux).

$ cd /tmp/CONFIG_SECURITY-mem-corruption
$ gdb -q vmlinux
(gdb) p sizeof(struct inode)
$1 = 596
(gdb) p sizeof(struct hugetlbfs_inode_info)
$2 = 592

struct hugetlbfs_inode_info {
struct shared_policy policy;
struct inode vfs_inode;
};

The hugetlbfs_inode_info structure isn't updated with the 4 extra bytes
added from CONFIG_SECURITY to struct inode.

If you're interested in more gory details, you can look at:
$ eu-readelf -winfo vmlinux > readelf-info.out

thanks,
-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/