Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2494135imm; Mon, 28 May 2018 09:08:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZozvDwhhOV9AwJbZ3qExg6eQgWR63N/5m2NxnL1xw9d+8pcETtWTh1i9Ba7JTTO3+3sQygy X-Received: by 2002:a17:902:7605:: with SMTP id k5-v6mr14252203pll.255.1527523700998; Mon, 28 May 2018 09:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527523700; cv=none; d=google.com; s=arc-20160816; b=A5HXuPU+QlgA3KkCmjYBJEgopOUqsJhMc3rKpzcfSw1m/NuXCmQYCpYV1hrKYFXQxM KIqzDHNozs1vBTFd1lnqAkW/s/X7kIiP2uxTyTdqEmb0Dy+CBmHe3aHXA1BtFtTJ7GJ5 xeLq3DltO4a1uwyzS2nGWlDksGx0Ur9SVHwIsAZz2cE7O3D2g1ezkmIaSArQ9CZNF3VB hfDZ77DrwaIDXplBW36PGxtOGsyf4R97jNIzcDyARGv83EKrmQcZuzxOUangUVqKnEye 30RqxHAsnSp38UNG0YedGpOqNLxAumsUSQ+Y3uEt5Cvd+8N9/47pWtIFpRL0i8osb8ld r2rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=MEjqvLmNKTSumakyHm9EUkboKHaCRyxCiRgBON1xphg=; b=ldcvqoM/tRFuxazeWASLi2uCEEraET0UmZAt+RLiJKb4x1rXzFc8MLOLXf7clIMivr E0LzFzLtW+PLm7xS0usj/KttAdMJsGnJmIynolQN1zPqqFYD9ExsV0g3KhP36HgIBGtU u51oWj0QN59Czx57U6Lm6r5bN2b+qRs469xjsSX83QCbgfRAaOhvbgnYZZHmJm/1uCDj RS3WdAuvyW/BypvsWhcJOxTmqvGmz0stipC0UF+US4M5o979+UkM3A0c7UqFk8OMNmCc GN4HoaCbgMxlolz66TP0WrnTqxbvCs06NXTvPiJ6OnqJdvPMfmmIpr/Aat8iLct5NB9u jXPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DWGzmZCL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d14-v6si1590118plr.244.2018.05.28.09.08.06; Mon, 28 May 2018 09:08:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DWGzmZCL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933532AbeE1QHY (ORCPT + 99 others); Mon, 28 May 2018 12:07:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:34390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934993AbeE1KOY (ORCPT ); Mon, 28 May 2018 06:14:24 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4EBBA206B7; Mon, 28 May 2018 10:14:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502463; bh=9v8nV8C47IVdGzKNWxiEerMiZ1y2Ij/SgSjVdZKuFYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DWGzmZCLD1KOwuPXpzgO2jy4BRTbL0xCHfVud+GQyluD58tydSuH43PipEaZq4q9z aUckgLstb4AKM0aXBujoDt07SzxNvwwcAZ1fI5ms7SaOa3q69q48h9mYUWTB7m/PaK gHtsIhqxGZ30/uoYWRjIx7On5A8Ih3hLSLyhO5pk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Maciej W. Rozycki" , Ralf Baechle , linux-mips@linux-mips.org, James Hogan Subject: [PATCH 4.4 002/268] MIPS: Fix ptrace(2) PTRACE_PEEKUSR and PTRACE_POKEUSR accesses to o32 FGRs Date: Mon, 28 May 2018 11:59:36 +0200 Message-Id: <20180528100202.316973183@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100202.045206534@linuxfoundation.org> References: <20180528100202.045206534@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maciej W. Rozycki commit 9a3a92ccfe3620743d4ae57c987dc8e9c5f88996 upstream. Check the TIF_32BIT_FPREGS task setting of the tracee rather than the tracer in determining the layout of floating-point general registers in the floating-point context, correcting access to odd-numbered registers for o32 tracees where the setting disagrees between the two processes. Fixes: 597ce1723e0f ("MIPS: Support for 64-bit FP with O32 binaries") Signed-off-by: Maciej W. Rozycki Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: # 3.14+ Signed-off-by: James Hogan Signed-off-by: Greg Kroah-Hartman --- arch/mips/kernel/ptrace.c | 4 ++-- arch/mips/kernel/ptrace32.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -830,7 +830,7 @@ long arch_ptrace(struct task_struct *chi fregs = get_fpu_regs(child); #ifdef CONFIG_32BIT - if (test_thread_flag(TIF_32BIT_FPREGS)) { + if (test_tsk_thread_flag(child, TIF_32BIT_FPREGS)) { /* * The odd registers are actually the high * order bits of the values stored in the even @@ -919,7 +919,7 @@ long arch_ptrace(struct task_struct *chi init_fp_ctx(child); #ifdef CONFIG_32BIT - if (test_thread_flag(TIF_32BIT_FPREGS)) { + if (test_tsk_thread_flag(child, TIF_32BIT_FPREGS)) { /* * The odd registers are actually the high * order bits of the values stored in the even --- a/arch/mips/kernel/ptrace32.c +++ b/arch/mips/kernel/ptrace32.c @@ -97,7 +97,7 @@ long compat_arch_ptrace(struct task_stru break; } fregs = get_fpu_regs(child); - if (test_thread_flag(TIF_32BIT_FPREGS)) { + if (test_tsk_thread_flag(child, TIF_32BIT_FPREGS)) { /* * The odd registers are actually the high * order bits of the values stored in the even @@ -203,7 +203,7 @@ long compat_arch_ptrace(struct task_stru sizeof(child->thread.fpu)); child->thread.fpu.fcr31 = 0; } - if (test_thread_flag(TIF_32BIT_FPREGS)) { + if (test_tsk_thread_flag(child, TIF_32BIT_FPREGS)) { /* * The odd registers are actually the high * order bits of the values stored in the even