e2fsprogs/lib/ext2fs
Stephen Tweedie 39c191f5b3 ext2fs_resize_mem() is suffering from C99 strict type aliasing problems.
The trouble is that it is modifying pointers in place, but doing so via
"void *" types which alias the pointers passed in (which are typically
pointers to a struct.)  The inline ext2fs_resize_mem() code may update
the pointer, but the caller is not required to reload the old value it
may have cached in a register, according to the type aliasing rules.

This is causing the caller to dereference the old pointer when compiled
with -O2, resulting in reproducible SEGV, on at least one ia64
configuration.

The compiler *is* required to reload if it sees an update to a dereferenced
char value, though, as chars are defined to alias anything; and memcpy()
is defined to operate on chars.  So using memcpy() to copy the pointer
values is guaranteed to force the caller to reload.  This has been 
verified to fix the problem in practice.

Fixes Red Hat bug #161183.
2005-06-27 11:47:21 -04:00
..
ChangeLog ext2fs_resize_mem() is suffering from C99 strict type aliasing problems. 2005-06-27 11:47:21 -04:00
Makefile.in Update "make depend" information. Fixes SMP parallel build problem. 2005-05-06 09:37:58 -04:00
Makefile.pq Many files: 1997-11-14 05:23:04 +00:00
alloc.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
alloc_sb.c Add support for on-line resizing ala the resize inode. This patch 2004-12-15 14:39:16 -05:00
alloc_stats.c Fix bug where ext2fs_mkdir wasn't correctly bumping the number of 2002-02-03 01:28:52 -05:00
alloc_tables.c Add support for the meta_bg feature flag to the resize2fs program. 2002-10-30 23:07:21 -05:00
badblocks.c ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem() 2003-08-01 09:41:07 -04:00
bb_compat.c Many files: 2001-05-14 11:35:52 +00:00
bb_inode.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
bitmaps.c ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem() 2003-08-01 09:41:07 -04:00
bitops.c Drop the sparc assembly bitwise operations; it's less efficient 2005-02-03 21:56:44 -05:00
bitops.h Drop the sparc assembly bitwise operations; it's less efficient 2005-02-03 21:56:44 -05:00
block.c Fix resize inode handling on big endian systems, by adding new routines 2005-01-06 00:04:24 -05:00
bmap.c ext2fs.h (BMAP_SET), bmap.c (ext2fs_bmap): Add support for new 2004-12-23 13:55:34 -05:00
bmove.c ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem() 2003-08-01 09:41:07 -04:00
brel.h Many files: 2001-01-11 04:54:39 +00:00
brel_ma.c ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem() 2003-08-01 09:41:07 -04:00
check_desc.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
closefs.c sparse.c (ext2fs_list_backups, ext2fs_bg_has_super), 2004-12-15 18:06:52 -05:00
cmp_bitmaps.c Many files: 2001-05-14 11:35:52 +00:00
dblist.c ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem() 2003-08-01 09:41:07 -04:00
dblist_dir.c ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem() 2003-08-01 09:41:07 -04:00
dir_iterate.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
dirblock.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
dirhash.c Fix gcc -Wall nits. 2003-01-25 00:26:48 -05:00
dosio.c ChangeLog, wordwrap.pl: 2001-06-01 23:49:46 +00:00
dosio.h Many files: 1997-08-11 20:29:22 +00:00
dupfs.c dupfs.c (ext2fs_dup_handle): Make sure the new filesystem handle 2005-01-05 03:16:09 -05:00
e2image.h Many files: 2001-05-03 04:02:29 +00:00
expanddir.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
ext2_err.et.in ext2fs.h (BMAP_SET), bmap.c (ext2fs_bmap): Add support for new 2004-12-23 13:55:34 -05:00
ext2_ext_attr.h Integrate code from Alex Thomas at Clusterfs to check extended attributes 2005-03-21 13:15:45 -05:00
ext2_fs.h Add library support for large (EA in inode) inodes. Make sure that garbage 2005-01-25 23:42:56 -05:00
ext2_io.h Add support for passing options to the io layer using the URL syntax. For 2004-11-30 14:07:11 -05:00
ext2_types.h.in Use C99 stdint.h types instead of custom types in the uuid library. 2004-04-03 10:20:26 -05:00
ext2fs.h ext2fs_resize_mem() is suffering from C99 strict type aliasing problems. 2005-06-27 11:47:21 -04:00
ext2fs.pc.in Add pkg-config files to e2fsprogs's libraries. 2005-01-26 12:59:25 -05:00
ext2fsP.h Add support to e2fsck to reindex directories to use hash trees. 2002-07-20 00:28:07 -04:00
ext_attr.c Add library support for large (EA in inode) inodes. Make sure that garbage 2005-01-25 23:42:56 -05:00
fileio.c Add support for backing up the journal inode location in the 2003-08-21 00:40:26 -04:00
finddev.c finddev.c (scan_dir): Fix memory leak; we weren't calling 2001-07-29 12:01:09 -04:00
flushb.c Re-add FreeBSD support. 2003-12-28 18:21:26 +01:00
freefs.c Add support for passing options to the io layer using the URL syntax. For 2004-11-30 14:07:11 -05:00
gen_bitmap.c ChangeLog, Makefile.in, bitops.h, gen_bitmap.c: 2001-06-11 15:17:45 +00:00
get_pathname.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
getsectsize.c getsectsize.c (BLKSSZGET): Clean up test for when to manually 2005-06-19 23:11:09 -04:00
getsize.c getsize.c (ext2fs_get_device_size): Check to see if the number 2005-03-18 20:11:59 -05:00
icount.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
imager.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
ind_block.c Add missing return values in error return cases in the ext2fs library. 2005-04-09 01:21:21 -04:00
initialize.c Clean up resize inode routines in ext2fs library. We no longer print 2004-12-23 07:45:04 -05:00
inline.c Many files: 2001-05-14 11:35:52 +00:00
inode.c Add missing return values in error return cases in the ext2fs library. 2005-04-09 01:21:21 -04:00
inode_io.c Add support for backing up the journal inode location in the 2003-08-21 00:40:26 -04:00
io_manager.c Add support for passing options to the io layer using the URL syntax. For 2004-11-30 14:07:11 -05:00
irel.h Many files: 2001-01-11 04:54:39 +00:00
irel_ma.c ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem() 2003-08-01 09:41:07 -04:00
ismounted.c On Linux 2.6 systems, mke2fs and badblocks will check to see whether 2005-06-05 16:05:22 -04:00
jfs_compat.h Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
jfs_dat.h ChangeLog, Makefile.in, ext2_err.et.in, ext2fs.h, jfs_dat.h, mkjournal.c: 2000-10-24 18:33:16 +00:00
jfs_user.h Move linux/jbd.h to ext2fs/kernel-jbd.h, to avoid using the 2001-12-23 19:33:51 -05:00
kernel-jbd.h Fixx gcc -Wall nitpicks. 2003-07-06 00:36:48 -04:00
kernel-list.h Lots of small random portability fixes to make e2fsprogs build 2002-02-12 02:34:44 -05:00
link.c link.c (ext2fs_link): When adding a new link to a directory, 2002-07-29 19:26:33 -04:00
llseek.c On non-linux systems, use lseek64() if it is present in 2004-09-17 17:47:12 -04:00
lookup.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
mkdir.c Fix e2fsck, debugfs, and the ext2fs_mkdir function so that when we create 2005-03-20 20:05:22 -05:00
mkjournal.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
namei.c Fix libext2fs and debugfs to correctly deal with symlinks that have 2004-02-21 20:54:31 -05:00
native.c ChangeLog, Makefile.in, swapfs.c, unix.c: 2001-06-11 07:00:04 +00:00
newdir.c ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem() 2003-08-01 09:41:07 -04:00
nt_io.c Many files: 2001-05-14 11:35:52 +00:00
openfs.c Add support for passing options to the io layer using the URL syntax. For 2004-11-30 14:07:11 -05:00
read_bb.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
read_bb_file.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
res_gdt.c Create the resize inode is created even if the s_reserved_gdt_blocks is 2005-01-27 18:47:51 -05:00
rs_bitmap.c ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem() 2003-08-01 09:41:07 -04:00
rw_bitmaps.c Add ability for debugfs to use a separate source of data blocks when 2004-07-28 21:11:48 -04:00
sparse.c Add support for on-line resizing ala the resize inode. This patch 2004-12-15 14:39:16 -05:00
swapfs.c Add library support for large (EA in inode) inodes. Make sure that garbage 2005-01-25 23:42:56 -05:00
test_io.c Fix bug in the secure getenv function so that the ss library will corrently 2005-05-08 02:15:02 -04:00
tst_badblocks.c Fix bug in resize2fs which caused it to fail on filesystems with a 2003-06-24 17:34:02 -04:00
tst_bitops.c Add new functions to bitops.h to find quickly search for set bits in 2001-07-04 14:04:58 -04:00
tst_byteswap.c Fix various gcc -Wall complaints. 2002-03-07 23:52:56 -05:00
tst_getsectsize.c mke2fs.c (PRS, set_fs_defaults): If the sector size of the 2003-05-21 17:28:29 -04:00
tst_getsize.c Many files: 2001-05-14 11:35:52 +00:00
tst_iscan.c ChangeLog, dumpe2fs.c, mke2fs.c: 2001-06-13 00:12:04 +00:00
unix_io.c Add support for passing options to the io layer using the URL syntax. For 2004-11-30 14:07:11 -05:00
unlink.c Ex2fs_unlink() will return an error if both the name and inode number are 2005-01-07 22:09:49 -05:00
valid_blk.c valid_blk.c (ext2fs_inode_has_valid_blocks): Fix bug which 2002-08-20 01:14:30 -04:00
version.c Update version to 1.36-rc1, and change parsing algorithm for version strings 2005-01-06 23:52:45 -05:00
write_bb_file.c Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00