From patchwork Mon Nov 20 17:47:12 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: 13461828 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 C1DC4C5AD4C for ; Mon, 20 Nov 2023 17:49:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8706D6B0363; Mon, 20 Nov 2023 12:49:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D0636B0365; Mon, 20 Nov 2023 12:49:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 622A46B0368; Mon, 20 Nov 2023 12:49:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 4E1B46B0363 for ; Mon, 20 Nov 2023 12:49:42 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1FD4840899 for ; Mon, 20 Nov 2023 17:49:42 +0000 (UTC) X-FDA: 81479070204.23.817BC4E Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) by imf21.hostedemail.com (Postfix) with ESMTP id 509DE1C0007 for ; Mon, 20 Nov 2023 17:49:40 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=b2OIEP3B; spf=pass (imf21.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.218.175.188 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=1700502580; a=rsa-sha256; cv=none; b=0tzACFiwETj+bxEhDaIVfEqZV2G9+Zn/gRlNSdsSaBwXfyybDfZwvdJLM0MuLJoPig7lPA OhkSySNupy6C81kif1wCn2iTsLvdj/9bKaiMZjX+/FNkLef+/hEp8F+1+BaXKOKkaEaiuF R8x/sLAdnV/qDVNXbst/RXTopjwBgTA= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=b2OIEP3B; spf=pass (imf21.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.218.175.188 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=1700502580; 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=AmubiAZbFJ0d/i3HqBc+VhVD2T8fru9oX5DWKdU3rlA=; b=F2MRa3ji8Ro1Cm4q1qC4mEu0FT9SOAmR46cZ+x4T3HyWZw/AKR6BTdakANP4e2Jt+/OpHw UcjH0+JDaLm4PfkwBMXiMj3gc/A0J3MQ/0cGBDx/KukUuk63cYDBXLi8/eCD3rxau1iYpI bssev72YFQelrgVQiZlBMSDZIFcMCVE= 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=1700502578; 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=AmubiAZbFJ0d/i3HqBc+VhVD2T8fru9oX5DWKdU3rlA=; b=b2OIEP3BJYVimjqmep3gX4pnHU69uhP3rz4BbIU0wDtcOHhahRQdj/mDShPRiA2HDFVZhX ObfN7eBTcN91SgmffyLxHsXabiv3RbporAg2HdC9O1DTTM3xtlUsATOXQ2XYASwgncbBwR 7K4umBHx7gSfcQI4eOh8RKYS2iCumFg= From: andrey.konovalov@linux.dev To: Andrew Morton Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Oscar Salvador , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH v4 14/22] kmsan: use stack_depot_save instead of __stack_depot_save Date: Mon, 20 Nov 2023 18:47:12 +0100 Message-Id: <18092240699efdc6acd78b51e41ea782953e6c8d.1700502145.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 509DE1C0007 X-Stat-Signature: t366iifjugnia7fojzmkhpa1op8g3ik3 X-Rspam-User: X-HE-Tag: 1700502580-883497 X-HE-Meta: U2FsdGVkX1+YGFUy6bn6FADHq2QHZVL6MbE5mlYORhAdqVABiogKbAXTtqdgvaduWkU7Xl2fze5gwyRPhQvqEkgCLdotzl9ZFv56smcClJw6YqobYtQBQZ9sDb/z8GyHocjgfiMB89E+RKFdVxphafAyEOPzKzK8U0Xjlp3mv/mKbnCcD7akGnuYr9jr6gBJC9WETN5qnvLo712+BvKqwrnC0kbr0CRTKtJ6Igtlzwu2/1D2J08ejPofmfqRk0YxuqsQJMYv5IJbwcGlVMtV+0XrkKXt95idRwEepbJjml7TWZH6lfyfApF6j6ai1psgupLCr1vR+VGrVt7e/WKgGtTiaTjGXVXKmgZwpoekqktODSauUdlfedq82T8mDWwMmzv4YiEGDcv6CzqNv+vq3mCoU1LA1SrzmYTKMG3Qzcuz03FaUHw6FY8QZXjFEZ7rC0PytXFsqJMf4MnVfY7SbulG9ANSSRRplP/W2iArmtgKegWMeafT1Z8shpIP8YKW+OLaThyXJguui9v78hq2c6En/39nglR6mwAsa0GpeQvfNmk4GBIl4wPJKDsmaB2BcQ/eqNzx0tw8bmaAn/8g5NkAOarKi3pmfgYGGfPONk7ad/PGTKtMTsCUiJJcGQDiNI4hTzBQ1X2oBPPw3iPaBD+hUwzJmC8wO2wQ3vYszp+lI9iHPE8oVbUdPt6aU0xEf+MmCgh0M0WS7/cNdZBY3dDzkSPKvS4BOdf336L8ZzwraP42IOlA2VCKXpxuKKb1R5KeYul192XrTmki1RRYdRU1mvTAKjT5aRNw7RSRefqyyxcS22R/dbyWltwlnqk4M8viwcrY0+KfhNT/yjeQS6CUP+6CPnunbS5GyNzHxgcphAPOR4exC5zVEeBFiaWQbc8fYiDppYDRlduLg0y62lL27jnq2BpVAKOuc/R5G6bCcgF1jgpTft81O5evV8fZGjyfeogmcQNe+Ct215D v2yooeiH mR159ggWQ/kRhygYjJJEPZ4XD7YBiOWg+VQgo/AEee44LrAU1+LGdToBEUK6SyC1gD9MzdUztZHoAE3cLi8VDUhirQI3AF/v0odYnf8olzqfJBi4= 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 c19f47af0424..cf2d70e9c9a5 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); } @@ -185,11 +185,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); }