2012-02-07 13:02:16

by Steve Dickson

[permalink] [raw]
Subject: [PATCH] NFS: Make keys writable on the idmap keyring.

To take advantage of the "Allow special keyrings to be
cleared" keyring patch the NFS keyring has to be writeable.

Signed-off-by: Steve Dickson <[email protected]>
---
fs/nfs/idmap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index a1bbf77..1d88cdb 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -269,7 +269,7 @@ static ssize_t nfs_idmap_request_key(const char *name, size_t namelen,
}

rcu_read_lock();
- rkey->perm |= KEY_USR_VIEW;
+ rkey->perm |= KEY_USR_VIEW|KEY_USR_WRITE;

ret = key_validate(rkey);
if (ret < 0)
--
1.7.7.5



2012-02-07 23:29:45

by James Morris

[permalink] [raw]
Subject: Re: [PATCH] NFS: Make keys writable on the idmap keyring.

Should this go in via the NFS tree? I can put it into the security tree
otherwise.


On Tue, 7 Feb 2012, Steve Dickson wrote:

> To take advantage of the "Allow special keyrings to be
> cleared" keyring patch the NFS keyring has to be writeable.
>
> Signed-off-by: Steve Dickson <[email protected]>
> ---
> fs/nfs/idmap.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
> index a1bbf77..1d88cdb 100644
> --- a/fs/nfs/idmap.c
> +++ b/fs/nfs/idmap.c
> @@ -269,7 +269,7 @@ static ssize_t nfs_idmap_request_key(const char *name, size_t namelen,
> }
>
> rcu_read_lock();
> - rkey->perm |= KEY_USR_VIEW;
> + rkey->perm |= KEY_USR_VIEW|KEY_USR_WRITE;
>
> ret = key_validate(rkey);
> if (ret < 0)
> --
> 1.7.7.5
>

--
James Morris
<[email protected]>

2012-02-08 10:33:37

by David Howells

[permalink] [raw]
Subject: Re: [Keyrings] [PATCH] NFS: Make keys writable on the idmap keyring.

Steve Dickson <[email protected]> wrote:

> To take advantage of the "Allow special keyrings to be
> cleared" keyring patch the NFS keyring has to be writeable.

That's not true.

I'll push the "Allow special keyrings to be cleared" keyring patch to James
now.

David

2012-02-08 16:34:48

by Steve Dickson

[permalink] [raw]
Subject: Re: [PATCH] NFS: Make keys writable on the idmap keyring.

I'm indifferent... as long as it gets in...

Personally I thought it should been be part of David's
"KEYS: Allow special keyrings to be cleared" patch
since NFS can not use that feature unless the
key is writable...

steved.

On 02/07/2012 06:29 PM, James Morris wrote:
> Should this go in via the NFS tree? I can put it into the security tree
> otherwise.
>
>
> On Tue, 7 Feb 2012, Steve Dickson wrote:
>
>> To take advantage of the "Allow special keyrings to be
>> cleared" keyring patch the NFS keyring has to be writeable.
>>
>> Signed-off-by: Steve Dickson <[email protected]>
>> ---
>> fs/nfs/idmap.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
>> index a1bbf77..1d88cdb 100644
>> --- a/fs/nfs/idmap.c
>> +++ b/fs/nfs/idmap.c
>> @@ -269,7 +269,7 @@ static ssize_t nfs_idmap_request_key(const char *name, size_t namelen,
>> }
>>
>> rcu_read_lock();
>> - rkey->perm |= KEY_USR_VIEW;
>> + rkey->perm |= KEY_USR_VIEW|KEY_USR_WRITE;
>>
>> ret = key_validate(rkey);
>> if (ret < 0)
>> --
>> 1.7.7.5
>>
>