From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42F522FD675 for ; Wed, 18 Feb 2026 23:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771458683; cv=none; b=tAoIGPiAv8Nw4uHwxfU2jVYVHWy9ZcrXpWVEtD0ZloU7EGLOQQhyA0NtLehupwEgXNzjS2hNbprBxefiOBox5ETz8QmlPlgYVGmZ50HlDtKt+E7K45wfVN7+90pIRgvOrap5YTzQxBYtB4ACF7w/d323UgFkq9n6dHeVxlJg2L8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771458683; c=relaxed/simple; bh=Svtk0aU0OYdgBZGtTqIXgreTX8KTNbqkIMe2xl+s/0U=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=OVlT5CZYDculG/+M+DFd0WGTL01Td1U0Adxz+Az//uaY+4J70MBtxis1fFTjh01bspEu679RwVNniUDa2wuJs3s2AAxL7IjlwNniKqZPeLoK5FgeQTRUB9oJsh726h1yrxt1eeiT43GWEsvPhd3GthqcGAojCPuTkdOzNGawdNA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=0xpCi0mC; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="0xpCi0mC" Received: from ehlo.thunderbird.net (c-76-133-66-138.hsd1.ca.comcast.net [76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 61INZ1xN2593426 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Wed, 18 Feb 2026 15:35:01 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 61INZ1xN2593426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2026012301; t=1771457701; bh=dYPhBOIG43fEA6c7mv7RmyeiLNxmXBRevhiRUfs3kuM=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=0xpCi0mCkGM16EpOVGqXVWCnBpjp+HJO/tZD6jKSAQZxAhtEE2kbmacz5+WGBXGG8 yC+1IcorVSPjQY9WuSoPFgzyzdJepXMh//v6eW2wxm2kdj/STcgEp9Atw79PEnBdf7 aRstHUfNlLP0wKMEuZuWDLjikTlSyFvgUARgVd8AJNvpzkm8lQvjgy+bbnYccHLoGo OrQyCBx9mImLJU2yPnmd76FuxDyAH7mLVZQSgicN8vVBgziKf6NgtgB+5TpN0GR6Jr Pov34x23bSmvhzU3VoTgvMzHYFp1/fwGsAKJDLbWZFS5AtR5llip4ZU5mf1401A9+u p7FsXd7jHEbXg== Date: Wed, 18 Feb 2026 15:34:54 -0800 From: "H. Peter Anvin" To: redacherkaoui , x86@kernel.org CC: tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/boot/compressed: Fix signedness of rdfs8() User-Agent: K-9 Mail for Android In-Reply-To: <20260218150008.28179-1-redacherkaoui67@gmail.com> References: <20260218150008.28179-1-redacherkaoui67@gmail.com> Message-ID: <164908B8-E572-47B0-BABE-7DAC7F1EC540@zytor.com> 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: quoted-printable On February 18, 2026 7:00:08 AM PST, redacherkaoui wrote: >rdfs8() reads a raw byte from the decompressor command line buffer but >returns it as 'char'=2E On toolchains where 'char' is signed, values in >the range 0x80=2E=2E0xff become negative when promoted, which can lead to >incorrect comparisons while parsing=2E > >Return u8 from rdfs8() to preserve the correct byte value=2E > >Signed-off-by: redacherkaoui >--- > arch/x86/boot/compressed/cmdline=2Ec | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > >diff --git a/arch/x86/boot/compressed/cmdline=2Ec b/arch/x86/boot/compres= sed/cmdline=2Ec >index e162d7f59cc5=2E=2Ed48ba959dbc5 100644 >--- a/arch/x86/boot/compressed/cmdline=2Ec >+++ b/arch/x86/boot/compressed/cmdline=2Ec >@@ -8,13 +8,16 @@ static inline void set_fs(unsigned long seg) > { > fs =3D seg << 4; /* shift it back */ > } >+ > typedef unsigned long addr_t; >-static inline char rdfs8(addr_t addr) >+static inline u8 rdfs8(addr_t addr) > { >- return *((char *)(fs + addr)); >+ return *(u8 *)(fs + addr); > } >+ > #include "=2E=2E/cmdline=2Ec" >-unsigned long get_cmd_line_ptr(void) >+ >+static unsigned long get_cmd_line_ptr(void) > { > unsigned long cmd_line_ptr =3D boot_params_ptr->hdr=2Ecmd_line_ptr; >=20 >@@ -22,10 +25,12 @@ unsigned long get_cmd_line_ptr(void) >=20 > return cmd_line_ptr; > } >+ > int cmdline_find_option(const char *option, char *buffer, int bufsize) > { > return __cmdline_find_option(get_cmd_line_ptr(), option, buffer, bufsiz= e); > } >+ > int cmdline_find_option_bool(const char *option) > { > return __cmdline_find_option_bool(get_cmd_line_ptr(), option); What toolchains are that *for x86*?! This code is about to change substantially, but it wouldn't hurt to make i= t "unsigned char" or to include the appropriate header=2E=20