Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5654703rdb; Wed, 13 Dec 2023 15:38:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IHCTtp7VUb+xxTc/MCXFQs9IpCDf9OIndW5UwW3FTTMo2+t47Hu9DcFJrQNRsF5XBOEc7Uu X-Received: by 2002:a05:6a21:81af:b0:18c:44d3:d314 with SMTP id pd47-20020a056a2181af00b0018c44d3d314mr8672276pzb.10.1702510732026; Wed, 13 Dec 2023 15:38:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702510732; cv=none; d=google.com; s=arc-20160816; b=UTlo+jd3Vq5KCALPpeXX/lbTJBtzI0sEpsmUBNvhPfP3Hm5Q9+lR5Gj1R7WHKvGwS0 Y/3NugKfDdrRbPUfZ+YQooafTwRV6/CQx59jTUM8yzICiqKCSkJ5+DE+c8rzD5gaTEGE IiAlK0PMM7EaD5bIGIZHBUKnqrL5zBx5MNlbAIASBT4xrmg+aSWCwLWQzrj/7cc8X8FW aTGdfhRpk0MYdNYynGIyLVMAryhLGxlLqiCMhOsQgblbCnQz+eG56bUylsv/hBU4qqgn 8JElH+9A8/I/d/8ycjolmRMlcRPCoMu1H7f4RhOoI/yIyJvD8f3TeZfyH3/rYUX0W61w 3P6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ADVPDi6c9Y3U5XGJnmiIfqmOgMPyPThXfiimsaS0ZCE=; fh=TQATEbdDZNcnk8L2eDP6eFL9HlexFaHIexhR1TH2IlY=; b=FwcpGLs0gxKR6AQsPk+MWPWJvKRlaHeu/B7Y8FWUzvFGyK7NKRuIifZIrGSriwwEVY cdUdjNtttZPY/dLsG02WqQdLhLrq53mdTfKzCul9ORcYGcCr3hBezCQL39G/de/ZAEuQ WEcGK/LZpp6pNvKQeiPAHxpBAG4V4zjZ6ZWr7Ab9v64i8BZmnFrt19IWrrtACLaOBJYz Y+L5jr3xHb1OfhFVT6r+bbSShO5ScpVH+lDQ9wmJ8dmACol2swOKG3N8DmJQtFNtySlo 9MQjanu2Ya33XhkTwzt45bvY8/XzXdCqGmqXSwCQyWd44aiHc4GGSfG98VFcVLzdwhyO Yb3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=KRFjrsCA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id s17-20020a632c11000000b005c212ebb55csi10291145pgs.691.2023.12.13.15.38.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 15:38:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=KRFjrsCA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 965DA802F560; Wed, 13 Dec 2023 15:38:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442771AbjLMXiE (ORCPT + 99 others); Wed, 13 Dec 2023 18:38:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442718AbjLMXhT (ORCPT ); Wed, 13 Dec 2023 18:37:19 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34D2111B; Wed, 13 Dec 2023 15:37:15 -0800 (PST) Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BDL8I7u012863; Wed, 13 Dec 2023 23:37:01 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=ADVPDi6c9Y3U5XGJnmiIfqmOgMPyPThXfiimsaS0ZCE=; b=KRFjrsCA4SZpJueFACDEkkYIK4dYF8AzJRfEgxQ1XBZtPRvxzEdz8VQgdK3zBFLFQoNR wjCIpbpoHvRiDknYFk6Q2NBx/FTQk278rSEdBN/qjFA4IdQm0dcV25Fv25mZFNe2NYW2 PnFXHzjYEeeV8Up5UYBaG4jr9scWMSCaSFy85tEOEDSv2SDF5MDdtCdEJy9EEwWaaake LH28n4iN/kvpQWl+YqrmLq+YiHJs1jKuEQKf7S66szxjycuzlsitVA9ZjOFFY3zEVLwZ 9yHORuvAymPyWz+oTjxDz9VoBTO2efOq8FTLb/iucSG25rrE+Yo19vR0cPaTTor4azDS Qw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uyjg35xv4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:37:01 +0000 Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BDNSfUs015104; Wed, 13 Dec 2023 23:37:00 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 3uyjg35xug-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:37:00 +0000 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 3BDNFEmR013937; Wed, 13 Dec 2023 23:36:59 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3uw592c4ku-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 23:36:59 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3BDNauMb45220346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Dec 2023 23:36:56 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5792320040; Wed, 13 Dec 2023 23:36:56 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E389920043; Wed, 13 Dec 2023 23:36:54 +0000 (GMT) Received: from heavy.boeblingen.de.ibm.com (unknown [9.171.70.156]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 13 Dec 2023 23:36:54 +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 v3 30/34] s390/traps: Unpoison the kernel_stack_overflow()'s pt_regs Date: Thu, 14 Dec 2023 00:24:50 +0100 Message-ID: <20231213233605.661251-31-iii@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231213233605.661251-1-iii@linux.ibm.com> References: <20231213233605.661251-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: J2H2Zg9Syo-ddfgReflDerX2XK4HaCUE X-Proofpoint-GUID: jAIqILNw1A-DNGzWSjXXASmKCgL7b7sm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-13_14,2023-12-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 priorityscore=1501 suspectscore=0 spamscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312130167 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 13 Dec 2023 15:38:49 -0800 (PST) This is normally done by the generic entry code, but the kernel_stack_overflow() flow bypasses it. Reviewed-by: Alexander Potapenko 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 1d2aa448d103..f299b1203a20 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -260,6 +261,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.43.0