remarkable-linux/fs
Oleg Drokin 4af4c52f34 [PATCH] Missed error checking for intent's filp in open_namei().
It seems there is error check missing in open_namei for errors returned
through intent.open.file (from lookup_instantiate_filp).

If there is plain open performed, then such a check done inside
__path_lookup_intent_open called from path_lookup_open(), but when the open
is performed with O_CREAT flag set, then __path_lookup_intent_open is only
called with LOOKUP_PARENT set where no file opening can occur yet.

Later on lookup_hash is called where exact opening might take place and
intent.open.file may be filled.  If it is filled with error value of some
sort, then we get kernel attempting to dereference this error value as
address (and corresponding oops) in nameidata_to_filp() called from
filp_open().

While this is relatively simple to workaround in ->lookup() method by just
checking lookup_instantiate_filp() return value and returning error as
needed, this is not so easy in ->d_revalidate(), where we can only return
"yes, dentry is valid" or "no, dentry is invalid, perform full lookup
again", and just returning 0 on error would cause extra lookup (with
potential extra costly RPCs).

So in short, I believe that there should be no difference in error handling
for opening a file and creating a file in open_namei() and propose this
simple patch as a solution.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-25 08:22:51 -08:00
..
9p [PATCH] fs/9p/: possible cleanups 2006-03-24 07:33:21 -08:00
adfs [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
affs [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
afs [PATCH] fs: Use ARRAY_SIZE macro 2006-03-24 07:33:19 -08:00
autofs
autofs4 [PATCH] sem2mutex: autofs4 wq_sem 2006-03-23 07:38:13 -08:00
befs [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
bfs [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
cifs [PATCH] s/;;/;/g 2006-03-24 07:33:24 -08:00
coda [PATCH] cpuset memory spread: slab cache filesystems 2006-03-24 07:33:23 -08:00
configfs [PATCH] BUG_ON() Conversion in fs/configfs/ 2006-02-03 14:03:09 -08:00
cramfs [PATCH] cramfs mounts provide corrupted content since 2.6.15 2006-03-06 18:40:43 -08:00
debugfs [PATCH] debugfs: Add debugfs_create_blob() helper for exporting binary data 2006-03-20 13:42:59 -08:00
devfs
devpts [PATCH] devpts: use lib/parser.c for parsing mount options 2006-03-23 07:38:17 -08:00
efs [PATCH] cpuset memory spread: slab cache filesystems 2006-03-24 07:33:23 -08:00
exportfs
ext2 [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
ext3 [PATCH] ext3: Properly report backup block present in a group 2006-03-24 07:33:30 -08:00
fat [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
freevxfs [PATCH] cpuset memory spread: slab cache filesystems 2006-03-24 07:33:23 -08:00
fuse [PATCH] fuse: fix bug in negative lookup 2006-02-28 20:53:43 -08:00
hfs
hfsplus
hostfs
hpfs [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
hppfs
hugetlbfs [PATCH] convert hugetlbfs_counter to atomic 2006-03-22 07:54:04 -08:00
isofs [PATCH] isofs: remove unused debugging macros 2006-03-24 07:33:24 -08:00
jbd [PATCH] jbd: convert kjournald to kthread API 2006-03-25 08:22:50 -08:00
jffs [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
jffs2 [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
jfs [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
lockd [PATCH] fs: Use ARRAY_SIZE macro 2006-03-24 07:33:19 -08:00
minix [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
msdos
ncpfs [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
nfs [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
nfs_common
nfsd [PATCH] fs: Use ARRAY_SIZE macro 2006-03-24 07:33:19 -08:00
nls [PATCH] fs: Use ARRAY_SIZE macro 2006-03-24 07:33:19 -08:00
ntfs [PATCH] cpuset memory spread: slab cache filesystems 2006-03-24 07:33:23 -08:00
ocfs2 [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
openpromfs
partitions [PATCH] s390: Remove old history/whitespave from partition code 2006-03-24 07:33:17 -08:00
proc [PATCH] slab: implement /proc/slab_allocators 2006-03-25 08:22:49 -08:00
qnx4 [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
ramfs [PATCH] fs/*/file.c: drop insane header dependencies 2006-03-23 07:38:17 -08:00
reiserfs [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
romfs [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
smbfs [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
sysfs [PATCH] sysfs: fix a kobject leak in sysfs_add_link on the error path 2006-03-20 13:42:59 -08:00
sysv [PATCH] cpuset memory spread: slab cache filesystems 2006-03-24 07:33:23 -08:00
udf [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
ufs [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
vfat
xfs [PATCH] cpuset memory spread slab cache hooks 2006-03-24 07:33:23 -08:00
aio.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c [PATCH] x86_64: Check for bad elf entry address. 2006-02-26 09:53:30 -08:00
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio.c [PATCH] Block queue IO tracing support (blktrace) as of 2006-03-23 2006-03-23 20:00:26 +01:00
block_dev.c [PATCH] sb_set_blocksize cleanup 2006-03-24 07:33:25 -08:00
buffer.c [PATCH] fsync: extract internal code 2006-03-24 07:33:27 -08:00
char_dev.c [PATCH] kobj_map semaphore to mutex conversion 2006-03-20 13:42:58 -08:00
compat.c [PATCH] Conditionalize compat_sys_newfstatat 2006-03-24 07:33:27 -08:00
compat_ioctl.c [PATCH] fs: Use ARRAY_SIZE macro 2006-03-24 07:33:19 -08:00
dcache.c [PATCH] Optimise d_find_alias() 2006-03-25 08:22:49 -08:00
dcookies.c
direct-io.c Fix a direct I/O locking issue revealed by the new mutex code. 2006-03-15 15:14:45 +11:00
dnotify.c
dquot.c [PATCH] cpuset memory spread: slab cache format 2006-03-24 07:33:23 -08:00
drop_caches.c
eventpoll.c [PATCH] get_empty_filp tweaks, inline epoll_init_file() 2006-03-23 07:38:17 -08:00
exec.c [PATCH] Add mm->task_size and fix powerpc vdso 2006-02-28 20:53:44 -08:00
fcntl.c [PATCH] Shrinks sizeof(files_struct) and better layout 2006-03-23 07:38:09 -08:00
fifo.c Simplify fifo_open() locking logic 2006-03-07 09:16:35 -08:00
file.c [PATCH] Shrinks sizeof(files_struct) and better layout 2006-03-23 07:38:09 -08:00
file_table.c [PATCH] get_empty_filp tweaks, inline epoll_init_file() 2006-03-23 07:38:17 -08:00
filesystems.c
fs-writeback.c
inode.c [PATCH] cpuset memory spread slab cache hooks 2006-03-24 07:33:23 -08:00
inotify.c [PATCH] sem2mutex: iprune 2006-03-23 07:38:12 -08:00
ioctl.c
ioprio.c
Kconfig [PATCH] relay: migrate from relayfs to a generic relay API 2006-03-23 19:56:55 +01:00
Kconfig.binfmt
libfs.c [PATCH] sem2mutex: fs/libfs.c 2006-03-23 07:38:12 -08:00
locks.c
Makefile [PATCH] relay: migrate from relayfs to a generic relay API 2006-03-23 19:56:55 +01:00
mbcache.c [PATCH] cpuset memory spread: slab cache filesystems 2006-03-24 07:33:23 -08:00
mpage.c
namei.c [PATCH] Missed error checking for intent's filp in open_namei(). 2006-03-25 08:22:51 -08:00
namespace.c [PATCH] fs/namespace.c:dup_namespace(): fix a use after free 2006-03-15 09:37:34 -08:00
nfsctl.c [PATCH] fs: Use ARRAY_SIZE macro 2006-03-24 07:33:19 -08:00
open.c [PATCH] Shrinks sizeof(files_struct) and better layout 2006-03-23 07:38:09 -08:00
pipe.c Mark the pipe file operations static 2006-03-08 14:03:09 -08:00
pnode.c [PATCH] s/;;/;/g 2006-03-24 07:33:24 -08:00
pnode.h
posix_acl.c
quota.c [PATCH] sem2mutex: quota 2006-03-23 07:38:11 -08:00
quota_v1.c
quota_v2.c [PATCH] sem2mutex: quota 2006-03-23 07:38:11 -08:00
read_write.c
readdir.c
select.c [PATCH] select: time comparison fixes 2006-02-17 13:59:28 -08:00
seq_file.c [PATCH] sem2mutex: fs/seq_file.c 2006-03-23 07:38:12 -08:00
stat.c [PATCH] fstatat64 support 2006-02-11 21:41:10 -08:00
super.c [PATCH] vfs: MS_VERBOSE should be MS_SILENT 2006-03-24 07:33:15 -08:00
xattr.c
xattr_acl.c