From nobody Fri Apr 3 04:37:59 2026 Received: from sender-of-o57.zoho.eu (sender-of-o57.zoho.eu [136.143.169.57]) (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 799F03C661A for ; Tue, 24 Mar 2026 22:50:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774392607; cv=pass; b=LA4S0g9amkRd7crLhpC6D7OG/DDV+x4PeNZZdBF8iPKOD9TKOkNEMFbjC3IOinGLdCDWK8uaLEyHfOadfx62Kk1VgrnYp3brn55zHkHJtn6BZwsYHD7OQT8LsmA+96Ks+XFDIgjyFJPqXKadOD45U6s+yK3nY0HNu9ZT7mpkyak= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774392607; c=relaxed/simple; bh=am/4VLcWn88b1bLHwF/f8ujUH7aNOLv3dRMBmZsdkbY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ik4C3uGlgRx0T70lYDyjUH/47cPSFnsJEkwyUC4KLR+YAUpX7V+/XgV1laAp6xTVMV26G9jP6jQydgSXyd2wGucEr2vMW61VTYsgV128cQ9IdwdlTK/V9aRWSl1Y4FvtPbUC+ivTgx1IRfpz70/g1OLXZwfaj9kp59AMFQhMnqw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=c+XhVlWx; arc=pass smtp.client-ip=136.143.169.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="c+XhVlWx" ARC-Seal: i=1; a=rsa-sha256; t=1774392587; cv=none; d=zohomail.eu; s=zohoarc; b=EWDSWL7JnWBUtaStb8oRzO9efRUA4ATImKkSTpfqNZx2MCtY/1jmCxLr2/Vooz6lvmgoiYs5zdCP1u7fPMwAhKDcAWry36HbCe0Kq9ztFGIeh4pZOXa/1hkDQi1XcYvE83pluQwQJdgXT300vGkp3a2gmX4JKnR1SSIFVLCYjpA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1774392587; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=hpAx/CxrdoyTqN0RJwcDfVSnJbT6nC9KChGUnTYyJw4=; b=YxOHxJDkpNpF3vfYEQlcd6m43YUZxGnKhKzt+/ueXUOg+R5rZNdIxTwdsOYRNvNktGuo2ak8f/sGusm5+jsM/tJmi1iTE6ugWhXLkhzsMZApHcc64E4QS7ps0EmeWjVO7rQE0fNr7sip0i9UfyvLe55LvXVhaFjOXOBzvAH3cNI= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1774392587; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=hpAx/CxrdoyTqN0RJwcDfVSnJbT6nC9KChGUnTYyJw4=; b=c+XhVlWx35TCstNwDFZ0e+4MSgalopN08Jm0hH8hRMl5Nv0lZrLySE3J+ABfScUl wFUxs9/bvoTmQ+p2gTs7wHMSkQvOykiCB6UtTi/DhckGk8XhzH+zHiKXw/Hf4Tn4PNO L0smIHBW+dSoor73Jqn/uLxitjy/kMxbXg7FfA3g= Received: by mx.zoho.eu with SMTPS id 1774392584546169.5722630441012; Tue, 24 Mar 2026 23:49:44 +0100 (CET) From: Josh Law To: Petr Mladek , Steven Rostedt Cc: Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , Andrew Morton , Josh Law , linux-kernel@vger.kernel.org Subject: [PATCH 4/4] lib/vsprintf: add missing (u8) cast in format_decode() lookup Date: Tue, 24 Mar 2026 22:49:40 +0000 Message-Id: <20260324224940.50508-5-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260324224940.50508-1-objecting@objecting.org> References: <20260324224940.50508-1-objecting@objecting.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" The first lookup into the format_state table correctly casts to (u8) at line 2778, but the second lookup after consuming a length qualifier does not. On signed-char platforms, a byte >=3D 0x80 sign-extends to a negative index, reading before the array. Add the same (u8) cast for consistency. Signed-off-by: Josh Law Reviewed-by: Petr Mladek --- lib/vsprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 2758096b6f53..3108823e8c22 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -2783,7 +2783,7 @@ struct fmt format_decode(struct fmt fmt, struct print= f_spec *spec) fmt.str++; } fmt.str++; - p =3D lookup_state + *fmt.str; + p =3D lookup_state + (u8)*fmt.str; } if (p->state) { if (p->base) --=20 2.34.1