From patchwork Mon Nov 20 17:47:00 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: 167317 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp106198vqb; Mon, 20 Nov 2023 09:48:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHeKzrj9j/PakqatzHwTVhkv0MSIjFcCMdfvkjuFD6TMdkm+ZcITqChOCMRDy7gt3TntijC X-Received: by 2002:a05:6a20:918e:b0:187:e3a5:b35d with SMTP id v14-20020a056a20918e00b00187e3a5b35dmr235509pzd.13.1700502534924; Mon, 20 Nov 2023 09:48:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700502534; cv=none; d=google.com; s=arc-20160816; b=KNdPC1AetPzMKC6+8H/vPo9fCbCIkw+mONxFbMDmE59C20GvPplw5zp/Xe8Fwe4p9G AxkuYKg3Ray8S2GQjzFE9GT/PWWm8WMRZoWQ915gEEH2eX4sXUNOYPbP77t940x8bUZ4 JcFxbZydP8MI4dAYESgyZDy7076jOMgj9Qp0ZKw++pKN/oaItBjrkczUwrC+AdN3cw88 ZNp19V1ryEASj5w+HDyZSZ6Qtvn9mni52JweTP6513/nZvIynf6PKypTOoWCx4bccwdp 5Xs2vRFoHOV/8AWLGWkGzyyiGMjfbqj2UZEslptf56JIOncA3o5zLukFhsExDY8COWkI sbdw== 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=4GD92F9WT2lJ15sdFM57D7OnzHXCVz8Opyiuivl9/aY=; fh=qWoxmPN1zRqnLSoCWGpfFsDtzJsx/SGdqx98lbP+Uho=; b=zjNWfFH4LXv5MxpyYLosUdl3XU2Cyi/TJMVKe5ZkesuMavq4QUBWIpVBx+rgXqacMk 1HSefcoags/VViHOovEX7FmRmQZmgLyCgJIpaOP34YZQ+H9O9QGQydfLRpbTaVXOVtz1 z51PvaDPuJtm1TkOxcI/KXVhzWp/USQ5+5yIep38ZJ3TUK5Gl47s4TjoUz+Jxxixf/mB uH8iiDQyn5i9+GlPExR5URYFAxc3v/OxhY6+fB9YVahkOQ6cO1FL7IZxzT86Bj8SpOWR trPueeWsVNfiMCE7npuPBOCWI1aX73A5iZ2lsSAXqo3xanufyvfXD+xQmHNgkon9DG8s NsWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qyhdPL9y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id x28-20020aa78f1c000000b006be08015248si8366325pfr.294.2023.11.20.09.48.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 09:48:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qyhdPL9y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id A248A80A8BB8; Mon, 20 Nov 2023 09:48:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233862AbjKTRrk (ORCPT + 27 others); Mon, 20 Nov 2023 12:47:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232547AbjKTRrd (ORCPT ); Mon, 20 Nov 2023 12:47:33 -0500 Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B871510E for ; Mon, 20 Nov 2023 09:47:29 -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=1700502447; 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=4GD92F9WT2lJ15sdFM57D7OnzHXCVz8Opyiuivl9/aY=; b=qyhdPL9yHGZwgbX97BEztXeCz1Zt+rIj3RmbbGcjPTQsTwh98G4ATjxhFfnwka3CKqD1b6 x9kwKDWmny/BO2cvVbgqEwg2/wpgt3BzZx3yBf1KxUz7o5wnkBkYXhX4a/sfMby5QWyf2c 4HelafeGlMBXbFW+ItTdiGsKvqfzEZg= 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 02/22] lib/stackdepot: check disabled flag when fetching Date: Mon, 20 Nov 2023 18:47:00 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Mon, 20 Nov 2023 09:48:52 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783106145974898764 X-GMAIL-MSGID: 1783106145974898764 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 Reviewed-by: Oscar Salvador --- lib/stackdepot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 0eeaef4f2523..f8a8033e1dc8 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -483,7 +483,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) {