From patchwork Thu Jun 27 14:57:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13714623 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 BB781C2BD09 for ; Thu, 27 Jun 2024 15:14:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47EDD6B008C; Thu, 27 Jun 2024 11:14:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E0326B0092; Thu, 27 Jun 2024 11:14:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 236106B0095; Thu, 27 Jun 2024 11:14:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id EE3076B008C for ; Thu, 27 Jun 2024 11:14:45 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8E97F1409A4 for ; Thu, 27 Jun 2024 15:14:45 +0000 (UTC) X-FDA: 82277015730.22.AF7088C Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf15.hostedemail.com (Postfix) with ESMTP id 4653DA0017 for ; Thu, 27 Jun 2024 15:14:43 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=Y5PFjIf5; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf15.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719501270; a=rsa-sha256; cv=none; b=nSAIbIm46SROgBAfJq73GOkKF+PTqc05pmqEyHw72DGInbAGaDO1VD6hQLHjgsF6tOvSt7 NoDu1S6lHs9uo0ZMORfQBEIoa39KZLKrLHi1GiasDiC8eRk68PKa4T5bkWxBdMm8Scl1kg FENuB17ZKXj6jY2TMt4R7vyBg5kHWl8= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=Y5PFjIf5; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf15.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719501270; 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=9nSO8vQ8LysldJ41kUs8BTYUja1+gnKPMCjMQs//hno=; b=5CBPNwdPK3HAyT/EniN4j2+RLnWiP5zBHU5+lOPThoewdm11Cqdk2jRgJXtycc1G6S0Ak4 CnA9OuAUdd2VgydT89rR68ggmLnSYFLAvMZ3sERj2NiN2yFT4sEvXEMFmVwP5DePgcbylQ uoBqftzkCmU3bEOk9T1mCPLPcWjctws= 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 45REuqR1015553; Thu, 27 Jun 2024 15:14:40 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 :content-transfer-encoding:mime-version; s=pp1; bh=9nSO8vQ8Lysld J41kUs8BTYUja1+gnKPMCjMQs//hno=; b=Y5PFjIf5h6Km09SvAKoQtbFtJtQL9 UxKCaUYxKjp/3iayxbso7EzUhUx8yCP/6mkTpD9JErYqUUTM7DCapno8yKjRq6Vl nR9gbuxNUdtGaZ0jdS03iXe8ZEsM2YkM79rd8wE2Z60xBPSaAHNTLl5sRYnGNav4 0N0G1+4wPckEWUF9eEENeUs8nrNpLvIsJ7BLmRZkRRU3qhOsq4M9o/0mIYl1g5dH H3RNUky0n5Xag5d1FtFkfjuq4iChNuBt3qz6mCQ/gFdBYTp6hJwa8Zo2H5YT2jfp QHABQ7AYb07we3mZdwPtAr65nukhNzN2lCIhucxyU/O30YB4Z0b/FUuaA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4015fsrryj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2024 15:14:40 +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 45RFEdCP008846; Thu, 27 Jun 2024 15:14:39 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4015fsrryd-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2024 15:14:39 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45RBjA4l019602; Thu, 27 Jun 2024 14:58:02 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yx9xqba9g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2024 14:58:02 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45REvwtr20054466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Jun 2024 14:58:00 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A80522004B; Thu, 27 Jun 2024 14:57:58 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2346220043; Thu, 27 Jun 2024 14:57:58 +0000 (GMT) Received: from heavy.ibm.com (unknown [9.171.10.182]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 27 Jun 2024 14:57:58 +0000 (GMT) From: Ilya Leoshkevich To: Alexander Potapenko , Marco Elver , Dmitry Vyukov , Andrew Morton Cc: kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ilya Leoshkevich , kernel test robot Subject: [PATCH 1/2] kmsan: add missing __user tags Date: Thu, 27 Jun 2024 16:57:46 +0200 Message-ID: <20240627145754.27333-2-iii@linux.ibm.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627145754.27333-1-iii@linux.ibm.com> References: <20240627145754.27333-1-iii@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: -d7cZN-z68hAjVNQeXA7A1nEUn9qEmjC X-Proofpoint-GUID: tjwTrgx4dkgHL1UYAClt-09Hv4Ljjbml X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-27_11,2024-06-27_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 impostorscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=988 spamscore=0 adultscore=0 clxscore=1011 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406270113 X-Rspamd-Queue-Id: 4653DA0017 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 1u8yxihh3z6nxpbahd9u7sq9jrtjq9cf X-HE-Tag: 1719501283-573415 X-HE-Meta: U2FsdGVkX19MLGgY2wjYHbXkUcfNKTivo+ihRaWc2IXvjfSxgWF5QRIoc0T3cXzd+vocI39x0agTYfRegz9uh9RIwP/sN80ijgvjH6SkGOChd5+qbSUye4XX21iBUu76/2QKrbbkjO9dwc0CgM9d7+HucwFtr+0qJg9zzPxDlByrKbYWytF4RWrVfoSXz4wlDhAtgQ9j0JFR6PJERQPfQDtsRRzqm6y1vg64f8zCx9P8YUEpgCR+t8+DbKPdeGSRJcmFAElfdG6P38feY88PvGTEme+TcVI5syT8MrOYuZNXUup0wgFjraHlFCuFM8R0HtrMrquzlox2KkzOtwQxVHyyQoSyb2zNkmAH6egH4sDkFhqrkVBs9QKIz3TP1wCanA0TMlG1H0pxCqogmGXjNVFNSi9SWF5joQvbmMtcrZPutQqTHxvondUH1V2hCT56WzOrMcBUWrt4lqxcbwgz5NdAylatmRH/pFc/M/aW4NBdg8WuyUthRNBgh/hyggzh86N1Y903h/giTHYVofdko5fJpxCmbDI3hMG/c/gRmLyVtzj5rHPCrIEPwLJAgmLcqEGVimQn7iOuP/8wc76T+UfgYzecoBko9Hav29dMxBZ4R8y47YIgjyrTnppgi/yWp+x1m246LTz6aFMrONyDk7l5CNtCiOUovqYy9DsRcXIptmlLmZSS6c2WzTLd3AWe8H1Sc8xBMruIqR28Zfz7RJXYoaagkEA4wUus1DFWZ4sqmJyEdjl+/7mtFxvvaLRCAn0cRsoB13FoQcGIhR3OOITZqWV+trE3zjF3J9jfHjvm2vUBFUhBF2MHC5cltHDA5wPXa+L0X2IdOQD41czXXfFdNaovU1mbxD7WI06HDRfgKzlP8xo0ZXaebLiv8loZr5qMCODbO7H3rzOPSKKQ9NAuPvbhpuKqv2DJLb4c7jYvIXTIENpZeu5rCfH2n7liH/W/NreA0+iFdOsxOZv 1GBo4h/I 9fCVqWKualpZW+PzkEzRi64+8YlEEui1pB5Kmr0pdrNEt+SRX9SdBu80hbRTqBQw89R/xHLOctgks+tGriHfQR+HvF2vWA628IzAD0SfRdo1btUYApLEkgXYllsym/kMijJw/72nt9Lwb14yhiE3QpWFt1j9Yca0kK2jUGh90/yaSX52/KAr474XGl+hoJhP8oT/w0Y4xEG1CyZjB1nq0VpUWX1BUpiakPZu6sibOwuwR7OOCdxohVoEsgyS2Fro71CLAQ7Y8SCUEKmrlAbDUpPdcA1iGOGKz9MOQc5L5viQfZDagcCZbsUXumQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: sparse complains that __user pointers are being passed to functions that expect non-__user ones. In all cases, these functions are in fact working with user pointers, only the tag is missing. Add it. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406272033.KejtfLkw-lkp@intel.com/ Signed-off-by: Ilya Leoshkevich Reviewed-by: Alexander Potapenko --- mm/kmsan/core.c | 4 ++-- mm/kmsan/kmsan.h | 6 +++--- mm/kmsan/report.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/kmsan/core.c b/mm/kmsan/core.c index 81b22220711a..a495debf1436 100644 --- a/mm/kmsan/core.c +++ b/mm/kmsan/core.c @@ -249,8 +249,8 @@ struct page *kmsan_vmalloc_to_page_or_null(void *vaddr) return NULL; } -void kmsan_internal_check_memory(void *addr, size_t size, const void *user_addr, - int reason) +void kmsan_internal_check_memory(void *addr, size_t size, + const void __user *user_addr, int reason) { depot_stack_handle_t cur_origin = 0, new_origin = 0; unsigned long addr64 = (unsigned long)addr; diff --git a/mm/kmsan/kmsan.h b/mm/kmsan/kmsan.h index 91a360a31e85..29555a8bc315 100644 --- a/mm/kmsan/kmsan.h +++ b/mm/kmsan/kmsan.h @@ -73,7 +73,7 @@ void kmsan_print_origin(depot_stack_handle_t origin); * @off_last corresponding to different @origin values. */ void kmsan_report(depot_stack_handle_t origin, void *address, int size, - int off_first, int off_last, const void *user_addr, + int off_first, int off_last, const void __user *user_addr, enum kmsan_bug_reason reason); DECLARE_PER_CPU(struct kmsan_ctx, kmsan_percpu_ctx); @@ -163,8 +163,8 @@ depot_stack_handle_t kmsan_internal_chain_origin(depot_stack_handle_t id); void kmsan_internal_task_create(struct task_struct *task); bool kmsan_metadata_is_contiguous(void *addr, size_t size); -void kmsan_internal_check_memory(void *addr, size_t size, const void *user_addr, - int reason); +void kmsan_internal_check_memory(void *addr, size_t size, + const void __user *user_addr, int reason); struct page *kmsan_vmalloc_to_page_or_null(void *vaddr); void kmsan_setup_meta(struct page *page, struct page *shadow, diff --git a/mm/kmsan/report.c b/mm/kmsan/report.c index 92e73ec61435..94a3303fb65e 100644 --- a/mm/kmsan/report.c +++ b/mm/kmsan/report.c @@ -148,7 +148,7 @@ void kmsan_print_origin(depot_stack_handle_t origin) } void kmsan_report(depot_stack_handle_t origin, void *address, int size, - int off_first, int off_last, const void *user_addr, + int off_first, int off_last, const void __user *user_addr, enum kmsan_bug_reason reason) { unsigned long stack_entries[KMSAN_STACK_DEPTH];