diff mbox series

[SRU,Bionic] s390/compat: fix setup_frame32

Message ID 20180418144838.19531-1-seth.forshee@canonical.com
State New
Headers show
Series [SRU,Bionic] s390/compat: fix setup_frame32 | expand

Commit Message

Seth Forshee April 18, 2018, 2:48 p.m. UTC
From: Heiko Carstens <heiko.carstens@de.ibm.com>

http://bugs.launchpad.net/bugs/1765083

Git commit c60a03fee0e5 ("s390: switch to {get,put}_compat_sigset()")
contains a typo and now copies the wrong pointer to user space.
Use the correct pointer instead.

Reported-and-tested-by: Stefan Liebler <stli@linux.vnet.ibm.com>
Fixes: c60a03fee0e5 ("s390: switch to {get,put}_compat_sigset()")
Cc: <stable@vger.kernel.org> # v4.15+
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 8b09ca746a643ca452cd41a522046a96ee5a55fd)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
 arch/s390/kernel/compat_signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Colin Ian King April 18, 2018, 4:33 p.m. UTC | #1
On 18/04/18 15:48, Seth Forshee wrote:
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> 
> http://bugs.launchpad.net/bugs/1765083
> 
> Git commit c60a03fee0e5 ("s390: switch to {get,put}_compat_sigset()")
> contains a typo and now copies the wrong pointer to user space.
> Use the correct pointer instead.
> 
> Reported-and-tested-by: Stefan Liebler <stli@linux.vnet.ibm.com>
> Fixes: c60a03fee0e5 ("s390: switch to {get,put}_compat_sigset()")
> Cc: <stable@vger.kernel.org> # v4.15+
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> (cherry picked from commit 8b09ca746a643ca452cd41a522046a96ee5a55fd)
> Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
> ---
>  arch/s390/kernel/compat_signal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
> index ef246940b44c..f19e90856e49 100644
> --- a/arch/s390/kernel/compat_signal.c
> +++ b/arch/s390/kernel/compat_signal.c
> @@ -379,7 +379,7 @@ static int setup_frame32(struct ksignal *ksig, sigset_t *set,
>  	if (put_compat_sigset((compat_sigset_t __user *)frame->sc.oldmask,
>  			      set, sizeof(compat_sigset_t)))
>  		return -EFAULT;
> -	if (__put_user(ptr_to_compat(&frame->sc), &frame->sc.sregs))
> +	if (__put_user(ptr_to_compat(&frame->sregs), &frame->sc.sregs))
>  		return -EFAULT;
>  
>  	/* Store registers needed to create the signal frame */
> 
Clean upstream cherry pick, looks good.

Acked-by: Colin Ian King <colin.king@canonical.com>
Thadeu Lima de Souza Cascardo April 18, 2018, 4:48 p.m. UTC | #2
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Seth Forshee April 18, 2018, 8:58 p.m. UTC | #3
On Wed, Apr 18, 2018 at 09:48:38AM -0500, Seth Forshee wrote:
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> 
> http://bugs.launchpad.net/bugs/1765083
> 
> Git commit c60a03fee0e5 ("s390: switch to {get,put}_compat_sigset()")
> contains a typo and now copies the wrong pointer to user space.
> Use the correct pointer instead.
> 
> Reported-and-tested-by: Stefan Liebler <stli@linux.vnet.ibm.com>
> Fixes: c60a03fee0e5 ("s390: switch to {get,put}_compat_sigset()")
> Cc: <stable@vger.kernel.org> # v4.15+
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> (cherry picked from commit 8b09ca746a643ca452cd41a522046a96ee5a55fd)
> Signed-off-by: Seth Forshee <seth.forshee@canonical.com>

Applied to bionic/master-next and unstable/master.
diff mbox series

Patch

diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index ef246940b44c..f19e90856e49 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -379,7 +379,7 @@  static int setup_frame32(struct ksignal *ksig, sigset_t *set,
 	if (put_compat_sigset((compat_sigset_t __user *)frame->sc.oldmask,
 			      set, sizeof(compat_sigset_t)))
 		return -EFAULT;
-	if (__put_user(ptr_to_compat(&frame->sc), &frame->sc.sregs))
+	if (__put_user(ptr_to_compat(&frame->sregs), &frame->sc.sregs))
 		return -EFAULT;
 
 	/* Store registers needed to create the signal frame */