Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2532306imm; Mon, 28 May 2018 09:53:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrnmZzTwBSRS/LVLAc1ga0AhaqmBwqbgOm9nP+R9jhU+KTcBTZs9RtjVSWc4HVK6XqOg2Rz X-Received: by 2002:a63:740c:: with SMTP id p12-v6mr11123654pgc.259.1527526408661; Mon, 28 May 2018 09:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527526408; cv=none; d=google.com; s=arc-20160816; b=yvdm2brsWF0xr+KSufSkeJ49J4eKT873Xs5rR1p3UChnhSw9Q7TaMS1ejTYzw0liLf dOJALvY9bFM1Cng990tBZlM6iHCsBSvNIu2N8a6g5TcfEPcVHBRk4IhZiCVMkW4rJcsj p+Ti2p/Ab6x87VP2ry08Z4wue6vmobGYvsJ8Gr9eTHS1brhKuE6p9XOa2Lb2sOxAgssS 4/ZzTmheIazE5Uqreh+idlekzOA7TRyAmAO/IvEUj1t1uGgVV3VebLrDyK1WbanceMMX WIQqyJJ/rwvbhDpr3MSPp8J9yksAFJZk5rRwMPTSMWa5zAhow/vXPNW/W7pp4auNKBbH 5tvg== 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=jmGXrZ3/CjOFSLxGm5sH4Ae4NJ054m3jaD7raBvBHeU=; b=hZb8Vtm7hIfZbKijP5rkcTcBGDqlSc+ZxeiQXVAJ3o8+OBCKvlCqZUnKlLvs4qu9IA tT8hHNy2GhZi6GvAtzZie5dvb/l5lel8Rh5NtP72Lk9KaaYl5QVw2FueXxMIcFOhRJkx lNZP6Y471FavCMxtukkC0Q1rpCX5FMkEWbKFXQ2Xw9jhvj46YzE4ZRSo4kxYfGWwhy++ IS/wPswfUNmc3FRCreMmpKWXBJT4ERdSkb+ywNxfY7GiASd1UioIFbu37T4RLsHHO5wG kWoIM+tnKQu9Zo1x7uarRoZuOpquEDEgZWiN0MTssjbiinS3leYe5r0TfeXVfOfbedqT AD6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NORvbHIF; 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 34-v6si30787156plp.409.2018.05.28.09.53.14; Mon, 28 May 2018 09:53:28 -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=NORvbHIF; 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 S940479AbeE1QuB (ORCPT + 99 others); Mon, 28 May 2018 12:50:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:53912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754279AbeE1KGB (ORCPT ); Mon, 28 May 2018 06:06:01 -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 4CA4120899; Mon, 28 May 2018 10:06:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527501960; bh=q+WwcWEWrJzQd4+aNnd7QG6xGVmraAMMw6KKzEGWBGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NORvbHIFfmPXcYG2p1gZCBM+uUYOPtLo/dbVXyNZMfAeEYsBGnxFKesPsYsPomLM6 f7+1Kc42jyHp33yJ+ddb0pfsI0SFLqW74tQlExAI56RbAAm9s523/WGMZt1oPi4SIh FSV1AHP+JENqUgWsD1kfl5AbReTyo4Bk0mDxXhvM= 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 3.18 002/185] MIPS: Fix ptrace(2) PTRACE_PEEKUSR and PTRACE_POKEUSR accesses to o32 FGRs Date: Mon, 28 May 2018 12:00:43 +0200 Message-Id: <20180528100050.833352031@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100050.700971285@linuxfoundation.org> References: <20180528100050.700971285@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 3.18-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 @@ -702,7 +702,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 @@ -796,7 +796,7 @@ long arch_ptrace(struct task_struct *chi child->thread.fpu.fcr31 = 0; } #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