Re: [PATCH] capabilities: introduce per-process capability bounding set (v10)

2007-12-05 Thread Andrew Morgan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 KaiGai Kohei wrote: Andrew Morgan wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 KaiGai Kohei wrote: +if (!!cap_issubset(*inheritable, + cap_combine(target-cap_inheritable, + current-cap_bset))) {

[PATCH 02/28] KEYS: Check starting keyring as part of search [try #2]

2007-12-05 Thread David Howells
Check the starting keyring as part of the search to (a) see if that is what we're searching for, and (b) to check it is still valid for searching. The scenario: User in process A does things that cause things to be created in its process session keyring. The user then does an su to another user

[PATCH 03/28] KEYS: Allow the callout data to be passed as a blob rather than a string [try #2]

2007-12-05 Thread David Howells
Allow the callout data to be passed as a blob rather than a string for internal kernel services that call any request_key_*() interface other than request_key(). request_key() itself still takes a NUL-terminated string. The functions that change are: request_key_with_auxdata()

[PATCH 28/28] FS-Cache: Make kAFS use FS-Cache [try #2]

2007-12-05 Thread David Howells
The attached patch makes the kAFS filesystem in fs/afs/ use FS-Cache, and through it any attached caches. The kAFS filesystem will use caching automatically if it's available. Signed-Off-By: David Howells [EMAIL PROTECTED] --- fs/Kconfig |8 + fs/afs/Makefile|3

[PATCH 23/28] AFS: Add TestSetPageError() [try #2]

2007-12-05 Thread David Howells
Add a TestSetPageError() macro to the suite of page flag manipulators. This can be used by AFS to prevent over-excision of rejected writes from the page cache. Signed-off-by: David Howells [EMAIL PROTECTED] --- include/linux/page-flags.h |1 + 1 files changed, 1 insertions(+), 0

[PATCH 13/28] CacheFiles: Add missing copy_page export for ia64 [try #2]

2007-12-05 Thread David Howells
This one-line patch fixes the missing export of copy_page introduced by the cachefile patches. This patch is not yet upstream, but is required for cachefile on ia64. It will be pushed upstream when cachefile goes upstream. Signed-off-by: Prarit Bhargava [EMAIL PROTECTED] Signed-off-by: David

[PATCH 21/28] NFS: Display local caching state [try #2]

2007-12-05 Thread David Howells
Display the local caching state in /proc/fs/nfsfs/volumes. Signed-off-by: David Howells [EMAIL PROTECTED] --- fs/nfs/client.c |7 --- fs/nfs/fscache.h | 15 +++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index

[PATCH 20/28] NFS: Configuration and mount option changes to enable local caching on NFS [try #2]

2007-12-05 Thread David Howells
Changes to the kernel configuration defintions and to the NFS mount options to allow the local caching support added by the previous patch to be enabled. Signed-off-by: David Howells [EMAIL PROTECTED] --- fs/Kconfig|8 fs/nfs/client.c |2 ++ fs/nfs/internal.h |1 +

[PATCH 19/28] NFS: Use local caching [try #2]

2007-12-05 Thread David Howells
The attached patch makes it possible for the NFS filesystem to make use of the network filesystem local caching service (FS-Cache). To be able to use this, an updated mount program is required. This can be obtained from: http://people.redhat.com/steved/fscache/util-linux/ To mount an

[PATCH 16/28] CacheFiles: Permit the page lock state to be monitored [try #2]

2007-12-05 Thread David Howells
Add a function to install a monitor on the page lock waitqueue for a particular page, thus allowing the page being unlocked to be detected. This is used by CacheFiles to detect read completion on a page in the backing filesystem so that it can then copy the data to the waiting netfs page.

[PATCH 09/28] FS-Cache: Release page-private after failed readahead [try #2]

2007-12-05 Thread David Howells
The attached patch causes read_cache_pages() to release page-private data on a page for which add_to_page_cache() fails or the filler function fails. This permits pages with caching references associated with them to be cleaned up. The invalidatepage() address space op is called (indirectly) to

[PATCH 01/28] KEYS: Increase the payload size when instantiating a key [try #2]

2007-12-05 Thread David Howells
Increase the size of a payload that can be used to instantiate a key in add_key() and keyctl_instantiate_key(). This permits huge CIFS SPNEGO blobs to be passed around. The limit is raised to 1MB. If kmalloc() can't allocate a buffer of sufficient size, vmalloc() will be tried instead.

[PATCH 05/28] Security: Change current-fs[ug]id to current_fs[ug]id() [try #2]

2007-12-05 Thread David Howells
Change current-fs[ug]id to current_fs[ug]id() so that fsgid and fsuid can be separated from the task_struct. Signed-off-by: David Howells [EMAIL PROTECTED] --- arch/ia64/kernel/perfmon.c|4 ++-- arch/powerpc/platforms/cell/spufs/inode.c |4 ++--

[PATCH 0/7] Permit filesystem local caching

2007-12-05 Thread David Howells
These patches add local caching for network filesystems such as NFS and AFS. The patches can roughly be broken down into a number of sets: (*) 01-keys-inc-payload.diff (*) 02-keys-search-keyring.diff (*) 03-keys-callout-blob.diff Three patches to the keyring code made to help the

[PATCH 24/28] AFS: Add a function to excise a rejected write from the pagecache [try #2]

2007-12-05 Thread David Howells
Add a function - cancel_rejected_write() - to excise a rejected write from the pagecache. This function is related to the truncation family of routines. It permits the pages modified by a network filesystem client (such as AFS) to be excised and discarded from the pagecache if the attempt to

[PATCH 22/28] fcrypt endianness misannotations [try #2]

2007-12-05 Thread David Howells
Signed-off-by: Al Viro [EMAIL PROTECTED] --- crypto/fcrypt.c | 88 --- 1 files changed, 44 insertions(+), 44 deletions(-) diff --git a/crypto/fcrypt.c b/crypto/fcrypt.c index d161949..a32cb68 100644 --- a/crypto/fcrypt.c +++

[PATCH 15/28] CacheFiles: Add a hook to write a single page of data to an inode [try #2]

2007-12-05 Thread David Howells
Add an address space operation to write one single page of data to an inode at a page-aligned location (thus permitting the implementation to be highly optimised). The data source is a single page. This is used by CacheFiles to store the contents of netfs pages into their backing file pages.

[PATCH 1/7] KEYS: Increase the payload size when instantiating a key

2007-12-05 Thread David Howells
Increase the size of a payload that can be used to instantiate a key in add_key() and keyctl_instantiate_key(). This permits huge CIFS SPNEGO blobs to be passed around. The limit is raised to 1MB. If kmalloc() can't allocate a buffer of sufficient size, vmalloc() will be tried instead.

[PATCH 2/7] KEYS: Check starting keyring as part of search

2007-12-05 Thread David Howells
Check the starting keyring as part of the search to (a) see if that is what we're searching for, and (b) to check it is still valid for searching. The scenario: User in process A does things that cause things to be created in its process session keyring. The user then does an su to another user

[PATCH 11/28] FS-Cache: Provide an add_wait_queue_tail() function [try #2]

2007-12-05 Thread David Howells
Provide an add_wait_queue_tail() function to add a waiter to the back of a wait queue instead of the front. Signed-off-by: David Howells [EMAIL PROTECTED] --- include/linux/wait.h |2 ++ kernel/wait.c| 18 ++ 2 files changed, 20 insertions(+), 0 deletions(-) diff

[PATCH 10/28] FS-Cache: Recruit a couple of page flags for cache management [try #2]

2007-12-05 Thread David Howells
Recruit a couple of page flags to aid in cache management. The following extra flags are defined: (1) PG_fscache (PG_owner_priv_2) The marked page is backed by a local cache and is pinning resources in the cache driver. (2) PG_fscache_write (PG_owner_priv_3) The marked page

Re: [PATCH 4/7] KEYS: Add keyctl function to get a security label

2007-12-05 Thread Stephen Smalley
On Wed, 2007-12-05 at 12:12 -0800, Casey Schaufler wrote: --- David Howells [EMAIL PROTECTED] wrote: Add a keyctl() function to get the security label of a key. The following is added to Documentation/keys.txt: (*) Get the LSM security context attached to a key. long

[PATCH 3/7] KEYS: Allow the callout data to be passed as a blob rather than a string

2007-12-05 Thread David Howells
Allow the callout data to be passed as a blob rather than a string for internal kernel services that call any request_key_*() interface other than request_key(). request_key() itself still takes a NUL-terminated string. The functions that change are: request_key_with_auxdata()

[PATCH 5/7] Security: Change current-fs[ug]id to current_fs[ug]id()

2007-12-05 Thread David Howells
Change current-fs[ug]id to current_fs[ug]id() so that fsgid and fsuid can be separated from the task_struct. Signed-off-by: David Howells [EMAIL PROTECTED] --- arch/ia64/kernel/perfmon.c|4 ++-- arch/powerpc/platforms/cell/spufs/inode.c |4 ++--

[PATCH 04/28] KEYS: Add keyctl function to get a security label [try #2]

2007-12-05 Thread David Howells
Add a keyctl() function to get the security label of a key. The following is added to Documentation/keys.txt: (*) Get the LSM security context attached to a key. long keyctl(KEYCTL_GET_SECURITY, key_serial_t key, char *buffer, size_t buflen) This function

Re: [PATCH 4/7] KEYS: Add keyctl function to get a security label

2007-12-05 Thread Casey Schaufler
--- David Howells [EMAIL PROTECTED] wrote: Add a keyctl() function to get the security label of a key. The following is added to Documentation/keys.txt: (*) Get the LSM security context attached to a key. long keyctl(KEYCTL_GET_SECURITY, key_serial_t key, char *buffer,

[PATCH 25/28] AFS: Improve handling of a rejected writeback [try #2]

2007-12-05 Thread David Howells
Improve the handling of the case of a server rejecting an attempt to write back a cached write. AFS operates a write-back cache, so the following sequence of events can theoretically occur: CLIENT 1CLIENT 2 === ===

[PATCH 26/28] AF_RXRPC: Save the operation ID for debugging [try #2]

2007-12-05 Thread David Howells
Save the operation ID to be used with a call that we're making for display through /proc/net/rxrpc_calls. This helps debugging stuck operations as we then know what they are. Signed-off-by: David Howells [EMAIL PROTECTED] --- fs/afs/fsclient.c | 32 +++-

Re: [PATCH] VM/Security: add security hook to do_brk

2007-12-05 Thread James Morris
On Tue, 4 Dec 2007, Alan Cox wrote: On Tue, Dec 04, 2007 at 11:06:55AM -0500, Eric Paris wrote: Given a specifically crafted binary do_brk() can be used to get low pages available in userspace virtually memory and can thus be used to circumvent the mmap_min_addr low memory protection. Add

[PATCH 27/28] AFS: Implement shared-writable mmap [try #2]

2007-12-05 Thread David Howells
Implement shared-writable mmap for AFS. The key with which to access the file is obtained from the VMA at the point where the PTE is made writable by the page_mkwrite() VMA op and cached in the affected page. If there's an outstanding write on the page made with a different key, then

Re: [PATCH 4/7] KEYS: Add keyctl function to get a security label

2007-12-05 Thread David Howells
Stephen Smalley [EMAIL PROTECTED] wrote: inode_getsecurity and getprocattr directly return the strings. Admittedly, the whole interface could be cleaned up and made far more consistent, but I don't think he necessarily has to go through the getsecid + secid_to_secctx sequence if he only wants

Re: [PATCH 4/7] KEYS: Add keyctl function to get a security label

2007-12-05 Thread Casey Schaufler
--- David Howells [EMAIL PROTECTED] wrote: Stephen Smalley [EMAIL PROTECTED] wrote: inode_getsecurity and getprocattr directly return the strings. Admittedly, the whole interface could be cleaned up and made far more consistent, but I don't think he necessarily has to go through the

Re: [PATCH] capabilities: introduce per-process capability bounding set (v10)

2007-12-05 Thread KaiGai Kohei
(Thus, the correct check says no 'new' pI bits can be outside cap_bset.) If this condition intends to dominate 'new' pI bits by 'old' pI bits masked with bounding set, we should not apply cap_combine() here. I think applying cap_intersect() is correct for the purpose. That would have been my

Re: [PATCH] capabilities: introduce per-process capability bounding set (v10)

2007-12-05 Thread KaiGai Kohei
Andrew Morgan wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 KaiGai Kohei wrote: Andrew Morgan wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 KaiGai Kohei wrote: +if (!!cap_issubset(*inheritable, + cap_combine(target-cap_inheritable, +

Re: [PATCH] capabilities: introduce per-process capability bounding set (v10)

2007-12-05 Thread Andrew Morgan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 KaiGai Kohei wrote: BTW, could you tell me your intention about pam_cap.c is implemented with pam_sm_authenticate() and pam_sm_setcred()? I think it can be done with pam_sm_open_session(), and this approach enables to reduce the iteration of