Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > fc11cd6e1c513a17304da94a5390f3cd > files > 3217

kernel-2.6.18-194.11.1.el5.src.rpm

From: Anton Arapov <aarapov@redhat.com>
Date: Fri, 1 Aug 2008 08:21:57 +0200
Subject: [s390] utrace: PTRACE_POKEUSR_AREA corrupts ACR0
Message-id: 20080801062157.GA3976@redhat.com
O-Subject: [RHEL5.3 PATCH] BZ#431183: s390x, utrace: PTRACE_POKEUSR_AREA corrupts ACR0
Bugzilla: 431183
RH-Acked-by: Pete Zaitcev <zaitcev@redhat.com>
RH-Acked-by: Roland McGrath <roland@redhat.com>

Bugzilla: 431183

Description:
  fix for regression, that was introduced in 2.6.18-60.el5
  by linux-2.6-utrace-s390-regs-fixes.patch
  subject describes the issue. :)

Test status:
  kernel with the patch has been built and run
  tested by issue reproducer

==
 arch/s390/kernel/ptrace.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index c0b749b..15d8e23 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -249,7 +249,8 @@ fpregs_set(struct task_struct *target,
 		u32 fpc[2] = { target->thread.fp_regs.fpc, 0 };
 		BUILD_BUG_ON(offsetof(s390_fp_regs, fprs) != sizeof(fpc));
 		ret = utrace_regset_copyin(&pos, &count, &kbuf, &ubuf,
-					   &fpc, 0, sizeof(fpc));
+					   &fpc, 0,
+					   offsetof(s390_fp_regs, fprs));
 		if (ret)
 			return ret;
 
@@ -261,7 +262,8 @@ fpregs_set(struct task_struct *target,
 
 	if (ret == 0 && count > 0)
 		ret = utrace_regset_copyin(&pos, &count, &kbuf, &ubuf,
-					   target->thread.fp_regs.fprs, 0, -1);
+					   target->thread.fp_regs.fprs,
+					   offsetof(s390_fp_regs, fprs), -1);
 
 	if (ret == 0 && target == current)
 		restore_fp_regs(&target->thread.fp_regs);