From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0B3941D63F for ; Mon, 17 Aug 2026 12:43:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786970590; cv=none; b=s+ge8+PdxhPSFW+abMiEaQtPcUEaAI3ZMU4XJJxMz9sJ6ZJwxk2VNjlkC5XJxwTxwlix4MwrSi2a06dBQUoTRSsb9Fz9e+RVBbuihR8mg0J70uoDQjCxY3xrNlSOU5hiKW+cY7OQsGFGR/ihW8D6dF8AQBXng/A7XvDIQgwSQoU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786970590; c=relaxed/simple; bh=hXSxB88HffoakItr/FZbk2oDQISod625nOxGbRtEfbg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NIzVH8ntC3OEPY64/Ez0JnRLZE620OzKLvXiTavXSgvqwmeBn0dwtw/E/vtRAU+IOHaog7uHdw86vojVHRmUmWnkdMTfkKex2hNs0huIFOwm97QG+6cfF8v7LssrPGELTPdYM5YvX6T2EBZgGfXWzJ06odT7/qCtvk1sfQioaUI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jJFP9fzs; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jJFP9fzs" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-6a38098734bso4800504a12.1 for ; Mon, 17 Aug 2026 05:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786970587; x=1787575387; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=9gAEJlNZVcNXMblqkUJuiyVruC7lTjyCbl+Qw91/T4Y=; b=jJFP9fzsPoPziy2SSp2kE0r8jQWEsZTG0KMz0MULv0yKwNvSyZaeMnsDJzlQRHNUjp i2+Yi0K8vwuv8VOIgHRsGCI41UEprU/n0Y2vSuFJ11cCW604YNUMlv4WTucF0rCd2/D7 LPAOZcDy0XRqKWgLUzeNFiDBIvDRFAG0DPWTW0pjySWSV+Jn4zCht5rVh7hcNrD+YUgn WxSncia8FUlUWbhmaZXkOD6SdcwXSK5Jo8SjtK5UY2rcNuvxHtyXpGvYC8urNW3pUZ1B H4LuttGi/yLhH9JbChai9KHU3GLGyixrHBBwzvs4NlhC48k065KTFXFAKYG9yRKxnQ1v t7Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786970587; x=1787575387; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=9gAEJlNZVcNXMblqkUJuiyVruC7lTjyCbl+Qw91/T4Y=; b=YnMPoETZ2b7zP5KBYp5sb8ktp2u6SohZuvGFiLyKI4fGa/qN7SvpG+hYtWhZpkiTnk D6sGKRFOfz1yZztVRmm4+EE1eSSSLPXWuObTWEDPEcYVmJMwFd465Dizl1JEkN3d13Q5 PnN46fbnY2OeOl7eQ120il7jBWRXiETqyWk2T7aD47TATfToO07uqy7Ioltz/PdIHaPF OD7vgBmW9bLgz8SySk2iQvEZW3f51xZZev8j9Eh8h1DbRJqk7sNPnFINoGokmxBVEeTp s3fjyVTLm4WQ53MEhjjcPKBZLffWNzjMas6enCEdT9JZEfhjQubyQaHvzIimpqkegTIy SPjg== X-Forwarded-Encrypted: i=1; AHgh+Rofo+LogadBxU4yaOJciUsz4rKd/GHiZ1rrh05GBTMmIEDqby5theVPXoSUlFOjrz1aVZNaSKl6hx7e29s=@vger.kernel.org X-Gm-Message-State: AOJu0YxAcYfIGgpdzcpYLNhLBgXKCJy/cIHQLNla+D3t9oyYXexahDWy bkgFuflMLxLfT36I+sdhTl+vo1OMIumTbL0VLDlAdiFgDU7N793dXEMh X-Gm-Gg: AR+sD13tNKl+0u3xrZ1qHKWIeA5+Xt8M3Sx14+PlLWI3KPLeJSpCZq7424xFywqoFZj fspcsGjOORDJfLhIjsw8YOKw4eHdJV8ErcDGBEOdYZ0E1PtM8hTeOLgVGkmlhv2vy80rTy0gUwA zhHo9UAkyans/Vyrzxy+Mp4d9iPJI3XPmu9dVXfzMYis66EZ3hGyfUf8Sd9Vo1XtQNFYc/y6gzc +0anZgsczsGXd+WzqqNwryTrG3btgw3+lBq/WtxEpV0SoXq4YRxVvwY4GcsS6n43esG804IeeUr Gvh3OlBy1PGWVOOBLc7abir0jQUnhwnZE8UDd4po63YBn9iLw3BHLr+9ML1rR9+SHp517qRa0fG U/2MDrN5ySNR5frf6i3CESOpgxMTMc++onNQVPV+hQk+6jyP98G2Wm9xXdMKGEn3bcN8Yfp8ZSU wrKOE/7PxRs4CT47+ur7lpX5d/7/dTKjUW8Hd8P31z++s3eZArew== X-Received: by 2002:a17:907:e1d1:10b0:c20:1bc5:6ff1 with SMTP id a640c23a62f3a-c212a18c668mr795218466b.5.1786970586864; Mon, 17 Aug 2026 05:43:06 -0700 (PDT) Received: from [127.0.0.1] ([2a09:bac6:3861:1e5a::306:a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c217feb99d4sm52626266b.22.2026.08.17.05.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2026 05:43:06 -0700 (PDT) From: Caleb Kan Date: Mon, 17 Aug 2026 13:42:48 +0100 Subject: [PATCH RFC 8/9] scripts/gdb: reject trie-backed stack depot handles Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260817-stackdepot-trie-v1-8-53870ca1651b@cloudflare.com> References: <20260817-stackdepot-trie-v1-0-53870ca1651b@cloudflare.com> In-Reply-To: <20260817-stackdepot-trie-v1-0-53870ca1651b@cloudflare.com> To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, Vlastimil Babka , Alexander Potapenko , Marco Elver , Dmitry Vyukov , Andrey Konovalov , Oscar Salvador , Caleb Kan , kernel-team@cloudflare.com X-Mailer: b4 0.16.0 From: Caleb Kan The lx-stack_depot_lookup command can materialize stacks only from contiguous hash-backed records. Trie-backed handles instead encode a dense stack ID in pool_index_plus_1 and offset, so treating them as hash handles misreports a valid handle as an out-of-bounds pool index. Reject pool_index_plus_1 values above stack_max_pools before the hash pool lookup and report that trie-backed handles are unsupported. Supporting them would require side-table and parent-link traversal in the helper, which is left for future work. Signed-off-by: Caleb Kan --- scripts/gdb/linux/stackdepot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/gdb/linux/stackdepot.py b/scripts/gdb/linux/stackdepot.py index 37313a5a51a0..82aeb9f532c3 100644 --- a/scripts/gdb/linux/stackdepot.py +++ b/scripts/gdb/linux/stackdepot.py @@ -37,6 +37,10 @@ def stack_depot_fetch(handle): if handle == 0: raise gdb.GdbError("handle is 0\n") + stack_max_pools = gdb.parse_and_eval('stack_max_pools') + if parts['pool_index_plus_1'] > stack_max_pools: + raise gdb.GdbError("trie-backed stack depot handles are not supported\n") + pool_index = parts['pool_index_plus_1'] - 1 if pool_index >= pools_num: gdb.write("pool index %d out of bounds (%d) for stack id 0x%08x\n" % (parts['pool_index'], pools_num, handle)) -- Git-155)