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: 156979 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1409922vqx; Mon, 23 Oct 2023 09:25:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeseeqWaYV5c0kD8XnzrYPt4E/+cncaL2qgttOqIi1kpuoc4vXd7wrtFLKwKpQyXiWoHT4 X-Received: by 2002:a05:6a21:1cae:b0:16b:79c2:877f with SMTP id sf46-20020a056a211cae00b0016b79c2877fmr45152pzb.53.1698078356091; Mon, 23 Oct 2023 09:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698078356; cv=none; d=google.com; s=arc-20160816; b=tLzjNsLBZKxiltv1Ol1SkiAqcWBxbfkli0hGIW4RWKX9AxS4zU8VKy+9+t7U7i79bK vazdv5pdqupO2TUKDyzp3FoAopjolTpxKU5GLrKFlCoyrWdGKE+Nn4yZQkZjF9wWWKNg 7ivpWhk4dAPsHwjiMgdNwbRgfFlmu52UgaoqZjA2arkr9GZHLkYx3uhSEXSuUsrM2tY/ KmeUDevjU/lD+2hdJI07C8YhlZgnk0WuchnKxOfj50YpvGqlN0ieBrVfBiE35QNgCS5F vd+49JYpb84Hw5XTh7J4uNSLh91SHX95QICP7VJMWSFY6vWn37I5gyaizho81Sn0uiPT iw+w== 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=EAtH6mtyDDwPJA3G1u2tEpoRGlDDlV29Wi3V3trZXF4=; fh=nfQSbTp1dWHt2Ier1Up8UhVNdXOqoJJLNvTrpT3jJEk=; b=RbYrqXM2nOf4FCPt1o+ulXtbZafZIr0VTGppV++IWfIgHfMbfPMc6WSt4bFmyjY3Qg OtZ2xPStjNrfk8X9HIa73ACx1K39d+2+BiugSf3PLpERgbkawoMLAwgy8p+QdC0bnLS/ KagyxixTB48wuyarluVBO1rr4YNA9eHp0Oz0dLjQzOjKcaEz6+rS2PbQ+M7zgyKw1ktl /6xqT028U2rbv+swgtjFolseT7F/dsuQBHFYCc3p3oun0fPD2lBWSdhipfOVvwdimlpA 6z30MJDCZDd2cMyQvva3Kxi6hy2Ewq56SeU1JpS1G0YKVU1JAxohG/SOgHSeHZ9NasC2 3+pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=kPoNUZX0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id s194-20020a632ccb000000b00563f627f2easi6618255pgs.122.2023.10.23.09.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 09:25:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=kPoNUZX0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 1F0868061176; Mon, 23 Oct 2023 09:25:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233519AbjJWQZO (ORCPT + 27 others); Mon, 23 Oct 2023 12:25:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbjJWQZM (ORCPT ); Mon, 23 Oct 2023 12:25:12 -0400 Received: from out-201.mta0.migadu.com (out-201.mta0.migadu.com [91.218.175.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63872E4 for ; Mon, 23 Oct 2023 09:25:10 -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=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-Spam-Status: No, score=-0.8 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 agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Mon, 23 Oct 2023 09:25:36 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780564210702161143 X-GMAIL-MSGID: 1780564210702161143 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); }