From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 624B71FF0B3 for ; Thu, 10 Sep 2026 12:15:56 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id A558421603; Thu, 10 Sep 2026 12:15:52 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Subject: [PATCH installer] fix #8020: common: dmi: don't error out on invalid strings Date: Thu, 10 Sep 2026 12:15:34 +0200 Message-ID: <20260910101543.537312-1-c.heiss@proxmox.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1789035339112 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.323 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: K47AH26AX27KPD3JK4GDM3GRI332A3FR X-Message-ID-Hash: K47AH26AX27KPD3JK4GDM3GRI332A3FR X-MailFrom: c.heiss@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: .. when reading attributes. Fixes #8020 [0]. Although the SMBIOS specification states that text strings must be encoded as UTF-8 (w/o BOM) [1], bogus/broken firmwares may put junk bytes in there. On consumer hardware, there is normally also no way to change/fix these entries. So just skip these invalid attributes, which don't contain valid UTF-8. [0] https://bugzilla.proxmox.com/show_bug.cgi?id=8020 [1] DSP0134 SMBIOS spec v3.9.0; section 6.1.3 "Text strings" Signed-off-by: Christoph Heiss --- proxmox-installer-common/src/dmi.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/proxmox-installer-common/src/dmi.rs b/proxmox-installer-common/src/dmi.rs index 76ae4a5..a1127e3 100644 --- a/proxmox-installer-common/src/dmi.rs +++ b/proxmox-installer-common/src/dmi.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, fs}; +use std::{collections::HashMap, fs, io::ErrorKind}; use anyhow::{Result, bail}; use proxmox_installer_types::SystemDMI; @@ -28,8 +28,10 @@ fn get_dmi_infos_for(files: &[&str]) -> Result> { for file in files { let path = format!("{DMI_PATH}/{file}"); let content = match fs::read_to_string(&path) { - Err(ref err) if err.kind() == std::io::ErrorKind::NotFound => continue, - Err(ref err) if err.kind() == std::io::ErrorKind::PermissionDenied => { + Err(ref err) if [ErrorKind::NotFound, ErrorKind::InvalidData].contains(&err.kind()) => { + continue; + } + Err(ref err) if err.kind() == ErrorKind::PermissionDenied => { bail!("Could not read data. Are you running as root or with sudo?") } Err(err) => bail!("Error: '{err}' on '{path}'"), -- 2.55.0