From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC384606A32C for ; Thu, 3 Dec 2026 05:03:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.u-boot-project.org header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default header.b=cx9vZk2W; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=WPdnOpmI Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 83EA485095; Thu, 3 Dec 2026 05:03:43 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id e6sqDA-yhafz; Thu, 3 Dec 2026 05:03:42 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp1.osuosl.org 6FA9F84EE5 Authentication-Results: smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796274222; b=rJGKdCyTxDoybgeeXp8nf5ibKFfj0CK9uJ7WaWPm2xjWPGhi/7i1xtAFkjBtYYHDhUjk 5SkU438SSxUcHZR/jG34jujNUQGlGdU1IXf/czMXxwrPROQOAB2mgbwZRiBgjRZgHw5MJ UxsQ8VifKJ+Z1omG6OYpMn6vC+2HL5T6gH0iVNDSlJn5hvnzTefbb67CUGuaqobhA3kDC 87MfEefen8iDVpJ1V+r88yQJmv6fD2qs/WczNIsE6jmWjeaj7qqX6at3RcoX+eh0iVNBm Nz7YCpsM00a0islJtIaddqxDnuasHL8fFtqLXGhvJv288jo/FN82zRiRWFlQjWPYrUw== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796274222; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Gm-Message-State:X-Received: Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type: X-Mailman-Approved-At:X-BeenThere:X-Mailman-Version:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:Errors-To; bh=XNunGS04Mft19PVdG8u4jifBXuIzQjTQ7gOOwDhKdmI=; b=ZfutD3yUy79LimKi6VO9wG3h/8dClL8sBfwF5vaKUp3xZ/6DHNmbFA9OWU/xLFZ1V1DK EOhDEqJGXm+J8JYi6B0laAPiJNcYpGnH+c4PajJ2KZoshBOMCeVimWSmX/5R/vJfm7rbE 339+/r8xv4/qrBSQoT8m3f6cKe4tE2HPCn+1pG5GpS2evK8KLkkwxBPDTMq1ANfBF/a2M nGBBOpxbw90rMkIDfOVfXyJT/9eNU2whihkhVUngn+A8asYfiQi9+RxlLMOcFLxbu+nog ADToD0XidTGbArAP8vlAOxEh0Pisxr5rfftle06Bl3P2EyXYi6j+AMdqcJU6kQznURw== ARC-Authentication-Results: i=1; smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org; s=default; t=1796274222; bh=XNunGS04Mft19PVdG8u4jifBXuIzQjTQ7gOOwDhKdmI=; h=Date:Subject:From:To:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=cx9vZk2WoiaSB5AiCo1h0grEvKfUgNS/lbwdKxKb1PPTW6YFPSSlVRS3NCselE4V8 wubt1ezQO34iClZ+CbwQjD2vBLiCzGXoOpXXrlYACBAfcUhr3R9NOX36ovTEP+IE8o dRhnXrV/1wE9Z4dI/KAiwSwdB+XqlZJboYiOOMyAqSJYKA0sc/7wMLwNpv06woVFPr Is24gGNT4H5cxZ7zaFnLR3pPIYNkRplsj2SPvzRk/IBX2RmcZwCRyCZPmqI99CtM+o 83Nb8h0k9tr78Xv5BH9ez/LhMOa6BFo8Wf1ZUHyu4ht20WRRvn/q8kLAg7o7xnEuIR 2A8Vnntro9eZw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 6FA9F84EE5; Thu, 3 Dec 2026 05:03:42 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists1.osuosl.org (Postfix) with ESMTP id 4DF78158 for ; Thu, 3 Dec 2026 02:21:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 33B7A50480 for ; Thu, 3 Dec 2026 02:21:54 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id mg860ymggqfE for ; Thu, 3 Dec 2026 02:21:53 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp4.osuosl.org 825BB50479 Authentication-Results: smtp4.osuosl.org; arc=none smtp.remote-ip="2607:f8b0:4864:20::1346" Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::1346; helo=mail-dy1-x1346.google.com; envelope-from=3ptiqawgkboumqxuvn1vpxxpun.lxv3-kxx2ur121.3-kxx2-y0xsnl2.x0p@flex--dholmesm.bounces.google.com; receiver= Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=WPdnOpmI Received: from mail-dy1-x1346.google.com (mail-dy1-x1346.google.com [IPv6:2607:f8b0:4864:20::1346]) by smtp4.osuosl.org (Postfix) with ESMTPS id 825BB50479 for ; Thu, 3 Dec 2026 02:21:53 +0000 (UTC) Received: by mail-dy1-x1346.google.com with SMTP id 5a478bee46e88-3854627c1c8so17873056eec.1 for ; Wed, 02 Dec 2026 18:21:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796264512; x=1796869312; darn=lists.u-boot-project.org; h=content-type:cc:to:from:subject:message-id:mime-version:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=XNunGS04Mft19PVdG8u4jifBXuIzQjTQ7gOOwDhKdmI=; b=WPdnOpmI6XTxLww35aTZHGz2ScR/KJpYTmUdwCzo4O6YxeUUsQ2LKUq15uyUynT26o G9M0pCEa7TrtXBbyWQwM+2hwggheBhiTJ86shdDLFByfrmNgM2qZnrwsdE9Jmv6kMH8e inM3kE0+lwWAZ1OBbfHEt8UZgZvyoc/CuqTw7bm/RHOiAJi/fal1kkp9yunWT8h2lm7l p4pmtLdwVIzXxPZfgHocktKg4uLeT+0lHk8lV3MURdINycbb4R5Qe3e0PLjwtF/YwIrP 0H8Sr+STYiOJIZ8JwRh1a/KWfnRqJ1uenFmC/k/5T6z5YFKYgwq+IDvSmWmzBS9QVXla JKcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796264512; x=1796869312; h=content-type:cc:to:from:subject:message-id:mime-version:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=XNunGS04Mft19PVdG8u4jifBXuIzQjTQ7gOOwDhKdmI=; b=n7RcQbSx6JA2qd2P1pcH/j1UV9x/KRMmovGJsvM/uwNoAsVLakcB5/71mcTlvWt5cR hiB64fdIj9E7lFxm2MMbLhl0mqm4V33O8jUg11AY31riX332WnKzSk8yHnTMMtU9d0UD 53ywtlBnV1QFhqJmFdO2hb/DjNPxfnqOnNGu9lJPIR/2tWaK6y/YRgervnObJDnLSwe1 6pjKChhed95CzgzHvD08IBVrjlYsogn2a1mmIXi3sAgnpPsCCM73PlvgeQ9KSs1zjOm8 Pa1OhhWozm62f5KdM4Hj79M5yb9g4YehFm2BMcJsHz1m3yrxmDsgO3lb19sFCdR5RF1t r5Ig== X-Gm-Message-State: APuU4Z9t2dP7Lsl2Io5zKLyLqBHPyzKJes5YQ3ErdzevK8zgTo3ooKSt qL03cs4X2oaI7dIWo2FtU24l2sOmvRjQsUlH23DPY2hfAGrZceWjSM/C0kM0+3yA2YvyLoXCJBv PL3jCQQgtUd5NsHlS5QdGBVJQYdQc+XaD7TO2/UfoVpVUzFGV13ubdt0auSaSHROITwiihUKHK9 XGzwlgjWLMETz/phMxFyuAtZQ8AQ0O52iWHijttCCWz2InsyAOtE86jbx59SE= X-Received: from dyah11-n2.prod.google.com ([2002:a05:693c:83cb:20b0:386:458d:ba4c]) (user=dholmesm job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7301:d183:b0:386:a728:6c11 with SMTP id 5a478bee46e88-386a72872d3mr36012393eec.17.1796264510712; Wed, 02 Dec 2026 18:21:50 -0800 (PST) Date: Thu, 03 Dec 2026 02:20:58 GMT X-Archived-By: Mime-Version: 1.0 Message-ID: <20261203022028.03-00-dholmesm@google.com> Subject: [PATCH] smbios: Guard invalid ofnode in smbios_scan_subnodes() From: Dan Holmes-Mitra To: u-boot@lists.u-boot-project.org Cc: Raymond Mao , Tom Rini , "=?utf-8?q?Frank_B=C3=B6wingloh?=" Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Thu, 03 Dec 2026 05:03:38 +0000 X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-23.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Return 0 early in smbios_scan_subnodes() when ctx->node is invalid rather than passing an invalid ofnode to ofnode_first_subnode(). Signed-off-by: Dan Holmes-Mitra --- Mirrors commit 8327aa9af4 ("smbios: Do not look up children of invalid nodes"). Built cleanly with qemu_arm64_defconfig (CONFIG_GENERATE_SMBIOS_TABLE_VERBOSE=y) and sandbox_defconfig. Checked with scripts/checkpatch.pl --strict --u-boot (0 errors, 0 warnings). lib/smbios.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/smbios.c b/lib/smbios.c index afde6401ae..3ccd612f73 100644 --- a/lib/smbios.c +++ b/lib/smbios.c @@ -965,6 +965,9 @@ static int smbios_scan_subnodes(ulong *current, struct smbios_ctx *ctx, int len = 0; struct smbios_ctx ctx_bak; + if (!ofnode_valid(ctx->node)) + return 0; + memcpy(&ctx_bak, ctx, sizeof(ctx_bak)); for (i = 0, child = ofnode_first_subnode(ctx->node); base-commit: d1caced3a435607435cb7969e34499051a4ac1e6 -- 2.56.1.911.g883d8bcb20-goog