linux-stable-rt/fs
Jiri Kosina c1d171a002 x86: randomize brk
Randomize the location of the heap (brk) for i386 and x86_64.  The range is
randomized in the range starting at current brk location up to 0x02000000
offset for both architectures.  This, together with
pie-executable-randomization.patch and
pie-executable-randomization-fix.patch, should make the address space
randomization on i386 and x86_64 complete.

Arjan says:

This is known to break older versions of some emacs variants, whose dumper
code assumed that the last variable declared in the program is equal to the
start of the dynamically allocated memory region.

(The dumper is the code where emacs effectively dumps core at the end of it's
compilation stage; this coredump is then loaded as the main program during
normal use)

iirc this was 5 years or so; we found this way back when I was at RH and we
first did the security stuff there (including this brk randomization).  It
wasn't all variants of emacs, and it got fixed as a result (I vaguely remember
that emacs already had code to deal with it for other archs/oses, just
ifdeffed wrongly).

It's a rare and wrong assumption as a general thing, just on x86 it mostly
happened to be true (but to be honest, it'll break too if gcc does
something fancy or if the linker does a non-standard order).  Still its
something we should at least document.

Note 2: afaik it only broke the emacs *build*.  I'm not 100% sure about that
(it IS 5 years ago) though.

[ akpm@linux-foundation.org: deuglification ]

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Roland McGrath <roland@redhat.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-01-30 13:30:40 +01:00
..
9p
adfs
affs
afs vfs: Add 64 bit i_version support 2008-01-28 23:58:27 -05:00
autofs
autofs4
befs
bfs
cifs [CIFS] DFS build fixes 2008-01-25 10:12:41 +00:00
coda
configfs configfs: file.c fix possible recursive locking 2008-01-25 15:05:47 -08:00
cramfs
debugfs
devpts
dlm
ecryptfs [NETNS]: Consolidate kernel netlink socket destruction. 2008-01-28 15:08:07 -08:00
efs
exportfs
ext2 ext2: Fix the max file size for ext2 file system. 2008-01-28 23:58:26 -05:00
ext3 ext3: Fix the max file size for ext3 file system. 2008-01-28 23:58:26 -05:00
ext4 ext4: Use the ext4_ext_actual_len() helper function 2008-01-28 23:58:27 -05:00
fat
freevxfs
fuse
gfs2 Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw 2008-01-25 08:39:18 -08:00
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs
isofs
jbd
jbd2 jbd2: sparse pointer use of zero as null 2008-01-28 23:58:27 -05:00
jffs2
jfs
lockd NLM: Fix a bogus 'return' in nlmclnt_rpc_release 2008-01-30 02:06:08 -05:00
minix
msdos
ncpfs
nfs NFSv4: Iterate through all nfs_clients when the server recalls a delegation 2008-01-30 02:06:12 -05:00
nfs_common
nfsd
nls
ntfs
ocfs2 ocfs2: Fix userspace ABI breakage in sysfs 2008-01-28 19:10:23 -08:00
openpromfs
partitions
proc [ATM]: Oops reading net/atm/arp 2008-01-28 15:01:36 -08:00
qnx4
ramfs
reiserfs
romfs
smbfs FS: Remove dead code 2008-01-28 23:14:37 +01:00
sysfs Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-01-25 17:19:08 -08:00
sysv
udf
ufs
vfat
xfs
Kconfig ext4: Add the journal checksum feature 2008-01-28 23:58:27 -05:00
Kconfig.binfmt
Makefile
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c x86: randomize brk 2008-01-30 13:30:40 +01:00
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio.c __bio_clone: don't calculate hw/phys segment counts 2008-01-28 10:04:46 +01:00
block_dev.c
buffer.c Add buffer head related helper functions 2008-01-28 23:58:26 -05:00
char_dev.c
compat.c
compat_ioctl.c remove __attribute_used__ 2008-01-28 23:21:18 +01:00
dcache.c
dcookies.c
direct-io.c
dnotify.c
dquot.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c
fcntl.c
fifo.c
file.c
file_table.c
filesystems.c
fs-writeback.c
generic_acl.c
inode.c ext4: Add inode version support in ext4 2008-01-28 23:58:27 -05:00
inotify.c
inotify_user.c
internal.h
ioctl.c
ioprio.c cfq-iosched: relax IOPRIO_CLASS_IDLE restrictions 2008-01-28 11:38:15 +01:00
libfs.c
locks.c
mbcache.c
mpage.c
namei.c
namespace.c
nfsctl.c
no-block.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
quota.c
quota_v1.c
quota_v2.c
read_write.c ext4: export iov_shorten from kernel for ext4's use 2008-01-28 23:58:27 -05:00
read_write.h
readdir.c
select.c
seq_file.c
signalfd.c
splice.c splice: fix problem with atime not being updated 2008-01-29 21:55:20 +01:00
stack.c
stat.c
super.c
sync.c
timerfd.c
utimes.c
xattr.c
xattr_acl.c