From patchwork Wed Sep 13 17:14:38 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: 13383625 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 B96F1EE01F0 for ; Wed, 13 Sep 2023 17:17:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2098B6B0271; Wed, 13 Sep 2023 13:17:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B8D86B0272; Wed, 13 Sep 2023 13:17:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 07F7A6B0273; Wed, 13 Sep 2023 13:17:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E77A76B0271 for ; Wed, 13 Sep 2023 13:17:03 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BC534B40F2 for ; Wed, 13 Sep 2023 17:17:03 +0000 (UTC) X-FDA: 81232229526.27.D6BF2D3 Received: from out-227.mta1.migadu.com (out-227.mta1.migadu.com [95.215.58.227]) by imf06.hostedemail.com (Postfix) with ESMTP id 002F2180020 for ; Wed, 13 Sep 2023 17:17:01 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=riuufySF; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf06.hostedemail.com: domain of andrey.konovalov@linux.dev designates 95.215.58.227 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694625422; 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=DC9UmNBNkxmGXhCZnNWnsoHzitcm2pHd/lCALP3GjjY=; b=KP66c98h0+ECuksDFYiNr7pKkp35UI+9gGELEoaPOqSeh40nDnrcvjc30asWmSI+KBMY2U 1oxIAo8lnU2ko+WyNIUoEvgEFL8OwK5J0GvjWLDL+k2OR83awUUw8upbiAjAJIq3j0Ed4e J2yd3M48MSqi1sB0KY7544nkTdmpZZU= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=riuufySF; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf06.hostedemail.com: domain of andrey.konovalov@linux.dev designates 95.215.58.227 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694625422; a=rsa-sha256; cv=none; b=pdh8K+Sm8f0jEoteHsIMAke+PHj4P0v9vjlxz9EC0LxIF5uQ+ueuSObJX1to2/sxdfTTTF hQbSqYac7YbfXesDKnG7JZMG7LkPbqrnPC2nkrftvZmIvKOowPbaH6O2b2sy2j2StDd+2h oMB81JD0sXgyYIOUp+H419mG5r9+s7s= 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=1694625420; 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=DC9UmNBNkxmGXhCZnNWnsoHzitcm2pHd/lCALP3GjjY=; b=riuufySFxtO02s+5vb9CAH57DenGXrZTUkunEd+rXmQlCvLne7cXHWGh8H/JxSrJaHldo1 +Ti+81/7EXiWikASrBXA2uiFwVtaXJN9opiGB+/Z3fX20LDW1ZVMd8ZuCg94ye7sNtPe/p DZTAmOjByDol9k695KLblDDTg6NOK9s= 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 v2 13/19] kmsan: use stack_depot_save instead of __stack_depot_save Date: Wed, 13 Sep 2023 19:14:38 +0200 Message-Id: <7f6b58fda637238ffc0c240e7fd3b3a6673d9d91.1694625260.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 002F2180020 X-Stat-Signature: 5og8r8ehu7e5rmttrkctbhnaj8y15yn6 X-HE-Tag: 1694625421-114981 X-HE-Meta: U2FsdGVkX1+z4rXcreAv6Gn7a8n3KdH9/79shLCk3EMv6f8ej04dWV+AAD62NGlcSte6qntbntoLEqxahV6SJ8YaDIE4MXjgDy1SL+ONvifpb6QDKqxQnCph/c2lR1oRAG+ReLqRYuFJZrM3ZuOsHPgs40dnhwrSszTzkWFgOhT6U3iUO739JaJZZKNwfbGcnBAPnZAc6sABJmIzwfn2eYFrS+DWyr8LqUaY0+vRYJlXPNZRe5H3ZDDz/MyZOopJ6unmg6muPwz4Ft131J17r2UIrwsWp0aVCfDmtvbGHf6xEgZBr9EOw4bmA4dLLzT8YFyjGkUUlqnnSBuL11/tn76sjuhLWVkC4MOxbIZvKTczFa2tYYHLdOuZ8MlOoLUmFWEQ2ZajwTlfh7AxklRN6N4j43HEHXjeKadIDoqg9VR8J+u9DMy9lkPjY/b75mQfYMPtVZ9cBmLG1eJOK3NG774ebRIMDDN+/Oa6a6b1ZQdMFIjOqxHfRJl3xSwrRErA0uaSnMFeahEatH5UZ7zFmft99sIazG6OogHXO835Bp+98mIMx4gYrcIlwFYgmOzF3BHeyqLtBoqhNkouC0G3FLtyCaqVgja8iRWhMSdny9K5sDyGaSJ1vqebtfGE5/McpGkE006sVeyxutzHaRP6t30Y4q0qsLzHoh9xF5f+ma1GwPNvPEOlXyWkQ3PGxPDrpImJidc0Yae9Of2DJpQajXsfPFj5ZMXUNlI/+qDaH+596CpvWv+6AZueSmaKDj6fDthxFJyfRVd8Wl/uulmnAbJYO76SeTwLN1t5+l9kGEFOukH1yoLLmOwnxbvFj0+ajkC3f+erlDdGYXTU3O1mKsI85JZ055s01elki0PbXGckvU9aenTts05ScPVSs6Vk6Xb5M/376BuI2nRcamWsjV3vlxsA+JAHqVybPWeWSkxOA/9XDLLMQP0W/wYggXqrd6k04wgHCD5EbYTW2P5 egCtKUfp EH+mPvLzAYVE9qovbWYDoiwpcdmdeunIAWmB80h7o8bSAg9eLueMIn92QrlYmCIyy3eShhRYw29Ni4y83X49hQ6Sc+6xAetg5gS11hFiQJ2fdNzWHCHtqF17Av23FLBCFR9Ko+SrvNBvzF37LmGEjXGc57A== 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: 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. Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko --- 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); }