diff options
Diffstat (limited to 'arch/ia64/kernel/perfmon.c')
-rw-r--r-- | arch/ia64/kernel/perfmon.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 6543a5547c84..dd38db46a77a 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -2220,8 +2220,8 @@ pfm_alloc_file(pfm_context_t *ctx) | |||
2220 | DPRINT(("new inode ino=%ld @%p\n", inode->i_ino, inode)); | 2220 | DPRINT(("new inode ino=%ld @%p\n", inode->i_ino, inode)); |
2221 | 2221 | ||
2222 | inode->i_mode = S_IFCHR|S_IRUGO; | 2222 | inode->i_mode = S_IFCHR|S_IRUGO; |
2223 | inode->i_uid = current->fsuid; | 2223 | inode->i_uid = current_fsuid(); |
2224 | inode->i_gid = current->fsgid; | 2224 | inode->i_gid = current_fsgid(); |
2225 | 2225 | ||
2226 | sprintf(name, "[%lu]", inode->i_ino); | 2226 | sprintf(name, "[%lu]", inode->i_ino); |
2227 | this.name = name; | 2227 | this.name = name; |
@@ -2399,22 +2399,25 @@ error_kmem: | |||
2399 | static int | 2399 | static int |
2400 | pfm_bad_permissions(struct task_struct *task) | 2400 | pfm_bad_permissions(struct task_struct *task) |
2401 | { | 2401 | { |
2402 | uid_t uid = current_uid(); | ||
2403 | gid_t gid = current_gid(); | ||
2404 | |||
2402 | /* inspired by ptrace_attach() */ | 2405 | /* inspired by ptrace_attach() */ |
2403 | DPRINT(("cur: uid=%d gid=%d task: euid=%d suid=%d uid=%d egid=%d sgid=%d\n", | 2406 | DPRINT(("cur: uid=%d gid=%d task: euid=%d suid=%d uid=%d egid=%d sgid=%d\n", |
2404 | current->uid, | 2407 | uid, |
2405 | current->gid, | 2408 | gid, |
2406 | task->euid, | 2409 | task->euid, |
2407 | task->suid, | 2410 | task->suid, |
2408 | task->uid, | 2411 | task->uid, |
2409 | task->egid, | 2412 | task->egid, |
2410 | task->sgid)); | 2413 | task->sgid)); |
2411 | 2414 | ||
2412 | return ((current->uid != task->euid) | 2415 | return (uid != task->euid) |
2413 | || (current->uid != task->suid) | 2416 | || (uid != task->suid) |
2414 | || (current->uid != task->uid) | 2417 | || (uid != task->uid) |
2415 | || (current->gid != task->egid) | 2418 | || (gid != task->egid) |
2416 | || (current->gid != task->sgid) | 2419 | || (gid != task->sgid) |
2417 | || (current->gid != task->gid)) && !capable(CAP_SYS_PTRACE); | 2420 | || (gid != task->gid)) && !capable(CAP_SYS_PTRACE); |
2418 | } | 2421 | } |
2419 | 2422 | ||
2420 | static int | 2423 | static int |