Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp237103lqs; Thu, 13 Jun 2024 08:44:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVWRcAxhusVfvz6CP2K129PB0Cb0z7MJltBsRj5MAPK24mVlV4o/R8mZc/nuezEreDzl6fZIMvlPZAGXA8GTVMGjFClUWwFsP/P3252Hw== X-Google-Smtp-Source: AGHT+IHdFxsXztjv4HCdOheqgdAPbdKMeLM1iCscgpQyf13G96HFCMLZyDfZLNaOTKXg1JhcQYSx X-Received: by 2002:a0c:e601:0:b0:6b2:ae35:2fe with SMTP id 6a1803df08f44-6b2af16eefbmr4412476d6.0.1718293479498; Thu, 13 Jun 2024 08:44:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718293479; cv=pass; d=google.com; s=arc-20160816; b=TRfpeqkZwdWtQmFGqsLHJhjPyYaO1mH4jjCyQx5xspJo0/ElAK17xbF6GvqO9J3LZj PC2+lbbaaGrSzzb31CY99Pr0kkjjtqbN6kg6zVKKOpmZ9ArKXF/jcng/wEJjRCnKF/To C5imhL5oBBg2bio8the1jySLzkxntTPjxPjvtgBtZFHn501BP19DVHcrMj8a30DKq3rH yQwsbvLq29bsamR3M2UWwiZ6NiHP7mVmxDJy6QI2UYgmtbYEgs/T9EQ32uoHrZ/U1Vrb FSYxQ2+WDJ89sEavZZM1Xnj6EcDGUBSZp+QUQ6P3jwSyxMrJDmpatTfcJNqy7V8FAnlg lKUQ== 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=K/viBy/PeNICITSZpD3tBAO/npQA3ucnq3Zo5JONrlk=; fh=TQATEbdDZNcnk8L2eDP6eFL9HlexFaHIexhR1TH2IlY=; b=BrdoqSJUlAvBD9zLpTIqEDTnIMO8p29QNpuqtTRKb3ZLxKU+QsUmCTXEmDmYxOZ62N qkKFS8c2xzfwc6kMGKpk81oF2ExalRvjCwFjdaUqn6GC0TrAyqcBbna1axYtDVDHH8XB iUqX8CxVmsAr7qNnMGNF1KsyjRifg97PLteCbKgtdTdw09TS1N/MvVDiR/MQDlbKIAAz SdIEcYWH1EXqYjPyIVV+aSc1aIMSrMKg3KhFdUoO7IfKsH+6yW5WbZzIH2Ar/Tvs88LN hy/3IjLgtA/8Oj79JWBp5d4PX45PP81kPc8fQRkeq8yLmckVkfcLLtIGk9qVe/BYymVR 6VhA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=U6AIDXy4; 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-213582-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213582-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6b2a5a16e68si17527936d6.22.2024.06.13.08.44.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 08:44:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213582-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=U6AIDXy4; 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-213582-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213582-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3C5E61C21E29 for ; Thu, 13 Jun 2024 15:44:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8CFAB157A53; Thu, 13 Jun 2024 15:40:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="U6AIDXy4" 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 81C3D14B09F; Thu, 13 Jun 2024 15:40:16 +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=1718293219; cv=none; b=UZ1vMzQ7wpEI8y1GmhL6d+8aGFMWBFLAQmbR3HW9lwGHF1vw/MxVmUB7u0K456sA+yuCXq93g1qclYXE4Bm++ZCdmsemciVXJVRFh+A/5vN4WZ344AtmYwbGJ/M/7+BF9mVTQBH2aaEHRD5kwzCxwcMT82AZpn4dPYIYrnNwAag= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718293219; c=relaxed/simple; bh=jj2ie0mXDZXoykKheI+Ydx9F7sMDJBXe5guY5dRi5RQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rLAOyE/68cZbZAnZ/rMOZ/n0mpEOULKD/G99VYeZIZxyt+RCzkr1kGfr8DojDBHEc2luKaTHvkEI7areduJ8KQFRrMAIVFnQRqyohZ2D78hE/hujdJfygSLi+Js/tdfyV7jos+GdCEPkMsvjYqac+gDUkmj4YVGDZTNN1S6PHj8= 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=U6AIDXy4; 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 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45DFRYbL002861; Thu, 13 Jun 2024 15:39:53 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=K/viBy/PeNICI TSZpD3tBAO/npQA3ucnq3Zo5JONrlk=; b=U6AIDXy40C/51/FY4lTxmH7y1LrlC OSnfgBuhZd4NfFS/dwu6gpIbbmaIib95acaSCvWeAisH4qeIIzN+SjcxkKgDqgHF NtKTn4ei3ScUospKiaQUAHIkuG9PGzSf3e1M615RrTc5GEWFvXfHqOABqkRNuNN5 yQpI/NiTW60MEGRrT+g8WS02rDJ4ALIeJnfE34iGtOXyqj0zCMfxKl1ggoGpH2mh +Hjd+n1i1ImYjXMdYgdqT+cNAlLMgdH4lPxxfFOfTqCvlVFBEoPx/L9HqBDhuakx R7vVq4RN83rU2esdv3gPyMnhozXEEHNh4vaai0zMxd9sGx5NqWXPdmz+A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yqrw11ynb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:53 +0000 (GMT) Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45DFdqOm026511; Thu, 13 Jun 2024 15:39:52 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yqrw11yn6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:52 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45DFUHam023618; Thu, 13 Jun 2024 15:39:51 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yn3un0qgy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:51 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45DFdkq549152448 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2024 15:39:48 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 205D02006A; Thu, 13 Jun 2024 15:39:46 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A1FE720067; Thu, 13 Jun 2024 15:39:45 +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:45 +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 24/35] s390/cpacf: Unpoison the results of cpacf_trng() Date: Thu, 13 Jun 2024 17:34:26 +0200 Message-ID: <20240613153924.961511-25-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: NyD-y0SJac09yWbU3jUOV5qNtJcZM_L9 X-Proofpoint-ORIG-GUID: pUqzwXrVnO1fTFWRkXk2e4WzMOvYMG9i 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 malwarescore=0 spamscore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 priorityscore=1501 mlxlogscore=770 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406130112 Prevent KMSAN from complaining about buffers filled by cpacf_trng() being uninitialized. Tested-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Acked-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich --- arch/s390/include/asm/cpacf.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/s390/include/asm/cpacf.h b/arch/s390/include/asm/cpacf.h index c786538e397c..dae8843b164f 100644 --- a/arch/s390/include/asm/cpacf.h +++ b/arch/s390/include/asm/cpacf.h @@ -12,6 +12,7 @@ #define _ASM_S390_CPACF_H #include +#include /* * Instruction opcodes for the CPACF instructions @@ -542,6 +543,8 @@ static inline void cpacf_trng(u8 *ucbuf, unsigned long ucbuf_len, : [ucbuf] "+&d" (u.pair), [cbuf] "+&d" (c.pair) : [fc] "K" (CPACF_PRNO_TRNG), [opc] "i" (CPACF_PRNO) : "cc", "memory", "0"); + kmsan_unpoison_memory(ucbuf, ucbuf_len); + kmsan_unpoison_memory(cbuf, cbuf_len); } /** -- 2.45.1