Received: by 10.223.185.116 with SMTP id b49csp6385855wrg; Wed, 28 Feb 2018 08:33:20 -0800 (PST) X-Google-Smtp-Source: AH8x226I+03fwQbZkk6xSVVElPgoCzW7W+JRcouKpoTsZRzJGO7XZKkwFNvVzqmMP/RUY/7vtdu/ X-Received: by 2002:a17:902:a70f:: with SMTP id w15-v6mr18060612plq.79.1519835600154; Wed, 28 Feb 2018 08:33:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519835600; cv=none; d=google.com; s=arc-20160816; b=iC9oCE64uKsI7M0sSMoj/wu59wthlukAExmfj+ceXfJ2ZHMNUN38au7VNy9Z8XQ43C KzdEJNelHKNXJTplhrHd8x9YTEYcSLKJ6aFbWfj+coxcrZu+SftgHNwsZLc2CwMrGk6E jH2eMwB/xD9bnFMSwdhH5hUGKRuUNc6BFs0U7h55UHNjBSu/s4SW/Grolvh1hGuyQxMB TL2vbgLxaHU9Aucn5zwNByHlFS3ltogCcl4J2T42sO1MUgKFkLVpFMur2dcBqMJr11I2 6x/zOj9OLy0EJHGyim4jZwmiRJl6U0nlLcYs0F6/HqNEOILoTc/nuI+nYiMzIXIUeggR 4TWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=vjcLJ4WwDJcLUtVUoshpz8+GnTFrJNI8A002V0peKrE=; b=HX8KRV0CYquYwzBTBdZcZPX8vtffpgcyo+D6uATA6/rg/2zYrSS5RGvog3PiL0nbbE Uphw3h4AlVItQL+5bInmer4geq9sCNj7VGuUUS3yFxgU2RNvrOn+6WfHh2NZ5VjnFfAl g7L1rw9746Xs7dFymE+2c3vyhLMlUKxwBJ9bNhX9ANvofFuuLhukHwylytVsckb1DMtC FbGbm9fiFif9SOpdZixVHy6DpLkaQ0x+A9NL23u9eSDbLhKW2Gu+5Usqc38Cc5Zo9HZN iIe0P0FQ19jTX37KCKRro8nrJWHCzGdCI46yeUvK+J/WQR7tX4Gx9sm5aniHjHfbqEer vJ0w== ARC-Authentication-Results: i=1; mx.google.com; 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 y86si1395454pfi.19.2018.02.28.08.33.05; Wed, 28 Feb 2018 08:33:20 -0800 (PST) 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; 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 S934439AbeB1Qca (ORCPT + 99 others); Wed, 28 Feb 2018 11:32:30 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35109 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753277AbeB1QOX (ORCPT ); Wed, 28 Feb 2018 11:14:23 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yt-0006Xj-AW; Wed, 28 Feb 2018 15:22:31 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yg-000053-C7; Wed, 28 Feb 2018 15:22:18 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Ralf Baechle" , linux-mips@linux-mips.org, "Maciej W. Rozycki" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 102/254] MIPS: ptrace: Fix FP context restoration FCSR regression In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: "Maciej W. Rozycki" commit 4249548454f7ba4581aeee26bd83f42b48a14d15 upstream. Fix a floating-point context restoration regression introduced with commit 9b26616c8d9d ("MIPS: Respect the ISA level in FCSR handling") that causes a Floating Point exception and consequently a kernel oops with hard float configurations when one or more FCSR Enable and their corresponding Cause bits are set both at a time via a ptrace(2) call. To do so reinstate Cause bit masking originally introduced with commit b1442d39fac2 ("MIPS: Prevent user from setting FCSR cause bits") to address this exact problem and then inadvertently removed from the PTRACE_SETFPREGS request with the commit referred above. Signed-off-by: Maciej W. Rozycki Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/13238/ Signed-off-by: Ralf Baechle Signed-off-by: Ben Hutchings --- arch/mips/kernel/ptrace.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -176,6 +176,7 @@ int ptrace_setfpregs(struct task_struct } __get_user(value, data + 64); + value &= ~FPU_CSR_ALL_X; fcr31 = child->thread.fpu.fcr31; mask = boot_cpu_data.fpu_msk31; child->thread.fpu.fcr31 = (value & ~mask) | (fcr31 & mask);