linux/fs
Al Viro 47e393622b aio_run_iocb(): kill dead check
We check if ->ki_pos is positive.  However, by that point we have
already done rw_verify_area(), which would have rejected such
unless the file had been one of /dev/mem, /dev/kmem and /proc/kcore.
All of which do not have vectored rw methods, so we would've bailed
out even earlier.

This check had been introduced before rw_verify_area() had been added there
- in fact, it was a subset of checks done on sync paths by rw_verify_area()
(back then the /dev/mem exception didn't exist at all).  The rest of checks
(mandatory locking, etc.) hadn't been added until later.  Unfortunately,
by the time the call of rw_verify_area() got added, the /dev/mem exception
had already appeared, so it wasn't obvious that the older explicit check
downstream had become dead code.  It *is* a dead code, though, since the few
files for which the exception applies do not have ->aio_{read,write}() or
->{read,write}_iter() and for them we won't reach that check anyway.

What's more, even if we ever introduce vectored methods for /dev/mem
and friends, they'll have to cope with negative positions anyway, since
readv(2) and writev(2) are using the same checks as read(2) and write(2) -
i.e. rw_verify_area().

Let's bury it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11 22:27:55 -04:00
..
9p Merge branch 'iocb' into for-next 2015-04-11 22:24:41 -04:00
adfs
affs Merge branch 'iocb' into for-davem 2015-04-09 00:01:38 -04:00
afs Merge remote-tracking branch 'dh/afs' into for-davem 2015-04-11 15:51:09 -04:00
autofs4 autofs4 copy_dev_ioctl(): keep the value of ->size we'd used for allocation 2015-02-22 11:43:34 -05:00
befs
bfs fs: move struct kiocb to fs.h 2015-03-25 20:28:11 -04:00
btrfs Merge branch 'iocb' into for-next 2015-04-11 22:24:41 -04:00
cachefiles Cachefiles: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions 2015-02-22 11:38:41 -05:00
ceph Merge branch 'iocb' into for-next 2015-04-11 22:24:41 -04:00
cifs Fix warning 2015-04-01 00:01:47 -05:00
coda VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) 2015-02-22 11:38:41 -05:00
configfs configfs: Fix potential NULL d_inode dereference 2015-02-20 04:56:43 -05:00
cramfs
debugfs debugfs: leave freeing a symlink body until inode eviction 2015-02-22 11:38:43 -05:00
devpts
dlm
ecryptfs Merge branch 'iocb' into for-next 2015-04-11 22:24:41 -04:00
efivarfs
efs
exofs
exportfs VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) 2015-02-22 11:38:41 -05:00
ext2 fs: move struct kiocb to fs.h 2015-03-25 20:28:11 -04:00
ext3 fs: move struct kiocb to fs.h 2015-03-25 20:28:11 -04:00
ext4 Merge branch 'iocb' into for-next 2015-04-11 22:24:41 -04:00
f2fs fs: move struct kiocb to fs.h 2015-03-25 20:28:11 -04:00
fat fs: move struct kiocb to fs.h 2015-03-25 20:28:11 -04:00
freevxfs
fscache
fuse expand __fuse_direct_write() in both callers 2015-04-11 22:27:53 -04:00
gfs2 Merge branch 'iocb' into for-next 2015-04-11 22:24:41 -04:00
hfs fs: move struct kiocb to fs.h 2015-03-25 20:28:11 -04:00
hfsplus Merge branch 'iocb' into for-next 2015-04-11 22:24:41 -04:00
hostfs
hpfs
hppfs VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) 2015-02-22 11:38:41 -05:00
hugetlbfs
isofs
jbd
jbd2
jffs2 Merge branch 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-02-22 17:42:14 -08:00
jfs fs: move struct kiocb to fs.h 2015-03-25 20:28:11 -04:00
kernfs kernfs: handle poll correctly on 'direct_read' files. 2015-03-16 21:51:20 +01:00
lockd
logfs
minix
ncpfs
nfs Merge branch 'iocb' into for-next 2015-04-11 22:24:41 -04:00
nfs_common
nfsd nfsd: require an explicit option to enable pNFS 2015-03-30 16:05:26 -04:00
nilfs2 Merge branch 'iocb' into for-next 2015-04-11 22:24:41 -04:00
nls
notify fanotify: fix event filtering with FAN_ONDIR set 2015-03-12 18:46:08 -07:00
ntfs Merge branch 'iocb' into for-next 2015-04-11 22:24:41 -04:00
ocfs2 Merge branch 'iocb' into for-next 2015-04-11 22:24:41 -04:00
omfs
openpromfs
overlayfs ovl: upper fs should not be R/O 2015-03-18 10:29:48 +01:00
proc pagemap: do not leak physical addresses to non-privileged userspace 2015-03-17 09:31:30 -07:00
pstore
qnx4
qnx6
quota
ramfs
reiserfs Merge branch 'iocb' into for-next 2015-04-11 22:24:41 -04:00
romfs
squashfs
sysfs
sysv
ubifs fs: move struct kiocb to fs.h 2015-03-25 20:28:11 -04:00
udf fs: move struct kiocb to fs.h 2015-03-25 20:28:11 -04:00
ufs
xfs Merge branch 'iocb' into for-next 2015-04-11 22:24:41 -04:00
aio.c aio_run_iocb(): kill dead check 2015-04-11 22:27:55 -04:00
anon_inodes.c
attr.c
bad_inode.c don't bother with most of the bad_file_ops methods 2015-02-20 04:03:58 -05:00
binfmt_aout.c
binfmt_elf.c x86, mm/ASLR: Fix stack randomization on 64-bit systems 2015-02-19 12:21:36 +01:00
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
block_dev.c fs: move struct kiocb to fs.h 2015-03-25 20:28:11 -04:00
buffer.c
char_dev.c
compat.c
compat_binfmt_elf.c
compat_ioctl.c Bluetooth: bnep: Add support for get bnep features via ioctl 2015-04-03 23:21:34 +02:00
coredump.c coredump: Fix typo in comment 2015-02-20 04:56:44 -05:00
dax.c
dcache.c dcache: return -ESTALE not -EBUSY on distributed fs race 2015-04-11 22:24:33 -04:00
dcookies.c
direct-io.c fs: move struct kiocb to fs.h 2015-03-25 20:28:11 -04:00
drop_caches.c
eventfd.c
eventpoll.c
exec.c
fcntl.c
fhandle.c
file.c
file_table.c
filesystems.c
fs-writeback.c fs: add dirtytime_expire_seconds sysctl 2015-03-17 12:23:32 -04:00
fs_pin.c
fs_struct.c
inode.c
internal.h trylock_super(): replacement for grab_super_passive() 2015-02-22 11:38:42 -05:00
ioctl.c
Kconfig
Kconfig.binfmt
libfs.c VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) 2015-02-22 11:38:41 -05:00
locks.c locks: fix file_lock deletion inside loop 2015-03-27 07:18:20 -04:00
Makefile
mbcache.c
mount.h
mpage.c
namei.c remove incorrect comment in lookup_one_len() 2015-04-11 22:24:30 -04:00
namespace.c VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) 2015-02-22 11:38:41 -05:00
no-block.c
nsfs.c
open.c NFS: fix BUG() crash in notify_change() with patch to chown_common() 2015-04-11 22:24:34 -04:00
pipe.c fs: move struct kiocb to fs.h 2015-03-25 20:28:11 -04:00
pnode.c
pnode.h
posix_acl.c VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) 2015-02-22 11:38:41 -05:00
proc_namespace.c
read_write.c switch {compat_,}do_readv_writev() to {compat_,}import_iovec() 2015-04-11 22:27:12 -04:00
readdir.c
select.c
seq_file.c
signalfd.c
splice.c vmsplice_to_user(): switch to import_iovec() 2015-04-11 22:27:11 -04:00
stack.c
stat.c switch security_inode_getattr() to struct path * 2015-04-11 22:24:32 -04:00
statfs.c
super.c trylock_super(): replacement for grab_super_passive() 2015-02-22 11:38:42 -05:00
sync.c
timerfd.c
utimes.c
xattr.c