Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2403386ybi; Sun, 9 Jun 2019 10:54:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNKJlSm2NKtazQskHfauuiF/EK28hFLdpCzpoWDRNEkO+U2sNYo0kNvAq4MReQ42bXBxO3 X-Received: by 2002:a17:902:bc47:: with SMTP id t7mr54097547plz.336.1560102845726; Sun, 09 Jun 2019 10:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560102845; cv=none; d=google.com; s=arc-20160816; b=aDinNYwZmAY4QTq7fUBRqDK6y9Pe9jfwA4IW6hRoZeoaUIuPMdyRVVhHTn8Pe0IoZc B3ogqbfkP1J4GnZe0B51oGDdLgdb6zZ6Twb8mJZmoW/AgXeLPMqw9K5mElUSOFqs3rM4 RlmvXHWXB+BhY0N4nl8XH3Orr++0ZPWxJ0Gy2fNXn+yELtJ1KIB7h6nKpiPHP5qkBdQB 9UpyMj530aQgbJ52dq64ekxzNwH/TO72P0iJTBVHe0aWQlTBOLswrM9CGEArJtvleI0l ckOTttISycoTIG1MILfxuOqtOXHCPPmGyhhSr+nH6luhGImZQhBmKcIAGM9EUnv0oAI2 74fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=81A8HDZltDDKqdNV4GRClOH5xlSc3ys3b8Fjfhu5XIw=; b=DESKlis/1oqWvwZwTU2h05hp+N/Hz0gWyPLFNAZVJJQAFgamYw5IHATCStQosnQ5G6 oSr0iDMQb0pjkvsIyWKHwI5vl2MPnJf0E23EJR1xIu2+xri2gOIAYCgRikUTG3t7vJxK sqMHbfwOkzZnych9Bk9ObfGyJmkQPH2H1bGRYGy27riY+r+C+YfTCuhxkQC/qVzFlv2i 4bleK3bCznpcOfwcBP+jM+0t8pOZ3fqtqEYSCyXu6QRvEUG35OMkusqdJU67pv5ZXiS1 TK+8XiLm+50bxgLmDMLLaFtw7x77go7CH8hDJQEXwkl3phUPeQg8ZDY+v4eo+uIE3/G/ 80rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TlI2QwfD; 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 11si8574264pfx.243.2019.06.09.10.53.49; Sun, 09 Jun 2019 10:54:05 -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=TlI2QwfD; 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 S1731203AbfFIQs2 (ORCPT + 99 others); Sun, 9 Jun 2019 12:48:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:47434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731181AbfFIQsX (ORCPT ); Sun, 9 Jun 2019 12:48:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 D5B8A205ED; Sun, 9 Jun 2019 16:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560098903; bh=s+85UkDRD4Gmb7EflBa5nFb+DWD4qiK/bjOx8AjW+6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TlI2QwfDdq+Plaj+thedd/v6NMok1/ZkOFxG+QnSSdbYuyIOiCdUiZ3gaUevPBfIl FK9KFDBF/fJMtPoNvLpt5eKd9aNCpRP9r2+iz2op5nUnKQjPj0nERgmmgCoAMyhDEg Bq3bPCoNadRCUePAuvlQ3J8c6LyX/UynpkPLiDjo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Janosch Frank , Heiko Carstens , Gerald Schaefer Subject: [PATCH 4.19 30/51] s390/mm: fix address space detection in exception handling Date: Sun, 9 Jun 2019 18:42:11 +0200 Message-Id: <20190609164128.993661015@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190609164127.123076536@linuxfoundation.org> References: <20190609164127.123076536@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gerald Schaefer commit 962f0af83c239c0aef05639631e871c874b00f99 upstream. Commit 0aaba41b58bc ("s390: remove all code using the access register mode") removed access register mode from the kernel, and also from the address space detection logic. However, user space could still switch to access register mode (trans_exc_code == 1), and exceptions in that mode would not be correctly assigned. Fix this by adding a check for trans_exc_code == 1 to get_fault_type(), and remove the wrong comment line before that function. Fixes: 0aaba41b58bc ("s390: remove all code using the access register mode") Reviewed-by: Janosch Frank Reviewed-by: Heiko Carstens Cc: # v4.15+ Signed-off-by: Gerald Schaefer Signed-off-by: Heiko Carstens Signed-off-by: Greg Kroah-Hartman --- arch/s390/mm/fault.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -107,7 +107,6 @@ void bust_spinlocks(int yes) /* * Find out which address space caused the exception. - * Access register mode is impossible, ignore space == 3. */ static inline enum fault_type get_fault_type(struct pt_regs *regs) { @@ -132,6 +131,10 @@ static inline enum fault_type get_fault_ } return VDSO_FAULT; } + if (trans_exc_code == 1) { + /* access register mode, not used in the kernel */ + return USER_FAULT; + } /* home space exception -> access via kernel ASCE */ return KERNEL_FAULT; }