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: 139058 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:a8d:b0:3f2:4152:657d with SMTP id gr13csp45977vqb; Wed, 13 Sep 2023 12:43:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9M6dIfwhFd/PHN8ipcexyq0N6csdWr3PYuXZjGndthXNd2VC1SV368Zqa3YXpMBmlX2ro X-Received: by 2002:a05:6a20:ceaf:b0:14d:e075:fc5d with SMTP id if47-20020a056a20ceaf00b0014de075fc5dmr2796525pzb.40.1694634191326; Wed, 13 Sep 2023 12:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694634191; cv=none; d=google.com; s=arc-20160816; b=D0gqhEFEyGgTYoB8gGEyyDzUQOPYghBY8n8XDu5hZDpTV+lqHUgo7AgCqap1q84ROf IJh3EjBC7eVOHYJPvLTZ6E1M1rPVDEUNSlYvD1Cf9NVnpbI3URmkyMA+bJWs3hC1P23v bAP7VlBw3kDLRze5eFy0x6v+bfmeYZPDgx+E+LMRyKw/Z8rCqKk1QX60MrWG8w23kqYK ZJcWcmaPJkOWsp9cG1HEIqUEcZAgvoUZkpmdF6ESjSnXvvtn78wJpXs4FMesgQqMdOh/ CDH6BVkaMHQArlxnKfw6NlcbbfXO1n5wkf+xrMcvWQX79iOOCHxDhc6uj2tXIpkg+XT7 Weng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DC9UmNBNkxmGXhCZnNWnsoHzitcm2pHd/lCALP3GjjY=; fh=nfQSbTp1dWHt2Ier1Up8UhVNdXOqoJJLNvTrpT3jJEk=; b=Wdub+hsCF5rKtjRVW61KGIs5d6f/1Z5BS/TRNy2+GKLQqndpoEsc0TUdoIluzFR6BX iMLAJSYF804OlU86j/UAOV6sjWGzw4ZEym9bbdf9qKyR39ZgsGP8Di3wLhxUzG2nEsdI DB8LH/V0CXnkjb/Q5qPty9w4eT6/lImU+SpVz7zaDJWy41wlx8Uh8BdvmhuhXlU3pkQt DyJd6y+yf9wBFTtLLg1K0p2uJIBMFXiENbNIvQvpL6uYirg9r4BZSER9mt8l/kxIx7uq kVSh+7DKPeo2uqSwc3hyhFciYZjYDkT/rqGQiZH+aaJBirk5ci4IrPVsfgp2R/S9Seau d++w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=riuufySF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id cl8-20020a056a0032c800b006902507d409si520318pfb.174.2023.09.13.12.43.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 12:43:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=riuufySF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 58B1882E6C1D; Wed, 13 Sep 2023 10:18:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231748AbjIMRR2 (ORCPT + 34 others); Wed, 13 Sep 2023 13:17:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231696AbjIMRRL (ORCPT ); Wed, 13 Sep 2023 13:17:11 -0400 Received: from out-229.mta1.migadu.com (out-229.mta1.migadu.com [95.215.58.229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 095181BCD for ; Wed, 13 Sep 2023 10:17:01 -0700 (PDT) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Sep 2023 10:18:16 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776952741758328306 X-GMAIL-MSGID: 1776952741758328306 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); }