aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fcntl.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2008-12-24 19:40:09 -0500
committerJames Morris <jmorris@namei.org>2008-12-24 19:40:09 -0500
commitcbacc2c7f066a1e01b33b0e27ae5efbf534bc2db (patch)
tree90d1093131d2a3543a8b3b1f3364e7c6f4081a93 /fs/fcntl.c
parent4a6908a3a050aacc9c3a2f36b276b46c0629ad91 (diff)
parent74192246910ff4fb95309ba1a683215644beeb62 (diff)
Merge branch 'next' into for-linus
Diffstat (limited to 'fs/fcntl.c')
-rw-r--r--fs/fcntl.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/fs/fcntl.c b/fs/fcntl.c
index 549daf8005fb..cdc141946724 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -212,13 +212,14 @@ static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
212int __f_setown(struct file *filp, struct pid *pid, enum pid_type type, 212int __f_setown(struct file *filp, struct pid *pid, enum pid_type type,
213 int force) 213 int force)
214{ 214{
215 const struct cred *cred = current_cred();
215 int err; 216 int err;
216 217
217 err = security_file_set_fowner(filp); 218 err = security_file_set_fowner(filp);
218 if (err) 219 if (err)
219 return err; 220 return err;
220 221
221 f_modown(filp, pid, type, current->uid, current->euid, force); 222 f_modown(filp, pid, type, cred->uid, cred->euid, force);
222 return 0; 223 return 0;
223} 224}
224EXPORT_SYMBOL(__f_setown); 225EXPORT_SYMBOL(__f_setown);
@@ -407,10 +408,17 @@ static const long band_table[NSIGPOLL] = {
407static inline int sigio_perm(struct task_struct *p, 408static inline int sigio_perm(struct task_struct *p,
408 struct fown_struct *fown, int sig) 409 struct fown_struct *fown, int sig)
409{ 410{
410 return (((fown->euid == 0) || 411 const struct cred *cred;
411 (fown->euid == p->suid) || (fown->euid == p->uid) || 412 int ret;
412 (fown->uid == p->suid) || (fown->uid == p->uid)) && 413
413 !security_file_send_sigiotask(p, fown, sig)); 414 rcu_read_lock();
415 cred = __task_cred(p);
416 ret = ((fown->euid == 0 ||
417 fown->euid == cred->suid || fown->euid == cred->uid ||
418 fown->uid == cred->suid || fown->uid == cred->uid) &&
419 !security_file_send_sigiotask(p, fown, sig));
420 rcu_read_unlock();
421 return ret;
414} 422}
415 423
416static void send_sigio_to_task(struct task_struct *p, 424static void send_sigio_to_task(struct task_struct *p,