GIT: wrapfs-2.6.32.y -- Wrapfs: update copyright year to 2015 (push to branch refs/heads/master)
ezk at fsl.cs.sunysb.edu
ezk at fsl.cs.sunysb.edu
Sun Dec 13 18:31:39 EST 2015
Push to branch refs/heads/master:
e2e94e39b487e13592773e5fe36904d2dae68928 -->
fb2873e99b45c47c9b849da7d0bfb7084176ea8b
Documentation/filesystems/00-INDEX | 2 +
Documentation/filesystems/wrapfs.txt | 172 ++++++++++
MAINTAINERS | 7 +
Makefile | 2 +-
arch/x86/kernel/entry_64.S | 11 +
arch/x86/kernel/paravirt.c | 16 +-
arch/x86/kernel/process_64.c | 52 ++-
drivers/base/devres.c | 4 +-
drivers/char/n_tty.c | 6 +-
drivers/hid/hid-core.c | 2 +-
drivers/input/evdev.c | 13 +-
drivers/macintosh/windfarm_core.c | 2 +-
drivers/md/md.c | 4 +-
drivers/net/virtio_net.c | 2 +-
drivers/scsi/mvsas/mv_sas.c | 2 +
drivers/usb/host/xhci-ring.c | 2 +-
drivers/usb/serial/whiteheat.c | 31 ++
fs/Kconfig | 1 +
fs/Makefile | 1 +
fs/binfmt_elf.c | 10 +-
fs/dcache.c | 11 +-
fs/hfs/bnode.c | 9 +-
fs/hfs/brec.c | 20 +-
fs/hfsplus/bnode.c | 9 +-
fs/namei.c | 32 +-
fs/nfs/nfs4state.c | 2 +-
fs/proc/task_mmu.c | 21 +-
fs/splice.c | 12 +-
fs/stack.c | 50 ++-
fs/super.c | 1 +
fs/wrapfs/Kconfig | 9 +
fs/wrapfs/Makefile | 7 +
fs/wrapfs/dentry.c | 49 +++
fs/wrapfs/file.c | 355 ++++++++++++++++++++
fs/wrapfs/inode.c | 624 +++++++++++++++++++++++++++++++++++
fs/wrapfs/lookup.c | 306 +++++++++++++++++
fs/wrapfs/main.c | 190 +++++++++++
fs/wrapfs/mmap.c | 94 ++++++
fs/wrapfs/super.c | 166 ++++++++++
fs/wrapfs/wrapfs.h | 203 ++++++++++++
fs/xfs/xfs_attr_leaf.h | 11 +-
include/linux/fs.h | 1 +
include/linux/magic.h | 2 +
include/linux/security.h | 6 +-
include/linux/skbuff.h | 3 +-
include/net/inet_common.h | 3 +-
ipc/msg.c | 18 +-
ipc/sem.c | 34 +-
ipc/shm.c | 13 +-
ipc/util.c | 8 +-
kernel/capability.c | 2 +-
kernel/module.c | 8 +-
lib/devres.c | 2 +-
mm/hugetlb.c | 8 +
net/core/datagram.c | 50 ++-
net/core/ethtool.c | 2 +-
net/ipv4/ipmr.c | 4 +-
net/ipv4/tcp_input.c | 2 +-
net/ipv4/udp.c | 2 +-
net/ipv6/addrconf.c | 37 ++-
net/ipv6/raw.c | 2 +-
net/ipv6/udp.c | 3 +-
net/rds/connection.c | 6 +
net/rds/info.c | 2 +-
net/rds/tcp_recv.c | 11 +-
net/rxrpc/ar-recvmsg.c | 3 +-
net/sunrpc/xprtsock.c | 2 +
security/security.c | 5 +-
68 files changed, 2620 insertions(+), 142 deletions(-)
commit fb2873e99b45c47c9b849da7d0bfb7084176ea8b
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Nov 4 20:22:33 2015 -0500
Wrapfs: update copyright year to 2015
commit a2598c6115238bf0c8db6532d9b39424c7900bc4
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Nov 4 20:22:32 2015 -0500
Wrapfs: use vfs xattr helpers
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit c1176e77b0a1e7cd412a335c5804d850c303c212
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Fri Aug 15 23:41:08 2014 -0400
Wrapfs: properly copy meta-data after AIO operations from lower inode
Signed-off-by: Mengyang Li <li.mengyang at stonybrook.edu>
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 01f147df28a1ec818c879a5db891e11667c517bb
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Mon Aug 11 19:34:52 2014 -0400
Wrapfs: leave placeholders for updating upper inode after AIO
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 740c6a5e0de57a7078cffd9a92472480892fd747
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sun Aug 10 03:38:47 2014 -0400
Wrapfs: protect lower_file by ref-count during aio operation
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
Signed-off-by: Mengyang Li <li.mengyang at stonybrook.edu>
commit c13bccb815e8225fe313b7dc2410f1f04c94a6b7
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Jun 25 23:49:20 2014 -0400
Wrapfs: fix ->llseek to update upper and lower offsets
Fixes bug: xfstests generic/257. f_pos consistently is required by and
only by dir_ops->wrapfs_readdir, main_ops is not affected.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
Signed-off-by: Mengyang Li <li.mengyang at stonybrook.edu>
commit 9e4dae7591fb7446eca1cb6d06f683b35fba108e
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Jun 25 23:49:20 2014 -0400
Wrapfs: support extended attributes (xattr) operations
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
Signed-off-by: Mengyang Li <li.mengyang at stonybrook.edu>
commit b64c4d4b2362fc7f6291d0fb3bec2a2a3934d3dd
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Fri Jun 20 21:26:02 2014 -0400
Wrapfs: support asynchronous-IO (AIO) operations
Signed-off-by: Li Mengyang <li.mengyang at stonybrook.edu>
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 2befad0226cf13d01752f18f52e219179ffdeff6
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Fri Jun 20 21:26:02 2014 -0400
Wrapfs: support direct-IO (DIO) operations
Signed-off-by: Li Mengyang <li.mengyang at stonybrook.edu>
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit bc911228292a1427e95002604465d75bead72cc7
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Thu May 15 00:15:52 2014 -0400
Wrapfs: implement vm_ops->page_mkwrite
Some file systems (e.g., ext4) require it. Reported by Ted Ts'o.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 7dcb70de5e3c3800ddfb58559d4dbe42d93cf3f2
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Thu Apr 3 13:34:38 2014 -0400
Wrapfs: update documentation
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit c0eb529d133f05fd4591820812887248e44795a8
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Thu Apr 3 13:34:28 2014 -0400
Wrapfs: update maintainers
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 79146e9e7c6f20551f8899938f7f444ace3e015d
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Jan 21 03:04:36 2014 -0500
Wrapfs: update documentation
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 6c697e8ae560550f36f6b940e3b07e39a3f2f9f0
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Jan 21 01:09:06 2014 -0500
Wrapfs: 2014 Copyright update
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 983e3753e0ac5d80544aed2c92a92c2cb8e9b62c
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Nov 19 22:14:12 2013 -0500
Wrapfs: properly use fsstack_copy_attr_all's 3rd arg in ->ioctl
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 210290bd3c64381277a4111d8483cea0d33429c9
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Jun 5 01:43:41 2013 -0400
Wrapfs: copy lower inode attributes in ->ioctl
Some ioctls (e.g., EXT2_IOC_SETFLAGS) can change inode attributes, so copy
them from lower inode.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 0d1e83a19447b088ed3981fd29914c0e9df99099
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Jun 5 01:42:41 2013 -0400
Wrapfs: remove unnecessary call to vm_unmap in ->mmap
Code is unnecessary and causes deadlocks in newer kernels.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 48d4bfb041602333e722b17828222527e6dda0ca
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sun Jun 2 21:53:17 2013 -0400
patch copyright-2013.patch
commit 29bde9ece9a2e85dffe2aa3227011d96a4207844
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Fri Sep 9 00:43:49 2011 -0400
Wrapfs: drop our dentry in ->rmdir
Also clear nlinks on our inode.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 9d736bbf7ffecef1ad41a36c8a8e7d2a96e94ab4
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Mon May 2 02:00:02 2011 -0400
Wrapfs: lookup fixes
Don't use lookup_one_len any longer (doesn't work for NFS).
Initialize lower wrapfs_dentry_info so lower_path is NULL.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 9ef118dd044c5c0f61b1432dadae916c6325bd7b
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Fri Mar 18 13:26:53 2011 -0400
Wrapfs: correct use of copy_attr_all, old style
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 775d83383c69e33c6d528586151cf668c4c74343
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Fri Mar 18 13:12:43 2011 -0400
Wrapfs: remove extra debug in rmdir
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 774c52d8979a41e5ef1e54343de3ce4535172e3c
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Fri Mar 18 12:37:32 2011 -0400
Wrapfs: checkpatch fixes
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 8525cafc6e4d454f28925f1071d7557048f5414b
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Thu Mar 17 23:04:47 2011 -0400
Wrapfs: copyright update for 2011
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit f6848081b5037d437c039bccbe7386a5175cfaa7
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Thu Mar 17 23:04:47 2011 -0400
Wrapfs: better handling of NFS silly-renamed files
In ->unlink, if we try to unlink an NFS silly-renamed file, NFS returns
-EBUSY. We have to treat it as a success and return 0 to the VFS. NFS will
remove silly-deleted files later on anyway.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit d94707a77664ccd5a9c5e640c7f2d104d229e47b
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Thu Mar 17 23:04:47 2011 -0400
Wrapfs: update parent directory inode size in inode ops
After ->unlink, ->rmdir, and ->rename, we need to copy the (possibly
changed) inode size of the parent directory(ies) where the operation took
place.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 7b0435997c21f49f24b089993ddcf3c06806cd24
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Thu Mar 17 23:04:47 2011 -0400
Wrapfs: remove unnecessary calls to copy lower inode->n_links
Removed from ->create, ->symlink, and ->mknod.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 2c9bc2ff1179a14a9333849cc4957fc44c673d8e
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Mar 8 01:15:15 2011 -0500
Wrapfs: ->setattr fixes
Call inode_change_ok on our inode, not lower.
Don't copy inode sizes (VFS does it).
Pass lower file in struct iattr passed to notify_change on lower inode.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit f6ee664473249c91750de8c912652df5b1a31d70
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Apr 20 21:24:40 2010 -0400
Wrapfs: update documentation
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit ccd55245b04fcd106d9fe6657216254ba35f0338
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Apr 20 14:15:06 2010 -0400
Wrapfs: avoid an extra path_get/put pair in wrapfs_open
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 8e183ea11bc77f0bfea26d62c1e80bdc9e661d33
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Thu Jan 21 21:15:01 2010 -0500
Wrapfs: decrement nd_path on follow_link error
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 510909d9441c72d9a693405c4213b3fdd80e0be2
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Jan 5 04:24:05 2010 -0500
Wrapfs: don't mention kernel version in modload message
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 186fd9e3e4a63784c9bd3ea399142246e41fcbf7
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Jan 5 04:16:08 2010 -0500
Wrapfs/VFS: remove init_lower_nd and unexport release_lower_nd
Only wrapfs_create used it, and it is unnecessary to init a completely new
nameidata for the lower file system.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 683013ba3dac076822f0076364be6236ca82937c
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Jan 2 17:21:56 2010 -0500
Wrapfs: use iget5_locked
Use iget5_locked instead of iget_locked, because an inode number alone isn't
enough for wrapfs to identify an inode (need to also ensure we match the
glower inode). This fixes a number of races when mounting on top of NFS.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 3088dfd458b59631903993808f549b96dbdd9e3c
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Mon Jan 4 18:54:51 2010 -0500
Wrapfs: handle silly-renamed NFS files
In our ->unlink and ->rmdir, if the lower dentry is already silly-renamed
(NFS), then we treat this unlink operation as if it already succeeded, and
don't actually call vfs_unlink on the lower dentry (NFS may return EBUSY).
Note: VFS also has special handling for silly-renamed files.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 3e76d69dd858b536b619e6eafd0de926c843023e
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sun Dec 27 02:01:28 2009 -0500
Wrapfs: document necessary d_drop in ->unlink
LTP will fail if this d_drop isn't there.
Funny, you'd think the VFS should do it for you.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 8e7ad0b86874190383b7326eca05f0919adbfcf4
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sun Dec 27 02:06:17 2009 -0500
Wrapfs: update copyright year
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 2d9bf401f04b53b39b9abb825808e18df1532e06
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 19:24:30 2009 -0500
Wrapfs: minor cleanups, comment updates, LoC
Remove unnecessary BUG assertions.
Update comments.
Update LoC in documentation.
commit 665f96901531b1a002343b913ea3cba1a79ca42e
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 16:55:53 2009 -0500
Wrapfs: remove unused mode variable from ->symlink
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit df21c9959df074f126e064e7bce2443b80748320
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 15:35:33 2009 -0500
Wrapfs: remove d_deleted helper in ->open
Still need to check for unhashed dentries in ->open.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 81d5782177e1b0c91afa58c28224cad5e32dac90
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 17:54:47 2009 -0500
Wrapfs: use mnt_want/drop_write helpers
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit a79437cb5cd57dd0ba85aefbe7cca8a7d2b24bd3
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 15:06:28 2009 -0500
Wrapfs: check for errors in ->rmdir
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 8e7f564df360b17df5e1278b05d25c53b5b58a81
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Fri Dec 25 17:10:25 2009 -0500
Wrapfs: fix race in ->mmap
Discovered using LTP rwtest03/04 tests.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit dfea1cbb7b49f1dab95c54d6eb7ffffcfd1b301c
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Fri Dec 25 14:04:37 2009 -0500
Wrapfs: support the mand mount option
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 4685de4e17a6de743fb0a72391b0af6974904853
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 14:23:07 2009 -0500
Wrapfs: remove unnecessary checks from file->release
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 8f13861575fa39d68308a09cf7da216a6f494f75
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Thu Dec 24 15:36:12 2009 -0500
Wrapfs: use only d_add in instantiate
Also, no need for special versions of instantiate.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit c77e3147710571183c58d468b159f2381ade12dc
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Thu Dec 24 15:13:38 2009 -0500
Wrapfs: mention lower file system type and path on mount
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 647bf906a33cd0d7a30c0ed603c087df6932bf45
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 14:18:59 2009 -0500
Wrapfs: merge wrapfs_fill_inode into wrapfs_iget
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit e069761e7db1daf148e6e78f66299e598dfd215b
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Dec 23 16:18:03 2009 -0500
Wrapfs: move wrapfs_iget and wrapfs_lookup to lookup.c
Better placed logically. Avoids a couple of externs.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 6481c698ff2552149143c15c9fa5187111c39233
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Dec 23 16:09:29 2009 -0500
Wrapfs: cleanup decision login for fill_inode in interpose
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit b15b6805687c76358f7c33659caba8dc81707486
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Dec 23 16:03:28 2009 -0500
Wrapfs: don't pass dentry to wrapfs_fill_inode
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 2b72af6541dc7689dbf13eeebfd391df4e519ee6
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Dec 23 15:25:53 2009 -0500
Wrapfs: rename wrapfs_lookup_full to __wrapfs_lookup
Also remove dead code.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 492a6d69e9656d94bae0be2d659c9f0fbc5c8427
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 13:55:57 2009 -0500
Wrapfs: don't call path_put inside a spinlock
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 4b0795dcc302a0bfbb6014cf454d1c337bf65078
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Dec 23 02:03:15 2009 -0500
Wrapfs: use generic_show_options
Wrapfs no longer has any special mount options.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit f555f059ddf57e08cf6dd3c78f3a80ce1d2a37f1
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 13:53:08 2009 -0500
Wrapfs: remove d_splice_alias code from interpose
Unnecessary until and if we export wrapfs over NFS.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 38010ac7db0d365c03f17d996eba874ca2a70d59
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 17:50:29 2009 -0500
Wrapfs: remove old lower dentry/mnt helpers
Unnecessary as we're now using lower_path helpers.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 045ff014703b758f4518c4c8f7b6618224c2d46f
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 13:46:54 2009 -0500
Wrapfs: use lower-path helpers in inode operations
Also remove unnecessary code.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 9ed4b6a279c0039520c5b946a17733e17c051d12
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 13:22:21 2009 -0500
Wrapfs: use lower-path helpers in file operations
Also remove unnecessary code and cleanup.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 14ae71662b9a5b0febee0381915939e42ab4a225
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 13:15:59 2009 -0500
Wrapfs: use lower-path helpers in dentry operations
And remove dead code from ->d_revalidate.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 6115e8c19d747407d819a73eccb4bbf115cc19c5
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Dec 22 20:52:03 2009 -0500
Wrapfs: use lower-path helpers in main operations
Also remove wrapfs_parse_options because we don't support any special
options. Take the lower mount directory from the dev_name argument of
mount(2).
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit c19cd443e61b2bbaae52351652688f30ec789a22
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 17:32:13 2009 -0500
Wrapfs: use lower-path helpers in lookup and interpose
Also simplify code, cut dead code, and minor cleanup.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 1eb9cf2112fa9135f0e1a8fbda7ef5cdbf809557
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Dec 22 20:32:49 2009 -0500
Wrapfs: use lower-path helpers in superblock operations
Also remove unnecessary code from ->statfs.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 1e996ce815254687e5d55e8a551ffa8a511459ea
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 13:02:46 2009 -0500
Wrapfs: introduce new lower-path based helpers
These will help remove the need for dentry/mnt specific helpers. Everything
should be handled as a path
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit c567d6df5b87f482ece9bfa5aa0b7abedc1a2466
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 13:00:23 2009 -0500
Wrapfs: remove leftovers of per-function dentry/file revalidation
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 371ad9c4c173c0ce9faa4a97cb25bfe09c16711a
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Mon Dec 21 15:25:17 2009 -0500
Wrapfs: remove unnecessary calls to dget_parent
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 159d19230971c8bd98dd15ae9418b9d3f441606f
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 12:46:39 2009 -0500
Wrapfs: cleanup and fixes in ->open
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit cb90cba0587b67c6037717c034ff267fb8807c5e
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Mon Dec 14 12:13:46 2009 -0500
Wrapfs: ->show_options doesn't need to display per-branch mount mode
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit ebe6d92a06bb716f0b745b676cddaa57f03b8944
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 12:45:15 2009 -0500
Wrapfs: remove mention of "branches" from comments
And remove dead code from file->release.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 36bb6e8659af97db37194627758c1b917babc281
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 12 01:24:06 2009 -0500
Wrapfs: no need to initialize err variable in ->unlink
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit a7562c4e3216ccd85da47f4963bacfec72a98694
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 12:43:18 2009 -0500
Wrapfs: comments and updates to ->d_revalidate
Our dentry should be invalid if there is no lower dentry.
Copy lower attributes only if the lower dentry is valid.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 9031bcdd0caa1026b56a0f83c280ca4b23dbf0ab
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Dec 8 21:51:49 2009 -0500
wrapfs: simple optimization in permission
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit d432684c12e110f9ea6751a9a160fe46a67ef06b
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Dec 8 21:50:21 2009 -0500
Wrapfs: remove unnecessary code from lookup_full
No need to d_drop our own dentry: VFS should.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit d40b41b588e4f56b0dabfc4e8798c8f06b8d4b25
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Mon Dec 21 11:51:34 2009 -0500
Wrapfs: cleanup lookup and interpose
Remove two INTERPOSE flags and instead pass a dentry pointer to be filled in
by interpose only if called from lookup. Remove unnecessary code.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 50eab283ce82eea7ba67477dff4e74869265c4a8
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Mon Dec 21 11:41:27 2009 -0500
Wrapfs: remove debugging support
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit c206b5aa654b9b11b7c459fc65d396401335ab98
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 26 12:40:20 2009 -0500
Wrapfs: remove unnecessary d_drop calls in wrapfs_link
Unnecessary because it would unhash perfectly valid dentries, causing them
to have to be re-looked up the next time they're needed, which presumably is
right after.
Signed-off-by: Aseem Rastogi <arastogi at cs.sunysb.edu>
Signed-off-by: Shrikar archak <shrikar84 at gmail.com>
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 8995d1ce55f47fc0af6f5e3c36630401a7516f73
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 5 22:30:05 2009 -0500
Wrapfs: copy inode size and blocks from lower inode on d_revalidate
Otherwise our inode size may be incorrect if the lower file system takes a
bit of time to update its inode sizes (e.g., nfs4).
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 66c1bb78933937e2e28d15b9d0d6d550b37a716a
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Dec 9 11:38:46 2009 -0500
Wrapfs: cleanup wrapfs_iget
Remove unnecessary iput() on lower inode.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit c61c57405502bebada8822c397b67567684acc53
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Dec 9 10:52:08 2009 -0500
Unionfs: switch from d->d_iput from sb->drop_inode
This makes reference counting easier and saner to handle, and fixes bugs.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 234af8de12856ec2c97ad81f3381fe0dcbdfb3b4
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Dec 9 10:49:43 2009 -0500
Wrapfs: inherit inode number from lower inode
Fixes a bug in hardlinks: hardlinked upper inodes should have same inode num.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 84c4643aa2c3b2f885f99e4a29381b601c882983
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Dec 8 18:27:48 2009 -0500
wrapfs: remove unnecessary comment in permission
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 46a555ce2bcc31c93bf9fc6665d3e22de690ba7f
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Sat Dec 5 22:19:56 2009 -0500
Wrapfs: fix typo in setattr comment
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 9232e7b679a49c70dd6a1e7fae71bbcbeecea1ed
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Thu Dec 3 22:16:15 2009 -0500
Wrapfs: fix typo in documentation.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit a3ec0f26648ffa48b05f5334871c6a347d2b538b
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Mon Nov 30 00:52:39 2009 -0500
Wrapfs: remove lockdep off/on in wrapfs_rename
Remove lockdep on/off pair. Issue is now fixed by adding a new
lock_class_key in alloc_super.
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
Signed-off-by: Shrikar archak <shrikar84 at gmail.com>
commit 1d81d9a630ff145db1a66253139912ea1e9968b1
Author: Roland Dreier <rdreier at cisco.com>
Date: Mon Nov 30 20:18:12 2009 -0500
VFS: add lockdep annotation to s_vfs_rename_key for ecryptfs
> =============================================
> [ INFO: possible recursive locking detected ]
> 2.6.31-2-generic #14~rbd3
> ---------------------------------------------
> firefox-3.5/4162 is trying to acquire lock:
> (&s->s_vfs_rename_mutex){+.+.+.}, at: [<ffffffff81139d31>] lock_rename+0x41/0xf0
>
> but task is already holding lock:
> (&s->s_vfs_rename_mutex){+.+.+.}, at: [<ffffffff81139d31>] lock_rename+0x41/0xf0
>
> other info that might help us debug this:
> 3 locks held by firefox-3.5/4162:
> #0: (&s->s_vfs_rename_mutex){+.+.+.}, at: [<ffffffff81139d31>] lock_rename+0x41/0xf0
> #1: (&sb->s_type->i_mutex_key#11/1){+.+.+.}, at: [<ffffffff81139d5a>] lock_rename+0x6a/0xf0
> #2: (&sb->s_type->i_mutex_key#11/2){+.+.+.}, at: [<ffffffff81139d6f>] lock_rename+0x7f/0xf0
>
> stack backtrace:
> Pid: 4162, comm: firefox-3.5 Tainted: G C 2.6.31-2-generic #14~rbd3
> Call Trace:
> [<ffffffff8108ae74>] print_deadlock_bug+0xf4/0x100
> [<ffffffff8108ce26>] validate_chain+0x4c6/0x750
> [<ffffffff8108d2e7>] __lock_acquire+0x237/0x430
> [<ffffffff8108d585>] lock_acquire+0xa5/0x150
> [<ffffffff81139d31>] ? lock_rename+0x41/0xf0
> [<ffffffff815526ad>] __mutex_lock_common+0x4d/0x3d0
> [<ffffffff81139d31>] ? lock_rename+0x41/0xf0
> [<ffffffff81139d31>] ? lock_rename+0x41/0xf0
> [<ffffffff8120eaf9>] ? ecryptfs_rename+0x99/0x170
> [<ffffffff81552b36>] mutex_lock_nested+0x46/0x60
> [<ffffffff81139d31>] lock_rename+0x41/0xf0
> [<ffffffff8120eb2a>] ecryptfs_rename+0xca/0x170
> [<ffffffff81139a9e>] vfs_rename_dir+0x13e/0x160
> [<ffffffff8113ac7e>] vfs_rename+0xee/0x290
> [<ffffffff8113c212>] ? __lookup_hash+0x102/0x160
> [<ffffffff8113d512>] sys_renameat+0x252/0x280
> [<ffffffff81133eb4>] ? cp_new_stat+0xe4/0x100
> [<ffffffff8101316a>] ? sysret_check+0x2e/0x69
> [<ffffffff8108c34d>] ? trace_hardirqs_on_caller+0x14d/0x190
> [<ffffffff8113d55b>] sys_rename+0x1b/0x20
> [<ffffffff81013132>] system_call_fastpath+0x16/0x1b
The trace above is totally reproducible by doing a cross-directory
rename on an ecryptfs directory.
The issue seems to be that sys_renameat() does lock_rename() then calls
into the filesystem; if the filesystem is ecryptfs, then
ecryptfs_rename() again does lock_rename() on the lower filesystem, and
lockdep can't tell that the two s_vfs_rename_mutexes are different. It
seems an annotation like the following is sufficient to fix this (it
does get rid of the lockdep trace in my simple tests); however I would
like to make sure I'm not misunderstanding the locking, hence the CC
list...
Signed-off-by: Roland Dreier <rdreier at cisco.com>
Cc: Tyler Hicks <tyhicks at linux.vnet.ibm.com>
Cc: Dustin Kirkland <kirkland at canonical.com>
Cc: Al Viro <viro at zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
commit 5c5973256e8342ed25abc4dd5250f1f43775cc35
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Mon Nov 30 00:49:32 2009 -0500
Wrapfs: chdir fix
When lower_dentry is not filled during lookup, chdir can oops.
Signed-off-by: Aseem Rastogi <arastogi at cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
commit 8326aaef83f96830253c9b2a578600d49662b887
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Nov 17 20:19:51 2009 -0500
patch wrapfs-update-documentation.patch
commit b10aa5dc1c312d282ce2aff8461f468e0f16383b
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Nov 17 20:14:08 2009 -0500
patch indent-fs-stack.patch
commit d25a24d536cc6ddb9eee68330d9539912899529f
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Nov 17 20:24:32 2009 -0500
patch wrapfs-fix-kconfig.patch
commit 501db46a16593453e230e9e722c0762a103db8fc
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Nov 17 20:22:27 2009 -0500
patch comment-fixes.patch
commit fa3d3df8df783a814aa978b1722c093536506dd1
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Tue Nov 17 18:54:20 2009 -0500
patch remove-unlikely.patch
commit 0d293606c2c5f89d941bb708fc19b76f12b4bbea
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Thu Nov 12 00:26:16 2009 -0500
patch checkpatch-fixes.patch
commit 764b1062a5ed67f5dd7e544a452cfa8d155ada44
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Nov 11 23:09:09 2009 -0500
patch update-documentation.patch
commit 47897b8c494685233a8d74b636973e056c0088b7
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Nov 11 23:06:21 2009 -0500
patch cleanup-interpose-flags.patch
commit 1b877a081a54bb7d404072e706a95576044add2a
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Nov 11 22:50:04 2009 -0500
patch fix-lookup-full-comment.patch
commit 60da4bdef94c8c4b410db4df81a6ca942f12f61f
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Nov 11 22:49:44 2009 -0500
patch shorten-makefile.patch
commit 0b245ac1581eb805643070e1db3dbc12f4cc5871
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Nov 11 22:47:00 2009 -0500
patch make-static-methods.patch
commit 3fd465607fe288cba7ebce5a91d3a447e22326d3
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Nov 11 22:41:57 2009 -0500
patch remove-unnecessary-externs.patch
commit 0413560dfedde3fa6b6cf7c698c1dae6fa105f16
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Nov 11 22:34:47 2009 -0500
patch remove-reinterpose.patch
commit 34fabc9d4b611d322b141d0c1c860b5cc489a5be
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Nov 11 22:30:05 2009 -0500
patch remove-dput_lowers.patch
commit 2405148572cf0cf2e73ba16e9ff2b8758f0eb0de
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date: Wed Nov 11 22:28:05 2009 -0500
patch centralize-debugging-code.patch
diff --git a/Makefile b/Makefile
index e28e263..98726baa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 32
-EXTRAVERSION = .68
+EXTRAVERSION = .69
NAME = Man-Eating Seals of Antiquity
# *DOCUMENTATION*
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 303eaeb8..b289d66 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1552,7 +1552,18 @@ END(error_exit)
/* runs on exception stack */
ENTRY(nmi)
INTR_FRAME
+ /*
+ * Fix up the exception frame if we're on Xen.
+ * PARAVIRT_ADJUST_EXCEPTION_FRAME is guaranteed to push at most
+ * one value to the stack on native, so it may clobber the rdx
+ * scratch slot, but it won't clobber any of the important
+ * slots past it.
+ *
+ * Xen is a different story, because the Xen frame itself overlaps
+ * the "NMI executing" variable.
+ */
PARAVIRT_ADJUST_EXCEPTION_FRAME
+
pushq_cfi $-1
subq $15*8, %rsp
CFI_ADJUST_CFA_OFFSET 15*8
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 1b1739d..889e54f 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -38,10 +38,18 @@
#include <asm/tlbflush.h>
#include <asm/timer.h>
-/* nop stub */
-void _paravirt_nop(void)
-{
-}
+/*
+ * nop stub, which must not clobber anything *including the stack* to
+ * avoid confusing the entry prologues.
+ */
+extern void _paravirt_nop(void);
+asm (".pushsection .entry.text, \"ax\"\n"
+ ".global _paravirt_nop\n"
+ "_paravirt_nop:\n\t"
+ "ret\n\t"
+ ".size _paravirt_nop, . - _paravirt_nop\n\t"
+ ".type _paravirt_nop, @function\n\t"
+ ".popsection");
/* identity function, which can be inlined */
u32 _paravirt_ident_32(u32 x)
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 39493bc..936b0ba 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -550,27 +550,59 @@ void set_personality_ia32(void)
current_thread_info()->status |= TS_COMPAT;
}
+/*
+ * Called from fs/proc with a reference on @p to find the function
+ * which called into schedule(). This needs to be done carefully
+ * because the task might wake up and we might look at a stack
+ * changing under us.
+ */
unsigned long get_wchan(struct task_struct *p)
{
- unsigned long stack;
- u64 fp, ip;
+ unsigned long start, bottom, top, sp, fp, ip;
int count = 0;
if (!p || p == current || p->state == TASK_RUNNING)
return 0;
- stack = (unsigned long)task_stack_page(p);
- if (p->thread.sp < stack || p->thread.sp >= stack+THREAD_SIZE)
+
+ start = (unsigned long)task_stack_page(p);
+ if (!start)
+ return 0;
+
+ /*
+ * Layout of the stack page:
+ *
+ * ----------- topmax = start + THREAD_SIZE - sizeof(unsigned long)
+ * PADDING
+ * ----------- top = topmax - TOP_OF_KERNEL_STACK_PADDING
+ * stack
+ * ----------- bottom = start + sizeof(thread_info)
+ * thread_info
+ * ----------- start
+ *
+ * The tasks stack pointer points at the location where the
+ * framepointer is stored. The data on the stack is:
+ * ... IP FP ... IP FP
+ *
+ * We need to read FP and IP, so we need to adjust the upper
+ * bound by another unsigned long.
+ */
+ top = start + THREAD_SIZE;
+ top -= 2 * sizeof(unsigned long);
+ bottom = start + sizeof(struct thread_info);
+
+ sp = ACCESS_ONCE(p->thread.sp);
+ if (sp < bottom || sp > top)
return 0;
- fp = *(u64 *)(p->thread.sp);
+
+ fp = ACCESS_ONCE(*(unsigned long *)sp);
do {
- if (fp < (unsigned long)stack ||
- fp >= (unsigned long)stack+THREAD_SIZE)
+ if (fp < bottom || fp > top)
return 0;
- ip = *(u64 *)(fp+8);
+ ip = ACCESS_ONCE(*(unsigned long *)(fp + sizeof(unsigned long)));
if (!in_sched_functions(ip))
return ip;
- fp = *(u64 *)fp;
- } while (count++ < 16);
+ fp = ACCESS_ONCE(*(unsigned long *)fp);
+ } while (count++ < 16 && p->state != TASK_RUNNING);
return 0;
}
diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index 05dd307..6d022dc 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -253,10 +253,10 @@ void * devres_get(struct device *dev, void *new_res,
if (!dr) {
add_dr(dev, &new_dr->node);
dr = new_dr;
- new_dr = NULL;
+ new_res = NULL;
}
spin_unlock_irqrestore(&dev->devres_lock, flags);
- devres_free(new_dr);
+ devres_free(new_res);
return dr->data;
}
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 5269fa0..34be7fd 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -1287,8 +1287,7 @@ handle_newline:
tty->canon_data++;
spin_unlock_irqrestore(&tty->read_lock, flags);
kill_fasync(&tty->fasync, SIGIO, POLL_IN);
- if (waitqueue_active(&tty->read_wait))
- wake_up_interruptible(&tty->read_wait);
+ wake_up_interruptible(&tty->read_wait);
return;
}
}
@@ -1410,8 +1409,7 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
if (!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) {
kill_fasync(&tty->fasync, SIGIO, POLL_IN);
- if (waitqueue_active(&tty->read_wait))
- wake_up_interruptible(&tty->read_wait);
+ wake_up_interruptible(&tty->read_wait);
}
/*
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index e7e28b5..644ab4d 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1235,7 +1235,7 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask)
"Multi-Axis Controller"
};
const char *type, *bus;
- char buf[64];
+ char buf[64] = "";
unsigned int i;
int len;
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index dee6706..f05566f 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -102,19 +102,14 @@ static int evdev_flush(struct file *file, fl_owner_t id)
{
struct evdev_client *client = file->private_data;
struct evdev *evdev = client->evdev;
- int retval;
- retval = mutex_lock_interruptible(&evdev->mutex);
- if (retval)
- return retval;
+ mutex_lock(&evdev->mutex);
- if (!evdev->exist)
- retval = -ENODEV;
- else
- retval = input_flush_device(&evdev->handle, file);
+ if (evdev->exist)
+ input_flush_device(&evdev->handle, file);
mutex_unlock(&evdev->mutex);
- return retval;
+ return 0;
}
static void evdev_free(struct device *dev)
diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c
index 075b4d9..553414e 100644
--- a/drivers/macintosh/windfarm_core.c
+++ b/drivers/macintosh/windfarm_core.c
@@ -418,7 +418,7 @@ int wf_unregister_client(struct notifier_block *nb)
{
mutex_lock(&wf_lock);
blocking_notifier_chain_unregister(&wf_client_list, nb);
- wf_client_count++;
+ wf_client_count--;
if (wf_client_count == 0)
wf_stop_thread();
mutex_unlock(&wf_lock);
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 4ce6e2f..ab0f708 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4680,9 +4680,9 @@ static int get_bitmap_file(mddev_t * mddev, void __user * arg)
int err = -ENOMEM;
if (md_allow_write(mddev))
- file = kmalloc(sizeof(*file), GFP_NOIO);
+ file = kzalloc(sizeof(*file), GFP_NOIO);
else
- file = kmalloc(sizeof(*file), GFP_KERNEL);
+ file = kzalloc(sizeof(*file), GFP_KERNEL);
if (!file)
goto out;
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 97a56f0..2bc6661 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -868,7 +868,7 @@ static int virtnet_probe(struct virtio_device *vdev)
/* Do we support "hardware" checksums? */
if (csum && virtio_has_feature(vdev, VIRTIO_NET_F_CSUM)) {
/* This opens up the world of extra features. */
- dev->features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST;
+ dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG;
if (gso && virtio_has_feature(vdev, VIRTIO_NET_F_GSO)) {
dev->features |= NETIF_F_TSO | NETIF_F_UFO
| NETIF_F_TSO_ECN | NETIF_F_TSO6;
diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
index 0d21386..e4c01b5 100644
--- a/drivers/scsi/mvsas/mv_sas.c
+++ b/drivers/scsi/mvsas/mv_sas.c
@@ -1035,6 +1035,8 @@ static void mvs_slot_free(struct mvs_info *mvi, u32 rx_desc)
static void mvs_slot_task_free(struct mvs_info *mvi, struct sas_task *task,
struct mvs_slot_info *slot, u32 slot_idx)
{
+ if (!slot)
+ return;
if (!slot->task)
return;
if (!sas_protocol_ata(task->task_proto))
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 38fb682..fa22638 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -80,7 +80,7 @@ dma_addr_t xhci_trb_virt_to_dma(struct xhci_segment *seg,
return 0;
/* offset in TRBs */
segment_offset = trb - seg->trbs;
- if (segment_offset > TRBS_PER_SEGMENT)
+ if (segment_offset >= TRBS_PER_SEGMENT)
return 0;
return seg->dma + (segment_offset * sizeof(*trb));
}
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 748c627..1e5f35d 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -143,6 +143,8 @@ static int whiteheat_firmware_download(struct usb_serial *serial,
static int whiteheat_firmware_attach(struct usb_serial *serial);
/* function prototypes for the Connect Tech WhiteHEAT serial converter */
+static int whiteheat_probe(struct usb_serial *serial,
+ const struct usb_device_id *id);
static int whiteheat_attach(struct usb_serial *serial);
static void whiteheat_release(struct usb_serial *serial);
static int whiteheat_open(struct tty_struct *tty,
@@ -188,6 +190,7 @@ static struct usb_serial_driver whiteheat_device = {
.usb_driver = &whiteheat_driver,
.id_table = id_table_std,
.num_ports = 4,
+ .probe = whiteheat_probe,
.attach = whiteheat_attach,
.release = whiteheat_release,
.open = whiteheat_open,
@@ -387,6 +390,34 @@ static int whiteheat_firmware_attach(struct usb_serial *serial)
/*****************************************************************************
* Connect Tech's White Heat serial driver functions
*****************************************************************************/
+
+static int whiteheat_probe(struct usb_serial *serial,
+ const struct usb_device_id *id)
+{
+ struct usb_host_interface *iface_desc;
+ struct usb_endpoint_descriptor *endpoint;
+ size_t num_bulk_in = 0;
+ size_t num_bulk_out = 0;
+ size_t min_num_bulk;
+ unsigned int i;
+
+ iface_desc = serial->interface->cur_altsetting;
+
+ for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) {
+ endpoint = &iface_desc->endpoint[i].desc;
+ if (usb_endpoint_is_bulk_in(endpoint))
+ ++num_bulk_in;
+ if (usb_endpoint_is_bulk_out(endpoint))
+ ++num_bulk_out;
+ }
+
+ min_num_bulk = COMMAND_PORT + 1;
+ if (num_bulk_in < min_num_bulk || num_bulk_out < min_num_bulk)
+ return -ENODEV;
+
+ return 0;
+}
+
static int whiteheat_attach(struct usb_serial *serial)
{
struct usb_serial_port *command_port;
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 400786e..b8a0388 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -676,16 +676,16 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
if (file_permission(interpreter, MAY_READ) < 0)
bprm->interp_flags |= BINPRM_FLAGS_ENFORCE_NONDUMP;
- retval = kernel_read(interpreter, 0, bprm->buf,
- BINPRM_BUF_SIZE);
- if (retval != BINPRM_BUF_SIZE) {
+ /* Get the exec headers */
+ retval = kernel_read(interpreter, 0,
+ (void *)&loc->interp_elf_ex,
+ sizeof(loc->interp_elf_ex));
+ if (retval != sizeof(loc->interp_elf_ex)) {
if (retval >= 0)
retval = -EIO;
goto out_free_dentry;
}
- /* Get the exec headers */
- loc->interp_elf_ex = *((struct elfhdr *)bprm->buf);
break;
}
elf_ppnt++;
diff --git a/fs/dcache.c b/fs/dcache.c
index 44c0aea..07c4472 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1910,7 +1910,7 @@ char *__d_path(const struct path *path, struct path *root,
struct dentry *dentry = path->dentry;
struct vfsmount *vfsmnt = path->mnt;
char *end = buffer + buflen;
- char *retval;
+ char *retval, *tail;
spin_lock(&vfsmount_lock);
prepend(&end, &buflen, "\0", 1);
@@ -1923,6 +1923,7 @@ char *__d_path(const struct path *path, struct path *root,
/* Get '/' right */
retval = end-1;
*retval = '/';
+ tail = end;
for (;;) {
struct dentry * parent;
@@ -1930,6 +1931,14 @@ char *__d_path(const struct path *path, struct path *root,
if (dentry == root->dentry && vfsmnt == root->mnt)
break;
if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
+ /* Escaped? */
+ if (dentry != vfsmnt->mnt_root) {
+ buflen += (tail - end);
+ end = tail;
+ prepend(&end, &buflen, "(unreachable)/", 14);
+ retval = end;
+ goto out;
+ }
/* Global root? */
if (vfsmnt->mnt_parent == vfsmnt) {
goto global_root;
diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c
index 0d20006..3136308 100644
--- a/fs/hfs/bnode.c
+++ b/fs/hfs/bnode.c
@@ -286,7 +286,6 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
page_cache_release(page);
goto fail;
}
- page_cache_release(page);
node->page[i] = page;
}
@@ -396,11 +395,11 @@ node_error:
void hfs_bnode_free(struct hfs_bnode *node)
{
- //int i;
+ int i;
- //for (i = 0; i < node->tree->pages_per_bnode; i++)
- // if (node->page[i])
- // page_cache_release(node->page[i]);
+ for (i = 0; i < node->tree->pages_per_bnode; i++)
+ if (node->page[i])
+ page_cache_release(node->page[i]);
kfree(node);
}
diff --git a/fs/hfs/brec.c b/fs/hfs/brec.c
index 92fb358..db240c5 100644
--- a/fs/hfs/brec.c
+++ b/fs/hfs/brec.c
@@ -132,13 +132,16 @@ skip:
hfs_bnode_write(node, entry, data_off + key_len, entry_len);
hfs_bnode_dump(node);
- if (new_node) {
- /* update parent key if we inserted a key
- * at the start of the first node
- */
- if (!rec && new_node != node)
- hfs_brec_update_parent(fd);
+ /*
+ * update parent key if we inserted a key
+ * at the start of the node and it is not the new node
+ */
+ if (!rec && new_node != node) {
+ hfs_bnode_read_key(node, fd->search_key, data_off + size);
+ hfs_brec_update_parent(fd);
+ }
+ if (new_node) {
hfs_bnode_put(fd->bnode);
if (!new_node->parent) {
hfs_btree_inc_height(tree);
@@ -167,9 +170,6 @@ skip:
goto again;
}
- if (!rec)
- hfs_brec_update_parent(fd);
-
return 0;
}
@@ -366,6 +366,8 @@ again:
if (IS_ERR(parent))
return PTR_ERR(parent);
__hfs_brec_find(parent, fd);
+ if (fd->record < 0)
+ return -ENOENT;
hfs_bnode_dump(parent);
rec = fd->record;
diff --git a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c
index 29da657..7d75904 100644
--- a/fs/hfsplus/bnode.c
+++ b/fs/hfsplus/bnode.c
@@ -446,7 +446,6 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
page_cache_release(page);
goto fail;
}
- page_cache_release(page);
node->page[i] = page;
}
@@ -556,11 +555,11 @@ node_error:
void hfs_bnode_free(struct hfs_bnode *node)
{
- //int i;
+ int i;
- //for (i = 0; i < node->tree->pages_per_bnode; i++)
- // if (node->page[i])
- // page_cache_release(node->page[i]);
+ for (i = 0; i < node->tree->pages_per_bnode; i++)
+ if (node->page[i])
+ page_cache_release(node->page[i]);
kfree(node);
}
diff --git a/fs/namei.c b/fs/namei.c
index 0d766d2..6551acb 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -434,6 +434,24 @@ static struct dentry * cached_lookup(struct dentry * parent, struct qstr * name,
return dentry;
}
+/**
+ * path_connected - Verify that a path->dentry is below path->mnt.mnt_root
+ * @path: nameidate to verify
+ *
+ * Rename can sometimes move a file or directory outside of a bind
+ * mount, path_connected allows those cases to be detected.
+ */
+static bool path_connected(const struct path *path)
+{
+ struct vfsmount *mnt = path->mnt;
+
+ /* Only bind mounts can have disconnected paths */
+ if (mnt->mnt_root == mnt->mnt_sb->s_root)
+ return true;
+
+ return is_subdir(path->dentry, mnt->mnt_root);
+}
+
/*
* Short-cut version of permission(), for calling by
* path_walk(), when dcache lock is held. Combines parts
@@ -754,7 +772,7 @@ int follow_down(struct path *path)
return 0;
}
-static __always_inline void follow_dotdot(struct nameidata *nd)
+static __always_inline int follow_dotdot(struct nameidata *nd)
{
set_root(nd);
@@ -771,6 +789,8 @@ static __always_inline void follow_dotdot(struct nameidata *nd)
nd->path.dentry = dget(nd->path.dentry->d_parent);
spin_unlock(&dcache_lock);
dput(old);
+ if (unlikely(!path_connected(&nd->path)))
+ return -ENOENT;
break;
}
spin_unlock(&dcache_lock);
@@ -788,6 +808,7 @@ static __always_inline void follow_dotdot(struct nameidata *nd)
nd->path.mnt = parent;
}
follow_mount(&nd->path);
+ return 0;
}
/*
@@ -905,7 +926,9 @@ static int __link_path_walk(const char *name, struct nameidata *nd)
case 2:
if (this.name[1] != '.')
break;
- follow_dotdot(nd);
+ err = follow_dotdot(nd);
+ if (err < 0)
+ goto out_nd_path_put;
inode = nd->path.dentry->d_inode;
/* fallthrough */
case 1:
@@ -960,7 +983,9 @@ last_component:
case 2:
if (this.name[1] != '.')
break;
- follow_dotdot(nd);
+ err = follow_dotdot(nd);
+ if (err < 0)
+ goto out_nd_path_put;
inode = nd->path.dentry->d_inode;
/* fallthrough */
case 1:
@@ -1022,6 +1047,7 @@ out_dput:
path_put_conditional(&next, nd);
break;
}
+out_nd_path_put:
path_put(&nd->path);
return_err:
return err;
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 71ee6f6..614446b 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -929,7 +929,7 @@ restart:
__func__);
}
nfs4_put_open_state(state);
- clear_bit(NFS4CLNT_RECLAIM_NOGRACE,
+ clear_bit(NFS_STATE_RECLAIM_NOGRACE,
&state->flags);
goto restart;
}
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 73db5a6..36c1edf 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -8,6 +8,7 @@
#include <linux/mempolicy.h>
#include <linux/swap.h>
#include <linux/swapops.h>
+#include <linux/security.h>
#include <asm/elf.h>
#include <asm/uaccess.h>
@@ -539,6 +540,7 @@ const struct file_operations proc_clear_refs_operations = {
struct pagemapread {
u64 __user *out, *end;
+ bool show_pfn;
};
#define PM_ENTRY_BYTES sizeof(u64)
@@ -589,14 +591,14 @@ static u64 swap_pte_to_pagemap_entry(pte_t pte)
return swp_type(e) | (swp_offset(e) << MAX_SWAPFILES_SHIFT);
}
-static u64 pte_to_pagemap_entry(pte_t pte)
+static u64 pte_to_pagemap_entry(struct pagemapread *pm, pte_t pte)
{
u64 pme = 0;
if (is_swap_pte(pte))
pme = PM_PFRAME(swap_pte_to_pagemap_entry(pte))
| PM_PSHIFT(PAGE_SHIFT) | PM_SWAP;
else if (pte_present(pte))
- pme = PM_PFRAME(pte_pfn(pte))
+ pme = (pm->show_pfn ? PM_PFRAME(pte_pfn(pte)) : 0)
| PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT;
return pme;
}
@@ -624,7 +626,7 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
if (vma && (vma->vm_start <= addr) &&
!is_vm_hugetlb_page(vma)) {
pte = pte_offset_map(pmd, addr);
- pfn = pte_to_pagemap_entry(*pte);
+ pfn = pte_to_pagemap_entry(pm, *pte);
/* unmap before userspace copy */
pte_unmap(pte);
}
@@ -695,6 +697,9 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
if (!count)
goto out_task;
+ /* do not disclose physical addresses: attack vector */
+ pm.show_pfn = !security_capable(file->f_cred, CAP_SYS_ADMIN);
+
mm = get_task_mm(task);
if (!mm)
goto out_task;
@@ -773,19 +778,9 @@ out:
return ret;
}
-static int pagemap_open(struct inode *inode, struct file *file)
-{
- /* do not disclose physical addresses to unprivileged
- userspace (closes a rowhammer attack vector) */
- if (!capable(CAP_SYS_ADMIN))
- return -EPERM;
- return 0;
-}
-
const struct file_operations proc_pagemap_operations = {
.llseek = mem_lseek, /* borrow this */
.read = pagemap_read,
- .open = pagemap_open,
};
#endif /* CONFIG_PROC_PAGE_MONITOR */
diff --git a/fs/splice.c b/fs/splice.c
index 1ef1c00..5c006c8b 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1123,7 +1123,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
long ret, bytes;
umode_t i_mode;
size_t len;
- int i, flags;
+ int i, flags, more;
/*
* We require the input being a regular file, as we don't want to
@@ -1166,6 +1166,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
* Don't block on output, we have to drain the direct pipe.
*/
sd->flags &= ~SPLICE_F_NONBLOCK;
+ more = sd->flags & SPLICE_F_MORE;
while (len) {
size_t read_len;
@@ -1179,6 +1180,15 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
sd->total_len = read_len;
/*
+ * If more data is pending, set SPLICE_F_MORE
+ * If this is the last data and SPLICE_F_MORE was not set
+ * initially, clears it.
+ */
+ if (read_len < len)
+ sd->flags |= SPLICE_F_MORE;
+ else if (!more)
+ sd->flags &= ~SPLICE_F_MORE;
+ /*
* NOTE: nonblocking mode only applies to the input. We
* must not do the output in nonblocking mode as then we
* could get stuck data in the internal pipe:
diff --git a/fs/xfs/xfs_attr_leaf.h b/fs/xfs/xfs_attr_leaf.h
index 9c7d22f..c782906 100644
--- a/fs/xfs/xfs_attr_leaf.h
+++ b/fs/xfs/xfs_attr_leaf.h
@@ -111,8 +111,15 @@ typedef struct xfs_attr_leaf_name_remote {
typedef struct xfs_attr_leafblock {
xfs_attr_leaf_hdr_t hdr; /* constant-structure header block */
xfs_attr_leaf_entry_t entries[1]; /* sorted on key, not name */
- xfs_attr_leaf_name_local_t namelist; /* grows from bottom of buf */
- xfs_attr_leaf_name_remote_t valuelist; /* grows from bottom of buf */
+ /*
+ * The rest of the block contains the following structures after the
+ * leaf entries, growing from the bottom up. The variables are never
+ * referenced and definining them can actually make gcc optimize away
+ * accesses to the 'entries' array above index 0 so don't do that.
+ *
+ * xfs_attr_leaf_name_local_t namelist;
+ * xfs_attr_leaf_name_remote_t valuelist;
+ */
} xfs_attr_leafblock_t;
/*
diff --git a/include/linux/security.h b/include/linux/security.h
index d40d23f..73ebc3f 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1733,7 +1733,7 @@ int security_capset(struct cred *new, const struct cred *old,
const kernel_cap_t *effective,
const kernel_cap_t *inheritable,
const kernel_cap_t *permitted);
-int security_capable(int cap);
+int security_capable(const struct cred *cred, int cap);
int security_real_capable(struct task_struct *tsk, int cap);
int security_real_capable_noaudit(struct task_struct *tsk, int cap);
int security_acct(struct file *file);
@@ -1938,9 +1938,9 @@ static inline int security_capset(struct cred *new,
return cap_capset(new, old, effective, inheritable, permitted);
}
-static inline int security_capable(int cap)
+static inline int security_capable(const struct cred *cred, int cap)
{
- return cap_capable(current, current_cred(), cap, SECURITY_CAP_AUDIT);
+ return cap_capable(current, cred, cap, SECURITY_CAP_AUDIT);
}
static inline int security_real_capable(struct task_struct *tsk, int cap)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ae77862..c282a2c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1765,7 +1765,8 @@ extern int skb_copy_datagram_iovec(const struct sk_buff *from,
int size);
extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
int hlen,
- struct iovec *iov);
+ struct iovec *iov,
+ int len);
extern int skb_copy_datagram_from_iovec(struct sk_buff *skb,
int offset,
const struct iovec *from,
diff --git a/include/net/inet_common.h b/include/net/inet_common.h
index 18c7732..1fb67ab 100644
--- a/include/net/inet_common.h
+++ b/include/net/inet_common.h
@@ -47,7 +47,8 @@ extern int inet_ctl_sock_create(struct sock **sk,
static inline void inet_ctl_sock_destroy(struct sock *sk)
{
- sk_release_kernel(sk);
+ if (sk)
+ sk_release_kernel(sk);
}
#endif
diff --git a/ipc/msg.c b/ipc/msg.c
index 779f762..94c6411 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -199,6 +199,15 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params)
return retval;
}
+ msq->q_stime = msq->q_rtime = 0;
+ msq->q_ctime = get_seconds();
+ msq->q_cbytes = msq->q_qnum = 0;
+ msq->q_qbytes = ns->msg_ctlmnb;
+ msq->q_lspid = msq->q_lrpid = 0;
+ INIT_LIST_HEAD(&msq->q_messages);
+ INIT_LIST_HEAD(&msq->q_receivers);
+ INIT_LIST_HEAD(&msq->q_senders);
+
/*
* ipc_addid() locks msq
*/
@@ -209,15 +218,6 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params)
return id;
}
- msq->q_stime = msq->q_rtime = 0;
- msq->q_ctime = get_seconds();
- msq->q_cbytes = msq->q_qnum = 0;
- msq->q_qbytes = ns->msg_ctlmnb;
- msq->q_lspid = msq->q_lrpid = 0;
- INIT_LIST_HEAD(&msq->q_messages);
- INIT_LIST_HEAD(&msq->q_receivers);
- INIT_LIST_HEAD(&msq->q_senders);
-
msg_unlock(msq);
return msq->q_perm.id;
diff --git a/ipc/sem.c b/ipc/sem.c
index b781007..fe3579f 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -264,6 +264,12 @@ static int newary(struct ipc_namespace *ns, struct ipc_params *params)
return retval;
}
+ sma->sem_base = (struct sem *) &sma[1];
+ INIT_LIST_HEAD(&sma->sem_pending);
+ INIT_LIST_HEAD(&sma->list_id);
+ sma->sem_nsems = nsems;
+ sma->sem_ctime = get_seconds();
+
id = ipc_addid(&sem_ids(ns), &sma->sem_perm, ns->sc_semmni);
if (id < 0) {
security_sem_free(sma);
@@ -272,11 +278,6 @@ static int newary(struct ipc_namespace *ns, struct ipc_params *params)
}
ns->used_sems += nsems;
- sma->sem_base = (struct sem *) &sma[1];
- INIT_LIST_HEAD(&sma->sem_pending);
- INIT_LIST_HEAD(&sma->list_id);
- sma->sem_nsems = nsems;
- sma->sem_ctime = get_seconds();
sem_unlock(sma);
return sma->sem_perm.id;
@@ -1295,16 +1296,27 @@ void exit_sem(struct task_struct *tsk)
rcu_read_lock();
un = list_entry_rcu(ulp->list_proc.next,
struct sem_undo, list_proc);
- if (&un->list_proc == &ulp->list_proc)
- semid = -1;
- else
- semid = un->semid;
+ if (&un->list_proc == &ulp->list_proc) {
+ /*
+ * We must wait for freeary() before freeing this ulp,
+ * in case we raced with last sem_undo. There is a small
+ * possibility where we exit while freeary() didn't
+ * finish unlocking sem_undo_list.
+ */
+ spin_unlock_wait(&ulp->lock);
+ rcu_read_unlock();
+ break;
+ }
+ spin_lock(&ulp->lock);
+ semid = un->semid;
+ spin_unlock(&ulp->lock);
rcu_read_unlock();
+ /* exit_sem raced with IPC_RMID, nothing to do */
if (semid == -1)
- break;
+ continue;
- sma = sem_lock_check(tsk->nsproxy->ipc_ns, un->semid);
+ sma = sem_lock_check(tsk->nsproxy->ipc_ns, semid);
/* exit_sem raced with IPC_RMID, nothing to do */
if (IS_ERR(sma))
diff --git a/ipc/shm.c b/ipc/shm.c
index d30732c..75cb87c 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -386,12 +386,6 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
if (IS_ERR(file))
goto no_file;
- id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
- if (id < 0) {
- error = id;
- goto no_id;
- }
-
shp->shm_cprid = task_tgid_vnr(current);
shp->shm_lprid = 0;
shp->shm_atim = shp->shm_dtim = 0;
@@ -399,6 +393,13 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
shp->shm_segsz = size;
shp->shm_nattch = 0;
shp->shm_file = file;
+
+ id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
+ if (id < 0) {
+ error = id;
+ goto no_id;
+ }
+
/*
* shmid gets reported as "inode#" in /proc/pid/maps.
* proc-ps tools use this. Changing this will break them.
diff --git a/ipc/util.c b/ipc/util.c
index 79ce84e..b6fe615 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -264,6 +264,10 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
rcu_read_lock();
spin_lock(&new->lock);
+ current_euid_egid(&euid, &egid);
+ new->cuid = new->uid = euid;
+ new->gid = new->cgid = egid;
+
err = idr_get_new(&ids->ipcs_idr, new, &id);
if (err) {
spin_unlock(&new->lock);
@@ -273,10 +277,6 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
ids->in_use++;
- current_euid_egid(&euid, &egid);
- new->cuid = new->uid = euid;
- new->gid = new->cgid = egid;
-
new->seq = ids->seq++;
if(ids->seq > ids->seq_max)
ids->seq = 0;
diff --git a/kernel/capability.c b/kernel/capability.c
index 8a944f5..771618c 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -305,7 +305,7 @@ int capable(int cap)
BUG();
}
- if (security_capable(cap) == 0) {
+ if (security_capable(current_cred(), cap) == 0) {
current->flags |= PF_SUPERPRIV;
return 1;
}
diff --git a/kernel/module.c b/kernel/module.c
index 4b270e6..04aa4f1 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -923,11 +923,15 @@ void symbol_put_addr(void *addr)
if (core_kernel_text(a))
return;
- /* module_text_address is safe here: we're supposed to have reference
- * to module from symbol_get, so it can't go away. */
+ /*
+ * Even though we hold a reference on the module; we still need to
+ * disable preemption in order to safely traverse the data structure.
+ */
+ preempt_disable();
modaddr = __module_text_address(a);
BUG_ON(!modaddr);
module_put(modaddr);
+ preempt_enable();
}
EXPORT_SYMBOL_GPL(symbol_put_addr);
diff --git a/lib/devres.c b/lib/devres.c
index 72c8909..e4891d5 100644
--- a/lib/devres.c
+++ b/lib/devres.c
@@ -338,7 +338,7 @@ void pcim_iounmap_regions(struct pci_dev *pdev, u16 mask)
if (!iomap)
return;
- for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+ for (i = 0; i < PCIM_IOMAP_MAX; i++) {
if (!(mask & (1 << i)))
continue;
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index b435d1f..d81312f 100644
--- a/mm/hugetlb.c
More information about the unionfs-cvs
mailing list