Fix 'flush_old_exec()/setup_new_exec()' split
Linus Torvalds authored
Commit 221af7f8

 ("Split 'flush_old_exec' into two functions") split
the function at the point of no return - ie right where there were no
more error cases to check.  That made sense from a technical standpoint,
but when we then also combined it with the actual personality setting
going in between flush_old_exec() and setup_new_exec(), it needs to be a
bit more careful.

In particular, we need to make sure that we really flush the old
personality bits in the 'flush' stage, rather than later in the 'setup'
stage, since otherwise we might be flushing the _new_ personality state
that we're just setting up.

So this moves the flags and personality flushing (and 'flush_thread()',
which is the arch-specific function that generally resets lazy FP state
etc) of the old process into flush_old_exec(), so that it doesn't affect
any state that execve() is setting up for the new process environment.

This was reported by Michal Simek as breaking his Microblaze qemu
environment.
Reported-and-tested-by: default avatarMichal Simek <michal.simek@petalogix.com>
Cc: Peter Anvin <hpa@zytor.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
7ab02af4
Name Last commit Last update
..
9p fix oops in fs/9p late mount failure
adfs adfs: remove redundant test on unsigned
affs fix affs parse_options()
afs afs: remove manual O_SYNC handling
autofs trivial: remove unnecessary semicolons
autofs4 autofs4: always use lookup for lookup
befs fs: Make unload_nls() NULL pointer safe
bfs Fix failure exits in bfs_fill_super()
btrfs Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
cachefiles Untangling ima mess, part 2: deal with counters
cifs CIFS shouldn't make mountpoints shrinkable
coda sysctl: Drop & in front of every proc_handler.
configfs Fix configfs leak
cramfs fs/cramfs: return f_fsid for statfs(2)
debugfs get rid of pointless checks after simple_pin_fs()
devpts devpts_get_tty() should validate inode
dlm Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm
ecryptfs ecryptfs: use after free
efs get rid of BKL in fs/efs
exofs exofs: simple_write_end does not mark_inode_dirty
exportfs nfs: new subdir Documentation/filesystems/nfs
ext2 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
ext3 ext3: Replace lock/unlock_super() with an explicit lock for resizing
ext4 ext4: Drop EXT4_GET_BLOCKS_UPDATE_RESERVE_SPACE flag
fat Merge git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6
freevxfs
fscache
fuse
gfs2
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs
isofs
jbd
jbd2
jffs2
jfs
lockd
minix
ncpfs
nfs
nfs_common
nfsd
nilfs2
nls
notify
ntfs
ocfs2
omfs
openpromfs
partitions
proc
qnx4
quota
ramfs
reiserfs
romfs
smbfs
squashfs
sysfs
sysv
ubifs
udf
ufs
xfs
Kconfig
Kconfig.binfmt
Makefile
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c
block_dev.c
buffer.c
char_dev.c
compat.c
compat_binfmt_elf.c
compat_ioctl.c
dcache.c
dcookies.c
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c
fcntl.c
fifo.c
file.c
file_table.c
filesystems.c
fs-writeback.c
fs_struct.c
generic_acl.c
inode.c
internal.h
ioctl.c
ioprio.c
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
read_write.c
read_write.h
readdir.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
super.c
sync.c
timerfd.c
utimes.c
xattr.c
xattr_acl.c