diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/audit.c | 2 | ||||
-rw-r--r-- | kernel/cpuset.c | 14 | ||||
-rw-r--r-- | kernel/exit.c | 2 | ||||
-rw-r--r-- | kernel/kfifo.c | 4 | ||||
-rw-r--r-- | kernel/power/swsusp.c | 7 | ||||
-rw-r--r-- | kernel/signal.c | 42 |
6 files changed, 49 insertions, 22 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 83096b67510a..aefa73a8a586 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -560,7 +560,7 @@ static void audit_buffer_free(struct audit_buffer *ab) | |||
560 | } | 560 | } |
561 | 561 | ||
562 | static struct audit_buffer * audit_buffer_alloc(struct audit_context *ctx, | 562 | static struct audit_buffer * audit_buffer_alloc(struct audit_context *ctx, |
563 | unsigned int __nocast gfp_mask, int type) | 563 | gfp_t gfp_mask, int type) |
564 | { | 564 | { |
565 | unsigned long flags; | 565 | unsigned long flags; |
566 | struct audit_buffer *ab = NULL; | 566 | struct audit_buffer *ab = NULL; |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 6a6e87b2f2fd..28176d083f7b 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -968,8 +968,6 @@ static ssize_t cpuset_common_file_read(struct file *file, char __user *buf, | |||
968 | char *page; | 968 | char *page; |
969 | ssize_t retval = 0; | 969 | ssize_t retval = 0; |
970 | char *s; | 970 | char *s; |
971 | char *start; | ||
972 | ssize_t n; | ||
973 | 971 | ||
974 | if (!(page = (char *)__get_free_page(GFP_KERNEL))) | 972 | if (!(page = (char *)__get_free_page(GFP_KERNEL))) |
975 | return -ENOMEM; | 973 | return -ENOMEM; |
@@ -999,15 +997,7 @@ static ssize_t cpuset_common_file_read(struct file *file, char __user *buf, | |||
999 | *s++ = '\n'; | 997 | *s++ = '\n'; |
1000 | *s = '\0'; | 998 | *s = '\0'; |
1001 | 999 | ||
1002 | start = page + *ppos; | 1000 | retval = simple_read_from_buffer(buf, nbytes, ppos, page, s - page); |
1003 | n = s - start; | ||
1004 | |||
1005 | /* Do nothing if *ppos is at the eof or beyond the eof. */ | ||
1006 | if (n <= 0) | ||
1007 | goto out; | ||
1008 | |||
1009 | retval = n - copy_to_user(buf, start, min(n, nbytes)); | ||
1010 | *ppos += retval; | ||
1011 | out: | 1001 | out: |
1012 | free_page((unsigned long)page); | 1002 | free_page((unsigned long)page); |
1013 | return retval; | 1003 | return retval; |
@@ -1680,7 +1670,7 @@ static const struct cpuset *nearest_exclusive_ancestor(const struct cpuset *cs) | |||
1680 | * GFP_USER - only nodes in current tasks mems allowed ok. | 1670 | * GFP_USER - only nodes in current tasks mems allowed ok. |
1681 | **/ | 1671 | **/ |
1682 | 1672 | ||
1683 | int cpuset_zone_allowed(struct zone *z, unsigned int __nocast gfp_mask) | 1673 | int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) |
1684 | { | 1674 | { |
1685 | int node; /* node that zone z is on */ | 1675 | int node; /* node that zone z is on */ |
1686 | const struct cpuset *cs; /* current cpuset ancestors */ | 1676 | const struct cpuset *cs; /* current cpuset ancestors */ |
diff --git a/kernel/exit.c b/kernel/exit.c index ee6d8b8abef5..43077732619b 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -1203,7 +1203,7 @@ static int wait_task_stopped(task_t *p, int delayed_group_leader, int noreap, | |||
1203 | 1203 | ||
1204 | exit_code = p->exit_code; | 1204 | exit_code = p->exit_code; |
1205 | if (unlikely(!exit_code) || | 1205 | if (unlikely(!exit_code) || |
1206 | unlikely(p->state > TASK_STOPPED)) | 1206 | unlikely(p->state & TASK_TRACED)) |
1207 | goto bail_ref; | 1207 | goto bail_ref; |
1208 | return wait_noreap_copyout(p, pid, uid, | 1208 | return wait_noreap_copyout(p, pid, uid, |
1209 | why, (exit_code << 8) | 0x7f, | 1209 | why, (exit_code << 8) | 0x7f, |
diff --git a/kernel/kfifo.c b/kernel/kfifo.c index 179baafcdd96..64ab045c3d9d 100644 --- a/kernel/kfifo.c +++ b/kernel/kfifo.c | |||
@@ -36,7 +36,7 @@ | |||
36 | * struct kfifo with kfree(). | 36 | * struct kfifo with kfree(). |
37 | */ | 37 | */ |
38 | struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, | 38 | struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, |
39 | unsigned int __nocast gfp_mask, spinlock_t *lock) | 39 | gfp_t gfp_mask, spinlock_t *lock) |
40 | { | 40 | { |
41 | struct kfifo *fifo; | 41 | struct kfifo *fifo; |
42 | 42 | ||
@@ -64,7 +64,7 @@ EXPORT_SYMBOL(kfifo_init); | |||
64 | * | 64 | * |
65 | * The size will be rounded-up to a power of 2. | 65 | * The size will be rounded-up to a power of 2. |
66 | */ | 66 | */ |
67 | struct kfifo *kfifo_alloc(unsigned int size, unsigned int __nocast gfp_mask, spinlock_t *lock) | 67 | struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, spinlock_t *lock) |
68 | { | 68 | { |
69 | unsigned char *buffer; | 69 | unsigned char *buffer; |
70 | struct kfifo *ret; | 70 | struct kfifo *ret; |
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index acf79ac1cb6d..2d5c45676442 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c | |||
@@ -1095,7 +1095,7 @@ static inline void eat_page(void *page) | |||
1095 | *eaten_memory = c; | 1095 | *eaten_memory = c; |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | static unsigned long get_usable_page(unsigned gfp_mask) | 1098 | unsigned long get_usable_page(unsigned gfp_mask) |
1099 | { | 1099 | { |
1100 | unsigned long m; | 1100 | unsigned long m; |
1101 | 1101 | ||
@@ -1109,7 +1109,7 @@ static unsigned long get_usable_page(unsigned gfp_mask) | |||
1109 | return m; | 1109 | return m; |
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | static void free_eaten_memory(void) | 1112 | void free_eaten_memory(void) |
1113 | { | 1113 | { |
1114 | unsigned long m; | 1114 | unsigned long m; |
1115 | void **c; | 1115 | void **c; |
@@ -1481,11 +1481,12 @@ static int read_suspend_image(void) | |||
1481 | /* Allocate memory for the image and read the data from swap */ | 1481 | /* Allocate memory for the image and read the data from swap */ |
1482 | 1482 | ||
1483 | error = check_pagedir(pagedir_nosave); | 1483 | error = check_pagedir(pagedir_nosave); |
1484 | free_eaten_memory(); | 1484 | |
1485 | if (!error) | 1485 | if (!error) |
1486 | error = data_read(pagedir_nosave); | 1486 | error = data_read(pagedir_nosave); |
1487 | 1487 | ||
1488 | if (error) { /* We fail cleanly */ | 1488 | if (error) { /* We fail cleanly */ |
1489 | free_eaten_memory(); | ||
1489 | for_each_pbe (p, pagedir_nosave) | 1490 | for_each_pbe (p, pagedir_nosave) |
1490 | if (p->address) { | 1491 | if (p->address) { |
1491 | free_page(p->address); | 1492 | free_page(p->address); |
diff --git a/kernel/signal.c b/kernel/signal.c index 5a274705ba19..50c992643771 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -262,7 +262,7 @@ next_signal(struct sigpending *pending, sigset_t *mask) | |||
262 | return sig; | 262 | return sig; |
263 | } | 263 | } |
264 | 264 | ||
265 | static struct sigqueue *__sigqueue_alloc(struct task_struct *t, unsigned int __nocast flags, | 265 | static struct sigqueue *__sigqueue_alloc(struct task_struct *t, gfp_t flags, |
266 | int override_rlimit) | 266 | int override_rlimit) |
267 | { | 267 | { |
268 | struct sigqueue *q = NULL; | 268 | struct sigqueue *q = NULL; |
@@ -578,7 +578,8 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) | |||
578 | * is to alert stop-signal processing code when another | 578 | * is to alert stop-signal processing code when another |
579 | * processor has come along and cleared the flag. | 579 | * processor has come along and cleared the flag. |
580 | */ | 580 | */ |
581 | tsk->signal->flags |= SIGNAL_STOP_DEQUEUED; | 581 | if (!(tsk->signal->flags & SIGNAL_GROUP_EXIT)) |
582 | tsk->signal->flags |= SIGNAL_STOP_DEQUEUED; | ||
582 | } | 583 | } |
583 | if ( signr && | 584 | if ( signr && |
584 | ((info->si_code & __SI_MASK) == __SI_TIMER) && | 585 | ((info->si_code & __SI_MASK) == __SI_TIMER) && |
@@ -1192,6 +1193,40 @@ kill_proc_info(int sig, struct siginfo *info, pid_t pid) | |||
1192 | return error; | 1193 | return error; |
1193 | } | 1194 | } |
1194 | 1195 | ||
1196 | /* like kill_proc_info(), but doesn't use uid/euid of "current" */ | ||
1197 | int kill_proc_info_as_uid(int sig, struct siginfo *info, pid_t pid, | ||
1198 | uid_t uid, uid_t euid) | ||
1199 | { | ||
1200 | int ret = -EINVAL; | ||
1201 | struct task_struct *p; | ||
1202 | |||
1203 | if (!valid_signal(sig)) | ||
1204 | return ret; | ||
1205 | |||
1206 | read_lock(&tasklist_lock); | ||
1207 | p = find_task_by_pid(pid); | ||
1208 | if (!p) { | ||
1209 | ret = -ESRCH; | ||
1210 | goto out_unlock; | ||
1211 | } | ||
1212 | if ((!info || ((unsigned long)info != 1 && | ||
1213 | (unsigned long)info != 2 && SI_FROMUSER(info))) | ||
1214 | && (euid != p->suid) && (euid != p->uid) | ||
1215 | && (uid != p->suid) && (uid != p->uid)) { | ||
1216 | ret = -EPERM; | ||
1217 | goto out_unlock; | ||
1218 | } | ||
1219 | if (sig && p->sighand) { | ||
1220 | unsigned long flags; | ||
1221 | spin_lock_irqsave(&p->sighand->siglock, flags); | ||
1222 | ret = __group_send_sig_info(sig, info, p); | ||
1223 | spin_unlock_irqrestore(&p->sighand->siglock, flags); | ||
1224 | } | ||
1225 | out_unlock: | ||
1226 | read_unlock(&tasklist_lock); | ||
1227 | return ret; | ||
1228 | } | ||
1229 | EXPORT_SYMBOL_GPL(kill_proc_info_as_uid); | ||
1195 | 1230 | ||
1196 | /* | 1231 | /* |
1197 | * kill_something_info() interprets pid in interesting ways just like kill(2). | 1232 | * kill_something_info() interprets pid in interesting ways just like kill(2). |
@@ -1763,7 +1798,8 @@ do_signal_stop(int signr) | |||
1763 | * stop is always done with the siglock held, | 1798 | * stop is always done with the siglock held, |
1764 | * so this check has no races. | 1799 | * so this check has no races. |
1765 | */ | 1800 | */ |
1766 | if (t->state < TASK_STOPPED) { | 1801 | if (!t->exit_state && |
1802 | !(t->state & (TASK_STOPPED|TASK_TRACED))) { | ||
1767 | stop_count++; | 1803 | stop_count++; |
1768 | signal_wake_up(t, 0); | 1804 | signal_wake_up(t, 0); |
1769 | } | 1805 | } |