Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1083878ybt; Wed, 1 Jul 2020 18:27:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBHNQsans2D9n8FksIlBIO+eHidnFW+nxiZwRXcHpftxU+FSkzWWAiJ8OrcUY/USyVsCk/ X-Received: by 2002:a50:c8c9:: with SMTP id k9mr31225302edh.157.1593653270155; Wed, 01 Jul 2020 18:27:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593653270; cv=none; d=google.com; s=arc-20160816; b=o6zwa92EtuENorEU3YdfvlD2qi1kU4cir5Jhjj3fPLqmb5DghJtUXpQpYPShXe5VeT TS23zaghzmpwVBwp0wC1xzZnUBQcIPovEUkFCtythjfIPetKMq2x6gjTrwtakFaYOItb 3jUuLcXWBAwTctPIpY/qs/2GatoC5oazxLvcDSNJ+CHvPmjMw4fpAf0WDwFgXtOSUs7M 9qaXQLgtLZLyAc2BszDsT+aYTNqf2lgjv9BnI+l9r1YjGhVHStgyEXt3coOhs/AI1OOZ dHcIzjYxw7AGChLzHXwkYeBwz5ZlcSkMtSLi7PHHzDWMuYQ/XohXr4TBWPfzmhL+dZNc QQqw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ga7qweaSBWZC5ft58ElFAusKVIseN12fnQaQpyaWnFs=; b=XoKr6+ljm7TzrJ58rFPLY7s8nL0c3MSns807JYlQtmaBekaP5ekrFLLs2I1h7OPwZi 23djpy79ctXOb1e8WZzaBye8C5zDPiejCoK8ZGr44TnR21gCsR6FNdZ76Ib642rJ9jsd seZvgP8eHQ8uZk/dUL+oZpGTu5h3uGLU0FVvh5536Y4cK+tzyxqtFix16HwjWBlSHIlI ckOttAMGtoFzSNzJkLLw4PdX2CmLS3nexmKhMvHmWZRbz4TdnVqTQyfLvRBJuLPSxkLO XoeHAFJlKkiqrfk7eeEN9KZiXTBuZtdK6lMVmzuINcIbxrv28g9H300amPxKWbm1bw+C RL9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2uwEfIux; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y2si5200115edp.396.2020.07.01.18.27.27; Wed, 01 Jul 2020 18:27:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2uwEfIux; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728459AbgGBBXp (ORCPT + 99 others); Wed, 1 Jul 2020 21:23:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:54306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728411AbgGBBXj (ORCPT ); Wed, 1 Jul 2020 21:23:39 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 04B422083E; Thu, 2 Jul 2020 01:23:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593653018; bh=ONj7aKbHlOlgWW2rGPQ0J/OhBHcYbrSt/+Ss/muTSBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2uwEfIuxQEe4d1vHrxOJ7TvJO8s4QfgyLUvmknhf9xO39+/33f7kmmXxJWjRgemUt koLb4gpJE1u/Yf2WoGT1oFuyt5d1G3Nri3hO/XMuuaIV0fUJEydem0gjhOvbVVe59V MqCFeog9hWAj8kIins1AwporA2vikWe0FB6mf1wM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vasily Gorbik , Alexander Egorenkov , Heiko Carstens , Sasha Levin , linux-s390@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 35/53] s390/kasan: fix early pgm check handler execution Date: Wed, 1 Jul 2020 21:21:44 -0400 Message-Id: <20200702012202.2700645-35-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200702012202.2700645-1-sashal@kernel.org> References: <20200702012202.2700645-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vasily Gorbik [ Upstream commit 998f5bbe3dbdab81c1cfb1aef7c3892f5d24f6c7 ] Currently if early_pgm_check_handler is called it ends up in pgm check loop. The problem is that early_pgm_check_handler is instrumented by KASAN but executed without DAT flag enabled which leads to addressing exception when KASAN checks try to access shadow memory. Fix that by executing early handlers with DAT flag on under KASAN as expected. Reported-and-tested-by: Alexander Egorenkov Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin --- arch/s390/kernel/early.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index cd241ee66eff4..0782772318580 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c @@ -170,6 +170,8 @@ static noinline __init void setup_lowcore_early(void) psw_t psw; psw.mask = PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA; + if (IS_ENABLED(CONFIG_KASAN)) + psw.mask |= PSW_MASK_DAT; psw.addr = (unsigned long) s390_base_ext_handler; S390_lowcore.external_new_psw = psw; psw.addr = (unsigned long) s390_base_pgm_handler; -- 2.25.1