projects
/
GitHub
/
mt8127
/
android_kernel_alcatel_ttab.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PM / sleep: fix device reference leak in test_suspend
[GitHub/mt8127/android_kernel_alcatel_ttab.git]
/
kernel
/
signal.c
diff --git
a/kernel/signal.c
b/kernel/signal.c
index 113411bfe8b1205ad0f26556776f2a317e06eb0c..7b81c53b009733f884c27fc32106a064762a769b 100644
(file)
--- a/
kernel/signal.c
+++ b/
kernel/signal.c
@@
-2768,7
+2768,8
@@
int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from)
* Other callers might not initialize the si_lsb field,
* so check explicitly for the right codes here.
*/
* Other callers might not initialize the si_lsb field,
* so check explicitly for the right codes here.
*/
- if (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO)
+ if (from->si_signo == SIGBUS &&
+ (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO))
err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb);
#endif
break;
err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb);
#endif
break;
@@
-3003,11
+3004,9
@@
static int do_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t *info)
* Nor can they impersonate a kill()/tgkill(), which adds source info.
*/
if ((info->si_code >= 0 || info->si_code == SI_TKILL) &&
* Nor can they impersonate a kill()/tgkill(), which adds source info.
*/
if ((info->si_code >= 0 || info->si_code == SI_TKILL) &&
- (task_pid_vnr(current) != pid)) {
- /* We used to allow any < 0 si_code */
- WARN_ON_ONCE(info->si_code < 0);
+ (task_pid_vnr(current) != pid))
return -EPERM;
return -EPERM;
- }
+
info->si_signo = sig;
/* POSIX.1b doesn't mention process groups. */
info->si_signo = sig;
/* POSIX.1b doesn't mention process groups. */
@@
-3035,7
+3034,7
@@
COMPAT_SYSCALL_DEFINE3(rt_sigqueueinfo,
int, sig,
struct compat_siginfo __user *, uinfo)
{
int, sig,
struct compat_siginfo __user *, uinfo)
{
- siginfo_t info;
+ siginfo_t info
= {}
;
int ret = copy_siginfo_from_user32(&info, uinfo);
if (unlikely(ret))
return ret;
int ret = copy_siginfo_from_user32(&info, uinfo);
if (unlikely(ret))
return ret;
@@
-3052,12
+3051,10
@@
static int do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, siginfo_t *info)
/* Not even root can pretend to send signals from the kernel.
* Nor can they impersonate a kill()/tgkill(), which adds source info.
*/
/* Not even root can pretend to send signals from the kernel.
* Nor can they impersonate a kill()/tgkill(), which adds source info.
*/
- if (((info->si_code >= 0 || info->si_code == SI_TKILL)) &&
- (task_pid_vnr(current) != pid)) {
- /* We used to allow any < 0 si_code */
- WARN_ON_ONCE(info->si_code < 0);
+ if ((info->si_code >= 0 || info->si_code == SI_TKILL) &&
+ (task_pid_vnr(current) != pid))
return -EPERM;
return -EPERM;
- }
+
info->si_signo = sig;
return do_send_specific(tgid, pid, sig, info);
info->si_signo = sig;
return do_send_specific(tgid, pid, sig, info);
@@
-3081,7
+3078,7
@@
COMPAT_SYSCALL_DEFINE4(rt_tgsigqueueinfo,
int, sig,
struct compat_siginfo __user *, uinfo)
{
int, sig,
struct compat_siginfo __user *, uinfo)
{
- siginfo_t info;
+ siginfo_t info
= {}
;
if (copy_siginfo_from_user32(&info, uinfo))
return -EFAULT;
if (copy_siginfo_from_user32(&info, uinfo))
return -EFAULT;
@@
-3550,7
+3547,7
@@
SYSCALL_DEFINE0(pause)
#endif
#endif
-int sigsuspend(sigset_t *set)
+
static
int sigsuspend(sigset_t *set)
{
current->saved_sigmask = current->blocked;
set_current_blocked(set);
{
current->saved_sigmask = current->blocked;
set_current_blocked(set);