linux/fs
David Howells aa289b4723 [PATCH] FDPIC: fix the /proc/pid/stat representation of executable boundaries
Fix the /proc/pid/stat representation of executable boundaries.  It should
show the bounds of the executable, but instead shows the bounds of the
loader.

Before the patch is applied, the bug can be seen by examining, say, inetd:

	# ps | grep inetd
	  610         root          0   S   /usr/sbin/inetd -i
	# cat /proc/610/maps
	c0bb0000-c0bba788 r-xs 00000000 00:0b 14582157  /lib/ld-uClibc-0.9.28.so
	c3180000-c31dede4 r-xs 00000000 00:0b 14582179  /lib/libuClibc-0.9.28.so
	c328c000-c328ea00 rw-p 00008000 00:0b 14582157  /lib/ld-uClibc-0.9.28.so
	c3290000-c329b6c0 rw-p 00000000 00:00 0
	c32a0000-c32c0000 rwxp 00000000 00:00 0
	c32d4000-c32d8000 rw-p 00000000 00:00 0
	c3394000-c3398000 rw-p 00000000 00:00 0
	c3458000-c345f464 r-xs 00000000 00:0b 16384612  /usr/sbin/inetd
	c3470000-c34748f8 rw-p 00004000 00:0b 16384612  /usr/sbin/inetd
	c34cc000-c34d0000 rw-p 00000000 00:00 0
	c34d4000-c34d8000 rw-p 00000000 00:00 0
	c34d8000-c34dc000 rw-p 00000000 00:00 0
	# cat /proc/610/stat
	610 (inetd) S 1 610 610 0 -1 256 0 0 0 0 0 8 0 0 19 0 1 0 94392000718
	950272 0 4294967295 3233480704 3233523592 3274440352 3274439976
 	3273467584 0 0 4096 90115 3221712796 0 0 17 0 0 0 0

The code boundaries are 3233480704 to 3233523592, which are:

	(gdb) p/x 3233480704
	$1 = 0xc0bb0000
	(gdb) p/x 3233523592
	$2 = 0xc0bba788

Which corresponds to this line in the maps file:

	c0bb0000-c0bba788 r-xs 00000000 00:0b 14582157  /lib/ld-uClibc-0.9.28.so

Which is wrong.  After the patch is applied, the maps file is pretty much
identical (there's some minor shuffling of the location of some of the
anonymous VMAs), but the stat file is now:

	# cat /proc/610/stat
	610 (inetd) S 1 610 610 0 -1 256 0 0 0 0 0 7 0 0 18 0 1 0 94392000722
	950272 0 4294967295 3276111872 3276141668 3274440352 3274439976
	3273467584 0 0 4096 90115 3221712796 0 0 17 0 0 0 0

The code boundaries are then 3276111872 to 3276141668, which are:

	(gdb) p/x 3276111872
	$1 = 0xc3458000
	(gdb) p/x 3276141668
	$2 = 0xc345f464

And these correspond to this line in the maps file instead:

	c3458000-c345f464 r-xs 00000000 00:0b 16384612  /usr/sbin/inetd

