android_kernel_samsung_univ.../fs
Mimi Zohar 14dba5331b integrity: nfsd imbalance bug fix
An nfsd exported file is opened/closed by the kernel causing the
integrity imbalance message.

Before a file is opened, there normally is permission checking, which
is done in inode_permission().  However, as integrity checking requires
a dentry and mount point, which is not available in inode_permission(),
the integrity (permission) checking must be called separately.

In order to detect any missing integrity checking calls, we keep track
of file open/closes.  ima_path_check() increments these counts and
does the integrity (permission) checking. As a result, the number of
calls to ima_path_check()/ima_file_free() should be balanced.  An extra
call to fput(), indicates the file could have been accessed without first
calling ima_path_check().

In nfsv3 permission checking is done once, followed by multiple reads,
which do an open/close for each read.  The integrity (permission) checking
call should be in nfsd_permission() after the inode_permission() call, but
as there is no correlation between the number of permission checking and
open calls, the integrity checking call should not increment the counters,
but defer it to when the file is actually opened.

This patch adds:
- integrity (permission) checking for nfsd exported files in nfsd_permission().
- a call to increment counts for files opened by nfsd.

This patch has been updated to return the nfs error types.

Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
2009-05-28 09:32:43 +10:00
..
9p Fix a leak in failure exit in 9p ->get_sb() 2009-05-09 10:49:40 -04:00
adfs
affs Fix races around the access to ->s_options 2009-05-09 10:51:34 -04:00
afs Fix races around the access to ->s_options 2009-05-09 10:51:34 -04:00
autofs
autofs4
befs
bfs
btrfs Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable 2009-05-14 19:18:44 -07:00
cachefiles
cifs cifs: fix pointer initialization and checks in cifs_follow_symlink (try ) 2009-05-19 15:31:20 +00:00
coda
configfs
cramfs
debugfs
devpts devpts: correctly set default options 2009-05-15 08:03:23 -07:00
dlm
ecryptfs Convert obvious places to deactivate_locked_super() 2009-05-09 10:49:40 -04:00
efs
exofs
exportfs
ext2
ext3
ext4 ext4: Fix race in ext4_inode_info.i_cached_extent 2009-05-15 09:07:28 -04:00
fat
freevxfs
fscache
fuse Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse 2009-05-13 16:32:57 -07:00
gfs2 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2009-05-10 10:49:08 -07:00
hfs
hfsplus
hostfs
hpfs Fix races around the access to ->s_options 2009-05-09 10:51:34 -04:00
hppfs
hugetlbfs Merge branch 'master' into next 2009-05-22 18:40:59 +10:00
isofs
jbd
jbd2
jffs2
jfs
lockd
minix
ncpfs
nfs nfs: Fix NFS v4 client handling of MAY_EXEC in nfs_permission. 2009-05-18 20:11:12 -07:00
nfs_common
nfsd integrity: nfsd imbalance bug fix 2009-05-28 09:32:43 +10:00
nilfs2 nilfs2: check size of array structured data exchanged via ioctls 2009-05-12 01:48:54 +09:00
nls
notify
ntfs
ocfs2 ocfs2: Use nd_set_link(). 2009-05-09 10:49:40 -04:00
omfs
openpromfs
partitions
proc Merge branch 'master' into next 2009-05-22 18:40:59 +10:00
qnx4
quota
ramfs
reiserfs reiserfs: fixup perms when xattrs are disabled 2009-05-17 11:45:45 -07:00
romfs ROMFS: romfs_dev_read() error ignored 2009-05-09 10:49:41 -04:00
smbfs
squashfs Squashfs: cody tidying, remove commented out line in Makefile 2009-05-13 03:25:20 +01:00
sysfs
sysv
ubifs Convert obvious places to deactivate_locked_super() 2009-05-09 10:49:40 -04:00
udf
ufs switch ufs directories to ufs_sync_file() 2009-05-09 10:49:42 -04:00
xfs
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c
binfmt_elf.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_binfmt_elf.c
compat_ioctl.c
compat.c CRED: Rename cred_exec_mutex to reflect that it's a guard against ptrace 2009-05-11 08:15:36 +10:00
dcache.c fs: dcache fix LRU ordering 2009-05-09 10:49:40 -04:00
dcookies.c
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c epoll: fix size check in epoll_create() 2009-05-12 14:11:35 -07:00
exec.c Merge branch 'master' into next 2009-05-22 18:40:59 +10:00
fcntl.c dup2: Fix return value with oldfd == newfd and invalid fd 2009-05-11 12:18:06 -07:00
fifo.c
file_table.c
file.c
filesystems.c
fs_struct.c
fs-writeback.c
generic_acl.c
inode.c Make checkpatch.pl shut up on fs/inode.c 2009-05-09 10:49:41 -04:00
internal.h
ioctl.c fiemap: fix problem with setting FIEMAP_EXTENT_LAST 2009-05-06 16:36:09 -07:00
ioprio.c
Kconfig
Kconfig.binfmt
libfs.c Convert obvious places to deactivate_locked_super() 2009-05-09 10:49:40 -04:00
locks.c
Makefile
mbcache.c
mpage.c
namei.c Merge branch 'master' into next 2009-05-22 18:40:59 +10:00
namespace.c Fix races around the access to ->s_options 2009-05-09 10:51:34 -04:00
nfsctl.c
no-block.c
open.c Switch open_exec() and sys_uselib() to do_open_filp() 2009-05-09 10:49:42 -04:00
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 NULL noise in fs/super.c:kill_bdev_super() 2009-05-09 10:49:41 -04:00
sync.c
timerfd.c
utimes.c
xattr_acl.c
xattr.c