diff options
author | Andrew Morton <akpm@osdl.org> | 2003-11-18 08:16:33 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-11-18 08:16:33 -0800 |
commit | 0693b7686f5bf84dfd4284381449bb1bd96d8ff6 (patch) | |
tree | 66d2bf1b66a2eef7e4fff1d8ebab92bd29dde139 /fs/ext3/xattr.c | |
parent | d174dc0658cfe05ba8b934578582a5668240afdc (diff) | |
download | history-0693b7686f5bf84dfd4284381449bb1bd96d8ff6.tar.gz |
[PATCH] fs/ext[23]/xattr.c pointer arithmetic fix
From: Andreas Gruenbacher <agruen@suse.de>
64-bit pointer arithmetic bug in xattr code
The int offset is not enought to hold the difference between arbitraty
pointers on 64-bit machines. Compute the offset of here and last inside
HDR(bh) instead.
Diffstat (limited to 'fs/ext3/xattr.c')
-rw-r--r-- | fs/ext3/xattr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c index b60885711a3d3e..323e79729b9a1d 100644 --- a/fs/ext3/xattr.c +++ b/fs/ext3/xattr.c @@ -629,9 +629,10 @@ bad_block: ext3_error(sb, "ext3_xattr_set", goto cleanup; memcpy(header, HDR(bh), bh->b_size); header->h_refcount = cpu_to_le32(1); - offset = (char *)header - bh->b_data; - here = ENTRY((char *)here + offset); - last = ENTRY((char *)last + offset); + offset = (char *)here - bh->b_data; + here = ENTRY((char *)header + offset); + offset = (char *)last - bh->b_data; + last = ENTRY((char *)header + offset); } } else { /* Allocate a buffer where we construct the new block. */ |