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: 167324 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp106952vqb; Mon, 20 Nov 2023 09:50:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHoyQObsXEWKO70l2u6IE1LCUlSAD3tTVPIT414LxJVaoJjw6bu3B3ECRCao1K0CIbn9vdm X-Received: by 2002:a05:6a21:a58f:b0:187:63b1:94c with SMTP id gd15-20020a056a21a58f00b0018763b1094cmr7232883pzc.56.1700502617379; Mon, 20 Nov 2023 09:50:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700502617; cv=none; d=google.com; s=arc-20160816; b=dfU9DhRVCrGCfG3PP8T+X629sEsI9VNgHmuu3BemuwAoPIyfVP8J3DnxM10meAIq40 6yI0VAnzjEpsTgwPccOOjj7pK/dW1qoPIZNWHRMGDfsrAyAuHhEEfI2cszox4FSC3EO8 XUXF/dpzihX//aGIr4+asHjJ+6YkoRw6aGJ4eDa8spdvOq0XdlSp6h6ZSWF5jgIys0zn xP96kZS3b8bAHP9vnvDgTA6fCk/cvlyMo/xLPr4bi13iptep32zQxD1uk6jt1uyd2PtG H50Mk0GQcpYIcK6LzliYsbO/nbYGE4XpHOY/bUvCjHX88JgrvwFh88YZ9Rgyr+a1flQk fJYQ== 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=AmubiAZbFJ0d/i3HqBc+VhVD2T8fru9oX5DWKdU3rlA=; fh=qWoxmPN1zRqnLSoCWGpfFsDtzJsx/SGdqx98lbP+Uho=; b=vnjCVTK/429sikC6eCQz6OO2zdSm74Hyum/fX0RyWgtjWY8iAORYZXJD4BqqAwcwc+ Ggd5Dx106SWo0kJ1kUTOjVhmZzvFXtz/DyHwW+iPMiUhQ4/Dc5oKq3IOfNr/SLXuYrpb UcDRobK7B0VNw40GcSgQxk3gZBsRGIa61vK0BGPvU0Nr+9kj4Jr7EKw+hqCDM0q/4uy7 kPBfgZu2xxOKzEKFrSy7Y68RJoVy1JRazqbVpPqVDaCW8y9gnA/t6baO+POMsGDoGm3m N1hydKFUJjDrirCrYHXQtf8NRFsU4vQcYhXBdYS/k3nLBSI6PII9CawdnlqTwm0rEKL6 rlvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=b2OIEP3B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id w6-20020a634906000000b005c2157e8483si6649167pga.231.2023.11.20.09.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 09:50:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=b2OIEP3B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 737C280FA854; Mon, 20 Nov 2023 09:50:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233838AbjKTRuL (ORCPT + 27 others); Mon, 20 Nov 2023 12:50:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233605AbjKTRts (ORCPT ); Mon, 20 Nov 2023 12:49:48 -0500 Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [IPv6:2001:41d0:1004:224b::b8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9CEE10DD for ; Mon, 20 Nov 2023 09:49:40 -0800 (PST) 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 20 Nov 2023 09:50:16 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783106232731393576 X-GMAIL-MSGID: 1783106232731393576 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); }