diff --git a/fs/fcntl.c b/fs/fcntl.c index 58b285a6e..38f334a5f 100755 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -100,8 +100,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg) return error; } -void __f_setown(struct file *filp, struct pid *pid, enum pid_type type, - int force) +static void f_modown(struct file *filp, struct pid *pid, enum pid_type type, + int force) { write_lock_irq(&filp->f_owner.lock); if (force || !filp->f_owner.pid) { @@ -111,13 +111,19 @@ void __f_setown(struct file *filp, struct pid *pid, enum pid_type type, if (pid) { const struct cred *cred = current_cred(); - security_file_set_fowner(filp); filp->f_owner.uid = cred->uid; filp->f_owner.euid = cred->euid; } } write_unlock_irq(&filp->f_owner.lock); } + +void __f_setown(struct file *filp, struct pid *pid, enum pid_type type, + int force) +{ + security_file_set_fowner(filp); + f_modown(filp, pid, type, force); +} EXPORT_SYMBOL(__f_setown); int f_setown(struct file *filp, unsigned long arg, int force) @@ -153,7 +159,7 @@ EXPORT_SYMBOL(f_setown); void f_delown(struct file *filp) { - __f_setown(filp, NULL, PIDTYPE_TGID, 1); + f_modown(filp, NULL, PIDTYPE_TGID, 1); } pid_t f_getown(struct file *filp)