Which is now correct.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-03-23 11:01:21 -07:00
..
9p 9p: implement optional loose read cache 2007-02-18 10:16:10 -06:00
adfs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
affs [PATCH] affs: implement ->drop_inode 2007-02-20 17:10:15 -08:00
afs [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
autofs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
autofs4 [PATCH] autofs4: check for directory re-create in lookup 2007-02-20 17:10:15 -08:00
befs [PATCH] mark struct inode_operations const 1 2007-02-12 09:48:46 -08:00
bfs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
cifs Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 2007-03-22 19:47:09 -07:00
coda [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
configfs configfs: add missing mutex_unlock() 2007-03-14 14:37:21 -07:00
cramfs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
debugfs debugfs: Remove misleading comments. 2007-02-16 15:19:17 -08:00
devpts [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
dlm [DLM] fs/dlm/user.c should #include "user.h" 2007-03-07 13:58:21 -05:00
ecryptfs [PATCH] eCryptfs: fix possible NULL ptr deref in ecryptfs_d_release() 2007-03-16 19:25:05 -07:00
efs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
exportfs
ext2 [PATCH] ext[234]: update documentation 2007-02-20 17:10:14 -08:00
ext3 [PATCH] ext[34]: EA block reference count racing fix 2007-03-01 14:53:38 -08:00
ext4 [PATCH] ext[34]: EA block reference count racing fix 2007-03-01 14:53:38 -08:00
fat [PATCH] FAT: DIO-write fallback to normal buffered 2007-02-20 17:10:14 -08:00
freevxfs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
fuse [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
gfs2 [GFS2] Fix bz 229873, alternate test: assertion "!ip->i_inode.i_mapping->nrpages" failed 2007-03-07 14:03:53 -05:00
hfs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
hfsplus [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
hostfs [PATCH] uml: hostfs: make hostfs= option work as a jail, as intended. 2007-03-08 07:38:21 -08:00
hpfs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
hppfs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
hugetlbfs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
isofs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
jbd
jbd2
jffs2 [JFFS2] print a message when marking bad block 2007-03-09 12:29:39 +00:00
jfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6 2007-02-26 11:44:51 -08:00
lockd Replace remaining references to "driverfs" with "sysfs". 2007-02-17 19:13:42 +01:00
minix [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
msdos [PATCH] mark struct inode_operations const 2 2007-02-12 09:48:46 -08:00
ncpfs ncpfs: make sure server connection survives a kill 2007-03-06 13:26:27 +01:00
nfs [PATCH] nfs: nfs_getattr() can't call nfs_sync_mapping_range() for non-regular files 2007-03-16 19:25:06 -07:00
nfs_common
nfsd [PATCH] include of asm/pgtable.h in nfsfh is bogus 2007-03-14 15:27:49 -07:00
nls
ntfs [PATCH] sysctl: remove the proc_dir_entry member for the sysctl tables 2007-02-14 08:10:00 -08:00
ocfs2 ocfs2_dlm: Add missing locks in dlm_empty_lockres 2007-03-14 14:37:35 -07:00
openpromfs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
partitions [PATCH] change misleading EFI partition support description 2007-03-16 19:25:06 -07:00
proc [PATCH] sanitize security_getprocattr() API 2007-03-14 15:27:48 -07:00
qnx4 [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
ramfs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
reiserfs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
romfs [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
smbfs [PATCH] smbfs: double free memory corruption 2007-03-16 19:25:05 -07:00
sysfs [PATCH] sysfs: reinstate exclusion between method calls and attribute unregistration 2007-03-15 15:29:26 -07:00
sysv [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
udf [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
ufs [PATCH] ufs2: tindirect truncate fix 2007-03-16 19:25:03 -07:00
vfat [PATCH] mark struct inode_operations const 3 2007-02-12 09:48:46 -08:00
xfs [PATCH] Make XFS workqueues nonfreezable 2007-03-22 19:39:06 -07:00
aio.c [PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc(). 2007-02-11 10:51:27 -08:00
attr.c
bad_inode.c [PATCH] mark struct inode_operations const 1 2007-02-12 09:48:46 -08:00
binfmt_aout.c
binfmt_elf.c [PATCH] fix process crash caused by randomisation and 64k pages 2007-03-16 19:25:06 -07:00
binfmt_elf_fdpic.c [PATCH] FDPIC: fix the /proc/pid/stat representation of executable boundaries 2007-03-23 11:01:21 -07:00
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
binfmt_script.c
binfmt_som.c
bio.c
block_dev.c [PATCH] lockdep: annotate BLKPG_DEL_PARTITION 2007-02-20 17:10:16 -08:00
buffer.c [PATCH] fs: nobh_truncate_page() fix 2007-03-06 09:30:25 -08:00
char_dev.c [PATCH] rework reserved major handling 2007-02-20 17:10:13 -08:00
compat.c [PATCH] Add epoll compat_ code to fs/compat.c 2007-03-08 07:38:22 -08:00
compat_ioctl.c
dcache.c Revert "[PATCH] Fix d_path for lazy unmounts" 2007-02-13 12:08:18 -08:00
dcookies.c
direct-io.c
dnotify.c
dquot.c [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
drop_caches.c [PATCH] remove invalidate_inode_pages() 2007-02-11 10:51:31 -08:00
eventpoll.c
exec.c [PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc(). 2007-02-11 10:51:27 -08:00
fcntl.c
fifo.c
file.c
file_table.c
filesystems.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
fs-writeback.c
generic_acl.c
inode.c [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
inotify.c
inotify_user.c [PATCH] inotify: read return val fix 2007-02-12 09:48:28 -08:00
internal.h
ioctl.c
ioprio.c [PATCH] pid: replace do/while_each_task_pid with do/while_each_pid_task 2007-02-12 09:48:32 -08:00
Kconfig Remove JFFS (version 1), as scheduled. 2007-02-17 16:10:59 -05:00
Kconfig.binfmt
libfs.c [PATCH] shmem and simple const super_operations 2007-03-05 07:57:51 -08:00
locks.c
Makefile Remove JFFS (version 1), as scheduled. 2007-02-17 16:10:59 -05:00
mbcache.c
mpage.c
namei.c [PATCH] __page_symlink retry loop error code fix 2007-02-16 08:13:56 -08:00
namespace.c [PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc(). 2007-02-11 10:51:27 -08:00
nfsctl.c
no-block.c
open.c
pipe.c [PATCH] AUDIT_FD_PAIR 2007-02-17 21:30:15 -05:00
pnode.c
pnode.h
posix_acl.c
quota.c
quota_v1.c
quota_v2.c
read_write.c [PATCH] FS: speed up rw_verify_area() 2007-02-12 09:48:29 -08:00
read_write.h
readdir.c
select.c
seq_file.c
splice.c
stack.c [PATCH] fs/stack.c: Copy i_nlink after all other attributes are copied 2007-02-19 14:21:50 -08:00
stat.c
super.c [PATCH] Mark struct super_operations const 2007-02-12 09:48:47 -08:00
sync.c
utimes.c
xattr.c
xattr_acl.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00