From patchwork Fri Jun 21 11:35:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707392 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 7CD83180A6F; Fri, 21 Jun 2024 11:38:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969884; cv=none; b=PFJ4DNKjYmghMHfeoW1AlOA33aEsPdi55iAFBTz3YtWX+ss04p5Mz25qbujxd0lqtIYQS9CfwWDE2spBxBXRJEDPPfm91GMllUPB3op7rMsKNVH/TEPnHc8tqzTOv7Nl6rADLxqKW59jBXvZFteSmPpXTCi0U3Zi38arceCi3bc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718969884; c=relaxed/simple; bh=rxVyQ6lZU702PwA+PUfiD2YlhwM/n97a6/s5p7/Epck=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r+JRV2VNlySzr2jlZxXWom54F+5VpunF1R/EFtGhzcjWcG8AJlPxadDFfLqx4yGKMoDg+byMV5Fk6dAkBWS1+zwCwO4/OEkyaeokuC3OsOZqydm/cAi6IvVmyFHkRMqSULnjm56wuw2qdbgeNJ2K1sOy6GhPW+jL+RB46ltzdHU= 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=acXEkLh/; arc=none smtp.client-ip=148.163.156.1 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="acXEkLh/" Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45LB1wEL032087; Fri, 21 Jun 2024 11:37:37 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=acXEkLh/8/3GnbI63Sa7o4fayEvTr TOayC2tgC16y+V2rc6oy3/4TfsHY7hV9EiLy0XG+PmhhJyOObYzDAjSIR0DGmlW7 cg8KQCOKrAiT1YPQczyvnLoVkGIQEaWIWxZTtmy361Uad9YyQoQuTKX0HT5vFE30 QSDQNNofiK+AOyqlu5LMHkEtb4pc+vQcwy5Y8slBmqGv13L33nIvWVECNFf1X9Cz nOXov6QSG/LDto8+Bb8IZVKWtkc9zpPcY7HawqWIAVQtVZIbf+1juAzqC8d37/nI meU/KQhXWBamC/zYJcMOrLlJD8x1Wn68dgaci0nbmMXrevx37PtDoOuWw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw49cgpwq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:37 +0000 (GMT) Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbaEL022055; Fri, 21 Jun 2024 11:37:36 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw49cgpwj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:36 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45L9BsP1031330; Fri, 21 Jun 2024 11:37:35 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrrq6vga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:35 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbTXu51052840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:31 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5065020040; Fri, 21 Jun 2024 11:37:29 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BB2A720065; Fri, 21 Jun 2024 11:37:28 +0000 (GMT) Received: from black.boeblingen.de.ibm.com (unknown [9.155.200.166]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 21 Jun 2024 11:37:28 +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 v7 33/38] s390/traps: Unpoison the kernel_stack_overflow()'s pt_regs Date: Fri, 21 Jun 2024 13:35:17 +0200 Message-ID: <20240621113706.315500-34-iii@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240621113706.315500-1-iii@linux.ibm.com> References: <20240621113706.315500-1-iii@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 4W3rtCu_nH5X8A2P-hq6iliOp8gXzPKu X-Proofpoint-ORIG-GUID: AyWyEN58kjthDpoSHixMhSEVTnJKwLw- 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-21_04,2024-06-21_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 phishscore=0 impostorscore=0 malwarescore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 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);