lkml.org 
[lkml]   [2012]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [rfc] fcntl: Add F_GETOWNER_UIDS option
On 03/26, Cyrill Gorcunov wrote:
>
> +#ifdef CONFIG_CHECKPOINT_RESTORE
> +static int f_getowner_uids(struct file *filp, unsigned long arg)
> +{
> + struct user_namespace *user_ns = current_user_ns();
> + const struct cred *cred = current_cred();
> + uid_t * __user dst = (void * __user)arg;
> + uid_t src[2];
> + int err;
> +
> + read_lock(&filp->f_owner.lock);
> + src[0] = filp->f_owner.uid;
> + src[1] = filp->f_owner.euid;
> + read_unlock(&filp->f_owner.lock);
> +
> + src[0] = user_ns_map_uid(user_ns, cred, src[0]);
> + src[1] = user_ns_map_uid(user_ns, cred, src[1]);

Why?

In this case user_ns_map_uid() is "nop", it should always return
the last arg, no?

Oleg.



\
 
 \ /
  Last update: 2012-03-26 20:21    [W:0.072 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site