Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752670AbdFSSeu (ORCPT + 2 others); Mon, 19 Jun 2017 14:34:50 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:51932 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752634AbdFSSes (ORCPT ); Mon, 19 Jun 2017 14:34:48 -0400 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux@roeck-us.net Cc: Dave Martin , Linus Torvalds , Willy Tarreau Subject: [PATCH 3.10 206/268] sparc/ptrace: Preserve previous registers for short regset write Date: Mon, 19 Jun 2017 20:31:45 +0200 Message-Id: <1497897167-14556-207-git-send-email-w@1wt.eu> X-Mailer: git-send-email 2.8.0.rc2.1.gbe9624a In-Reply-To: <1497897167-14556-1-git-send-email-w@1wt.eu> References: <1497897167-14556-1-git-send-email-w@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Dave Martin commit d3805c546b275c8cc7d40f759d029ae92c7175f2 upstream. Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET to fill all the registers, the thread's old registers are preserved. Signed-off-by: Dave Martin Acked-by: David S. Miller Signed-off-by: Linus Torvalds Signed-off-by: Willy Tarreau --- arch/sparc/kernel/ptrace_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c index 7ff45e4..875ddf0 100644 --- a/arch/sparc/kernel/ptrace_64.c +++ b/arch/sparc/kernel/ptrace_64.c @@ -308,7 +308,7 @@ static int genregs64_set(struct task_struct *target, } if (!ret) { - unsigned long y; + unsigned long y = regs->y; ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &y, -- 2.8.0.rc2.1.gbe9624a