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: 13707347 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4827BC27C4F for ; Fri, 21 Jun 2024 11:38:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E4578D0166; Fri, 21 Jun 2024 07:37:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 769048D0163; Fri, 21 Jun 2024 07:37:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5216D8D0165; Fri, 21 Jun 2024 07:37:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 27AE38D0163 for ; Fri, 21 Jun 2024 07:37:48 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E3947A0DF2 for ; Fri, 21 Jun 2024 11:37:47 +0000 (UTC) X-FDA: 82254696174.30.7789182 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf21.hostedemail.com (Postfix) with ESMTP id 9B6411C000F for ; Fri, 21 Jun 2024 11:37:45 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b="acXEkLh/"; spf=pass (imf21.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718969855; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aLe/3XBqno9Ykh6K8Gazkn5dKq5eSwzJESHfR5NZsd4=; b=FGHkE5D38CFJ4dMOsvlZ3++Slotndm9vhyzQNZrXQiuAt8OIGh3avfrYh0XOkE0rkakwdx 5ntns9KMsMqfDta2l+w0FGfSWS4QH3HZorfBQ9bQBc73bYG01asq4RZzZ4em+JXCkByHFh PC0tQrBm5j67hAK91eBVcYaiSjWhfT8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718969855; a=rsa-sha256; cv=none; b=TkzYNlgQwzMO0/kgIOUVG+4Km1reqf8/OZKJWM5pHPwlsmTnQQIFUUv5Ak29sccsUwzc3I lTQF2xoS6DEbxVkNmopbEzLtO/yHn+gTx9s/HPS8KOVIE8JYhXF0d3ZIb2VGaFuLv5Y/mA V62LT6ndlmTULSi98swiBh6b7wGvS44= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b="acXEkLh/"; spf=pass (imf21.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com 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> 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 X-Stat-Signature: 665opdm818y47fc95hbywk6pcfziw1wo X-Rspamd-Queue-Id: 9B6411C000F X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1718969865-205351 X-HE-Meta: U2FsdGVkX19q+r57EEzdWgCotcLPOGc33iCowkTIRmXrQR5IC4xJg/CmY6Xxm0Za/Dzu00q3jqpgZ4B4fSUR+YTnvWy0kqCwDUEOR/kAh6MdiG3M7iX9/VZmMzwL2b5zTymBjVrhusGJRkYKJUllBQx0s6M8lEzUnp6blPpVpOGqQK+qA7CvEHFocHzv2Is3UGPrANHvo2DRRxiVs/LhHTWMGZstequAWHl6OCJvy72PwxE6asJ5aU+8tbD1/1AxOvead9N9Iu7hA1U6fzPz3or8NuXge57O3BRRtiaic5XwmWFKm6pZB2kqLnUuer7twbZabrX08EK6mBz1r9ut+hjqoMezxFc902qpYJrTuFKa9V1WwRcCaYgRmHFX+r199S6hiC3skvaFjojGSCtNTlFA0eM0L3XE6/1oba8QC3Tz44OUId3v8fUhJK4+S4jWnt6aGg8blkSfDhSNxuZTkFkFdX4MsIPe5nA+R9zclHrQRAbbfRj2TL2PVIIcRtw1n+TBDAjBj/eG/kZz+qov+pyeN0f8S0/5xztXGydCKpUJRIQR9DU2AOMM0NawqG41sMI49m7XAXZj+Qv/sTWqxz2lCVnIgV66irFyDPYGLrwTPUiF43k9lYGSfF+lAv9A+SXuGxsk1OUE+MZuXumEYdhyvkZ0xFbNQr1673V6YIUjSdYIWi8vow0384ZfN0YyxHtccT2f5l4Gl1uGV/WxVOJcvIyVB5rK30cBow0nAxZzfU4JSCcbrStT/lG5a0m9D5ClfZ8jawS8AKljzXhPgmLVBD8Sgi2B/N77hQgZ8AzS9nnZPOI338kWoe5vIWfSU9g1SOZUlQI8Fcnf1nh2Ohh86jtxnKXGoSVSMPE0f1hEvtbPZs7ip9VLvby5Wa1Y9/cYWZSKJxMjfmY9Vzpgzv9gPloZdXezXjbb20YcQYlJeq2qBP+mL2zvvS/e5synrTS0WDgDPEGt8kk8kiA bLzO97we r9Xzi95SDi+0IseX2vTvUc8RCRuOyGBklhQ2b/6mJvGdV4s/d7dqD5qGZ5Gt5Rl2VR4L8afEJAciZZjHLJyS6V2v02oGQQRAaBOedR/yzBnEfMacrSYnq6hG99Jo13JHyj3PT52FJv3iSTKOc0BNJzh/O9kkOIeoepVbVNhXtWzNt4pmtVkaq3yy5VkUNWLa9485kSrZ+fNwSRoUFT6JKtt53qb27Io8UAXCMeX9+uQuanrXoZxjRbNqre/y6JttatlrNVey4VULnPH7X/HS/VPwoXXY//oRONjAGPdB+T6vsDJ7j0y9uPE7RhDcgV6W7bllcKEpHbfoJbxnkn9ScM+gI4Yv/nSZF8gaHuB2wik1wYq0= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000011, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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);