Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e800dff authored by Helge Deller's avatar Helge Deller
Browse files

parisc: fix error return codes for rt_sigaction and rt_sigprocmask



Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent bf581e15
Loading
Loading
Loading
Loading
+11 −4
Original line number Original line Diff line number Diff line
@@ -65,7 +65,7 @@ put_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz)
{
{
	compat_sigset_t s;
	compat_sigset_t s;


	if (sz != sizeof *set)
	if (sz != sizeof(compat_sigset_t))
		return -EINVAL;
		return -EINVAL;
	sigset_64to32(&s, set);
	sigset_64to32(&s, set);


@@ -78,7 +78,7 @@ get_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz)
	compat_sigset_t s;
	compat_sigset_t s;
	int r;
	int r;


	if (sz != sizeof *set)
	if (sz != sizeof(compat_sigset_t))
		return -EINVAL;
		return -EINVAL;


	if ((r = copy_from_user(&s, up, sz)) == 0) {
	if ((r = copy_from_user(&s, up, sz)) == 0) {
@@ -94,8 +94,11 @@ int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, compat_sigset_t _
	sigset_t old_set, new_set;
	sigset_t old_set, new_set;
	int ret;
	int ret;


	if (set && get_sigset32(set, &new_set, sigsetsize))
	if (set) {
		return -EFAULT;
		ret = get_sigset32(set, &new_set, sigsetsize);
		if (ret)
			return ret;
	}
	
	
	KERNEL_SYSCALL(ret, sys_rt_sigprocmask, how, set ? (sigset_t __user *)&new_set : NULL,
	KERNEL_SYSCALL(ret, sys_rt_sigprocmask, how, set ? (sigset_t __user *)&new_set : NULL,
				 oset ? (sigset_t __user *)&old_set : NULL, sigsetsize);
				 oset ? (sigset_t __user *)&old_set : NULL, sigsetsize);
@@ -128,6 +131,10 @@ sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, struct sigacti
	struct k_sigaction new_sa, old_sa;
	struct k_sigaction new_sa, old_sa;
	int ret = -EINVAL;
	int ret = -EINVAL;


	/* XXX: Don't preclude handling different sized sigset_t's.  */
	if (sigsetsize != sizeof(compat_sigset_t))
		return -EINVAL;

	if (act) {
	if (act) {
		if (copy_from_user(&new_sa32.sa, act, sizeof new_sa32.sa))
		if (copy_from_user(&new_sa32.sa, act, sizeof new_sa32.sa))
			return -EFAULT;
			return -EFAULT;