Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp237620lqs; Thu, 13 Jun 2024 08:45:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWT7hCVhTLMk2GBzXHwc6JqtKhZQB5uQ/Ml2tC6WmrmAfTfcIklRGDBCQ7QRFICPGm3gxBXIsz+6JAdX02A+PvGdxvyZZoM0RYHgIjYdQ== X-Google-Smtp-Source: AGHT+IHzIRVJtemf8OJf4mMn38OjYO3CwskuWWFH28LnY0YJWiwBuv9ECo6Dr7fpqN8UxH012uGY X-Received: by 2002:a05:6a20:3c8b:b0:1b4:82eb:61c6 with SMTP id adf61e73a8af0-1bae7e04adamr254321637.2.1718293533804; Thu, 13 Jun 2024 08:45:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718293533; cv=pass; d=google.com; s=arc-20160816; b=eO5NGlKXUya1V4v3fw6I1FkcnnK5ZoRKgKeBl7WkBjeAsSv0VauxN/bWwZSfjfCESx qSYGuts0YtTIe3AAOxlFS7Fd1T8+kYd9DLc+zjIxIBILJ6GB23socNBlJ/Nl0QSvkWJY bEj3UQtwL9xmiJ2O33N0vhRqL4BfO4pNz2KWM8IaK79Lr2SJ1Cc16oqm7hU+0G6T6G2E 4LoklJcSuC83Vy2MtP+vr2jEz/WvCLM3JpZgrrVGdN/gitW7whlFLsnXxISjtBvqlmts nhARLWjx554dezGox1gQnwC0d8fljPe65aftuPFBqWN7+fb61uFPG1TCTDsFUzDe+WkV b4AQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=aLe/3XBqno9Ykh6K8Gazkn5dKq5eSwzJESHfR5NZsd4=; fh=TQATEbdDZNcnk8L2eDP6eFL9HlexFaHIexhR1TH2IlY=; b=vgJFIP0QVvwgq4tkB7jxmgEJU+DRArbpE75Sc6vyo0VI9+G/lhSVCu60At0FXm7wRt FTE+dX0ReLnDcNmHPW7XKVs6b6Z0dMC5+0G+8J+CcLHcvLQBgB6tk1FMrByGqWZrwmoN d9jhkb9WEhvGm1jlsOdEOREdAcETkeYlE4lA8LVdvOOsbMJRpcVvzmHLACejQNE7qYt3 UYQ0fxhOkkb6z6j01crtZavAMfqWItskTZjxKCHvvcFhukXQPSlzsb9J7AbqGWZEsV9C +1NBlkVpXnc/++fE+qs6hDUIZ47PJrZmtnpyuYJJLc3TDXqtQIFmP5grPUeOpoGnw6Il Sg3Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=kZUSIkqS; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-213587-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-705ccb98129si1595331b3a.316.2024.06.13.08.45.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 08:45:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213587-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=kZUSIkqS; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-213587-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 035F728E0A8 for ; Thu, 13 Jun 2024 15:45:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EFBB115885E; Thu, 13 Jun 2024 15:40:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="kZUSIkqS" Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 545EB156654; Thu, 13 Jun 2024 15:40:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718293222; cv=none; b=MmUMVlasGVbug1MpXb7Yf9oq4W3Mc5F5X3Vg0sBE/HV1dwMhSlPXCQpixVTOLvr7B+F8HmGm1yE4MQAG00S7KFq81BdL9qMa/CNZZn4mZJ0N7GlEUHV9Qoc9zYqf88C0u6qAQbKpLVKQ7ROtt+u6Ua/k6DCZlfFbaF6BCioRgZc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718293222; c=relaxed/simple; bh=rxVyQ6lZU702PwA+PUfiD2YlhwM/n97a6/s5p7/Epck=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=shVZNy4Jv+PqL3q6GaxAhgeJT11Md/+57xCNmay9eE3Us65T+WJ1DU2wZ8j5jSmY3vUU8l/KedNjQNhomY+XAxnDqoD2GwvCAY5tg9bb+AbjaHRi9axYcXb/eAoi4nwXyhRVndXKQMiTY0Th/yVP+VpxRxRRIr3d7pK73IeAc8A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=kZUSIkqS; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45DE7HXP011927; Thu, 13 Jun 2024 15:39:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=aLe/3XBqno9Yk h6K8Gazkn5dKq5eSwzJESHfR5NZsd4=; b=kZUSIkqSEK8rID5S9ATMlltGMsS0Q uzznxKeXDkX6/Qijwi+iCmI5fBrRLs/ym0YRuJ7YNTTLBDsb8DDwTWbHFx9L2mGB lkpw++wnXqNp2xTSS82OXdt/g0nIJ103WngSZpslqH4u87caiJorvyCOYiPMX4cM DgCyrCgFNr6Q65/H0/lDGsqe8wkUUjFXuCnmlelHYPndpVm1WiQm/JrobmoumyC4 N/SIulgz13wcix+y1zqiBE1GNZptNarMx0fAZzWy/2rUSG6bgotK1qiGUqyr7Ddy Qfi8Zt+ZTEywmQWe7MQsInWh9MJbGIgRO07K/GNjyhd8uE+03Z5EO8Yag== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yr28g8bve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:57 +0000 (GMT) Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45DFdu25032626; Thu, 13 Jun 2024 15:39:56 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yr28g8bvb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:56 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45DEIs5m008716; Thu, 13 Jun 2024 15:39:55 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yn4b3rk1t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:55 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45DFdo3A44302740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2024 15:39:52 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EB6C12004D; Thu, 13 Jun 2024 15:39:49 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 78B9120043; Thu, 13 Jun 2024 15:39:49 +0000 (GMT) Received: from black.boeblingen.de.ibm.com (unknown [9.155.200.166]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 13 Jun 2024 15:39:49 +0000 (GMT) From: Ilya Leoshkevich To: Alexander Gordeev , Alexander Potapenko , Andrew Morton , Christoph Lameter , David Rientjes , Heiko Carstens , Joonsoo Kim , Marco Elver , Masami Hiramatsu , Pekka Enberg , Steven Rostedt , Vasily Gorbik , Vlastimil Babka Cc: Christian Borntraeger , Dmitry Vyukov , Hyeonggon Yoo <42.hyeyoo@gmail.com>, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Mark Rutland , Roman Gushchin , Sven Schnelle , Ilya Leoshkevich Subject: [PATCH v4 31/35] s390/traps: Unpoison the kernel_stack_overflow()'s pt_regs Date: Thu, 13 Jun 2024 17:34:33 +0200 Message-ID: <20240613153924.961511-32-iii@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240613153924.961511-1-iii@linux.ibm.com> References: <20240613153924.961511-1-iii@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: qN5TvlINAwkoyVJTUb7mish1SpksN-h9 X-Proofpoint-ORIG-GUID: Bgo41_z9p3q4U6eGSVczp70jPlI-Yan7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-13_09,2024-06-13_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 phishscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406130112 This is normally done by the generic entry code, but the kernel_stack_overflow() flow bypasses it. Reviewed-by: Alexander Potapenko Acked-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich --- arch/s390/kernel/traps.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index 52578b5cecbd..dde69d2a64f0 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -262,6 +263,11 @@ static void monitor_event_exception(struct pt_regs *regs) void kernel_stack_overflow(struct pt_regs *regs) { + /* + * Normally regs are unpoisoned by the generic entry code, but + * kernel_stack_overflow() is a rare case that is called bypassing it. + */ + kmsan_unpoison_entry_regs(regs); bust_spinlocks(1); printk("Kernel stack overflow.\n"); show_regs(regs); -- 2.45.1