From patchwork Mon Oct 23 16:22:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 13433193 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 0711EC004C0 for ; Mon, 23 Oct 2023 16:25:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35CF86B010C; Mon, 23 Oct 2023 12:25:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30D426B010D; Mon, 23 Oct 2023 12:25:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D6086B010E; Mon, 23 Oct 2023 12:25:12 -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 0A7CD6B010C for ; Mon, 23 Oct 2023 12:25:12 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id E17681A0354 for ; Mon, 23 Oct 2023 16:25:11 +0000 (UTC) X-FDA: 81377250822.10.99795CB Received: from out-195.mta0.migadu.com (out-195.mta0.migadu.com [91.218.175.195]) by imf30.hostedemail.com (Postfix) with ESMTP id 2142880021 for ; Mon, 23 Oct 2023 16:25:09 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=kPoNUZX0; spf=pass (imf30.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.218.175.195 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698078310; a=rsa-sha256; cv=none; b=Efbc0PhCqr5Qdx9ku4/upNj5gjYPUU16pyS1kYa63ORtt14xI+RQdHL/pIBk++i/uOAW4n nhQB+2qdh/fZNbPJWz8HcpVdupuWMJZ9Dd1ttYe7KtoMWcMOuFfq/uSpgCxnUaA4ASlcx6 UMTHn4LqtKB+h8uSAvriUe1KmTvuFaI= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=kPoNUZX0; spf=pass (imf30.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.218.175.195 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698078310; 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=EAtH6mtyDDwPJA3G1u2tEpoRGlDDlV29Wi3V3trZXF4=; b=mdwwzjGhL4kfkrpJkU8W25nP+fQRMkYENiPc9I+URXsfd64mdtEEArUUfEIMfhJXqlMgFZ oymGN4TF0926qvcV74/JCm23XrS6Q2Hq7hM20X8X6SqRImpZqbeTv2AIPXpwL46os79M2m RdcpbBPOgeaEOWA9v7LiJujb31+kA7k= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1698078308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EAtH6mtyDDwPJA3G1u2tEpoRGlDDlV29Wi3V3trZXF4=; b=kPoNUZX00gmVx2jTNWUBw1MnjfYZ+Ih+Xex2SmhQ0zyGsX2Ioeza+QBykBxwXLreMwqivE M2aRr8G1yeGyH9/IfvhHARI9SQY8lVb/5X48pbhNEAEo4GD626fn7sdXdC2E92CjCX+Meu xIXcm3bRhi2HV2gkZQpZtoUQzaGzoec= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko Cc: Andrey Konovalov , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Oscar Salvador , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH v3 13/19] kmsan: use stack_depot_save instead of __stack_depot_save Date: Mon, 23 Oct 2023 18:22:44 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 2142880021 X-Stat-Signature: bfdestbwh5yz9g8xind7iy7eeasrerdu X-Rspam-User: X-HE-Tag: 1698078309-146067 X-HE-Meta: U2FsdGVkX19GUb115bej9JdZAMRtOz9XvmWvMPT9kYlw/z5haj1GnPgrFD0t45c6SNo+tPANtyXpXaivtG6LZyWJhRqhZBY3usf6tWAl/iOgur7gbxIVxmCME9+HK0zmVifCAGidH0qdwLaelQFxHlE+fzeRiA35PpKlDBOYtmC0ud0nfcOtf/RurdWgPLRo2WfKzhGbeqz461wrkpGOaA6kp39YOJioscrxt7iZxixHYoL/GWPTLswNyTPK/t2ahvbb+5mQXmdQj0R0ueYtLywjd121qgAQrjDIedEiyON/l5EJZuDBC4ZbKVZKwc4R8lCfVmh9sLMNiMYN3Tht9QEeQIxHpwDQuIIOutRAkGd9E7x0fvHmo3AYb1sTDO2RwxJGZdWepG/Nh30lhmc+ldq/xF8B5usbEwN1JkZSeYeTnPlyuAbYQbkEp7tuXl+9L9Skf/BfxW069xYA099+3iyAAzUTGJqnJZ69z3AVOs+rtpSnX23BcrR+0VHPbFLJHZz3KsVUQjZV6/7FSbH87vXDaaRW2/qQFYB0We/5ItwOczExzzqdaYlynzoG3d5h0l3vP0D6NZKHQbPsNog1omOtqwASKnSWckfQY6dquPRWnzQmpLGj836KpL7CG5IzJS0tnBQIFKUZBsJ7y6aPQKJfLm5I3CWlCz59eoWNFkOenQR1TSjB0qhOCMw8r5V2CP/55hx0CofjZedjDk6zlFxZ+g2Gj4o0M5npgwp67lCH//xRrvEEbUKgr3PwCCyIGMIOzS6XVhB6p4Us92fpXcEsUA4ihuh/cd+sC/mfEhKohR9eNUXg640msupImByhjpIXtJXbTnDu4UIWvpk17BKVkZhSi02ClJGhy7X6tMpoyd+NCtX1xR6J7vC7mCogIxIqvWYbxdF7g6h8P7g4mdzT1H14M4yU1ndzqmmTCJGYn5JXrHafl5RJnHBmvpJpwPVYB3RvdhckaQ4oRbx uyiLR3SW XaGFCn4hg1Potm+UfPcnWvC8xO/33Kj6IkxCLgqHA1BekXC61AGbv/94GS+FG6Rkvo6xod//Pa5NXKOPCJnsml4ZrPKvMPkYeMhJDG7iQ/E1WF5o63MzUTcc9n+iXyAduiqpb 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: From: Andrey Konovalov Make KMSAN use stack_depot_save instead of __stack_depot_save, as it always passes true to __stack_depot_save as the last argument. Reviewed-by: Alexander Potapenko Signed-off-by: Andrey Konovalov --- Changes v1->v2: - This is a new patch. --- mm/kmsan/core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/kmsan/core.c b/mm/kmsan/core.c index 3adb4c1d3b19..5d942f19d12a 100644 --- a/mm/kmsan/core.c +++ b/mm/kmsan/core.c @@ -76,7 +76,7 @@ depot_stack_handle_t kmsan_save_stack_with_flags(gfp_t flags, /* Don't sleep. */ flags &= ~(__GFP_DIRECT_RECLAIM | __GFP_KSWAPD_RECLAIM); - handle = __stack_depot_save(entries, nr_entries, flags, true); + handle = stack_depot_save(entries, nr_entries, flags); return stack_depot_set_extra_bits(handle, extra); } @@ -250,11 +250,10 @@ depot_stack_handle_t kmsan_internal_chain_origin(depot_stack_handle_t id) /* * @entries is a local var in non-instrumented code, so KMSAN does not * know it is initialized. Explicitly unpoison it to avoid false - * positives when __stack_depot_save() passes it to instrumented code. + * positives when stack_depot_save() passes it to instrumented code. */ kmsan_internal_unpoison_memory(entries, sizeof(entries), false); - handle = __stack_depot_save(entries, ARRAY_SIZE(entries), __GFP_HIGH, - true); + handle = stack_depot_save(entries, ARRAY_SIZE(entries), __GFP_HIGH); return stack_depot_set_extra_bits(handle, extra_bits); }