From patchwork Wed Sep 13 17:14:26 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: 140030 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp761904vqi; Thu, 14 Sep 2023 19:42:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IExDp+rj9jPs7PI7SZhiUJL1K2Rg8W1NGOnMgQQCOU2aBw4YRLBNZXlpuY564FyvOFWOL82 X-Received: by 2002:a05:6358:919e:b0:142:ff63:2a89 with SMTP id j30-20020a056358919e00b00142ff632a89mr709552rwa.24.1694745737854; Thu, 14 Sep 2023 19:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694745737; cv=none; d=google.com; s=arc-20160816; b=xlexGq3K88fmK9LIRmk33VbzMjknryoacncNopm7r6Hsu51oXMd+zMCyn7kXYEVAQ7 iAQrwhgi8CmImD8kXP700PAoi3cvnJJOl/PGRNY38LfgoRsoPC4PhYEJuLuZUk5WPueu 9Y2NjBV4PJuj0p+UFEyx5KkwHcZKKgiN3t86MFFu8OqsurHALjCUWiS66Mk5hmOxrMBi VWwRlLPsYf+f+x9FrnUI3jaa3vl9rHvSfF2sRHwar59BNRnd6AHW2m/0hVwjo17RRcvZ oxfXiMTggIOlt58s7JpLvX/VVBy9Ka432Eg/LqqyfNMDTzNexcmIHNY+hGBV9rseGLhn fxqQ== 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=dA6zDrMISQ9ixV+61d0CbJSFq6N+6qPUyMdB5Zjx2Sw=; fh=nfQSbTp1dWHt2Ier1Up8UhVNdXOqoJJLNvTrpT3jJEk=; b=hAaT8CRAzV47eBs1R7WV1wNrM+Z/xbjcPcFc+tNqtmNIltTjoycW39iKynsLV+pLVf FD+ITJHwSipy+pyfzoAn/tDvmkLP2cR3DZ22dX6g3ltZYoPW/q38yCVWJp2Asd6j0FWK RtNxdcKzd6sDuFQ2CpHPhfgk6e7NWW+D/oHkDTWdJM/a++CIYNatjnU/dyXkkZYSpnr6 7EVsbv4PMY3RjMCmdWIBsAOoZpDx/THEswaYIlaQB5Eb7VNs9Am6GBZJnSx3YAogcOk9 G+sueo/mmw7+vi64tb+SOIyLcTA/XAqTAwfyUQUyG7sLWNjJoUe9BFU83NVqlKqC7GSR 8IEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=NRb1zL10; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bk13-20020a056a02028d00b005658a6b71cdsi2456548pgb.1.2023.09.14.19.42.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 19:42:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=NRb1zL10; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 0B2A781410E8; Wed, 13 Sep 2023 10:15:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230451AbjIMRPB (ORCPT + 34 others); Wed, 13 Sep 2023 13:15:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjIMRO4 (ORCPT ); Wed, 13 Sep 2023 13:14:56 -0400 Received: from out-220.mta0.migadu.com (out-220.mta0.migadu.com [91.218.175.220]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37E0598 for ; Wed, 13 Sep 2023 10:14:52 -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=1694625288; 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=dA6zDrMISQ9ixV+61d0CbJSFq6N+6qPUyMdB5Zjx2Sw=; b=NRb1zL107/rDRfFWZsp0fzET+7d1A+RLuXbBLhV7sSeKYAUQEbzOobo5W1rWEVCjdjE0Dd pknESjG2AuY5ulwmpFZM53Irkq/aSdHZnmh8PdDGcyQD9/nZGmn8edi4yz2Zs/OVi2gb63 BiRpglut78hvsz84TfRJUgNxqmxUdqU= 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 01/19] lib/stackdepot: check disabled flag when fetching Date: Wed, 13 Sep 2023 19:14:26 +0200 Message-Id: <66bf1f0ad22d2c49ef500893340c71355b71d092.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 (snail.vger.email [0.0.0.0]); Wed, 13 Sep 2023 10:15:03 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777069707134044917 X-GMAIL-MSGID: 1777069707134044917 From: Andrey Konovalov Do not try fetching a stack trace from the stack depot if the stack_depot_disabled flag is enabled. Reviewed-by: Alexander Potapenko Signed-off-by: Andrey Konovalov --- lib/stackdepot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 2f5aa851834e..3a945c7206f3 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -477,7 +477,7 @@ unsigned int stack_depot_fetch(depot_stack_handle_t handle, */ kmsan_unpoison_memory(entries, sizeof(*entries)); - if (!handle) + if (!handle || stack_depot_disabled) return 0; if (parts.pool_index > pool_index_cached) {