From mboxrd@z Thu Jan 1 00:00:00 1970 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 E84003C5DDA for ; Tue, 24 Mar 2026 22:50:15 +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=1774392617; cv=pass; b=A/8LpeAfbOS1X6XpXbIPY6NW1GqzhvmFpxo3der42go2vstaZ/Vk1GFd2xqhq5dFT7kYF+c7idG0fXny5WLT7SChyGRL35+ufe7JCnABFMwYj4AJeoiGVYH/gZa1wueivpxN180KkJXeLtjESSCFi6ye/231fAltKqSiAZ4eJ+0= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774392617; c=relaxed/simple; bh=khoUIYZarBytZGBhu/qvxyAqhQHNrhlac+FmAoUZEIw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=hPGqsr+Y4wnTfOXs9YrvEvomYsg2gzIC4H96c5UsoLUbq31IEl+nTlWmi/RcqgjSPmTt1FoEp1JFCAxMRWt1xzY/BQW8jUUXH0jZM+Kyfw5VP99l7IsDSGBWV0GkZZlw9AZb7cqNvbxSefra6Qw/mIF625YHPyU2Vf9VILjDRTo= 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=ZUe/QUJi; 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="ZUe/QUJi" ARC-Seal: i=1; a=rsa-sha256; t=1774392583; cv=none; d=zohomail.eu; s=zohoarc; b=TUNrNRCUKM6t41lmMelLak5145HN7jsrCiU0NwLYbQvmdi+bdrscb4Mi3S6SWO9rehf5fFODbOpG1zcUdAVtqVDxHsZNxJv9CUmLmRP87tpUszJRi/oa0yAxWBK1YiKmHX7pGY9+HJvwDJATgqllRhkiGcIyEE3u4j4vMah3ZIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1774392583; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=Zmpm6yTnb2tfokj5Sih3XqYFZfb3ZCoUaROr5ead2tU=; b=c9OADtlCEqJrfF+SU0+LSXh55e/AnUU9u0/z3M63rqQSkL/PZotyQEgf5fL9pYJmvNK+PxcfF0w5PGVU9algo4S9JwwFAjgSTC9xXxgpyDte5q/qxT9CzE1TZiNA78pANGiUcB543Or8CDiMtL9vnCHofmoH9NQg3NZEadlH8Os= 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=1774392583; s=zmail; d=objecting.org; i=objecting@objecting.org; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=Zmpm6yTnb2tfokj5Sih3XqYFZfb3ZCoUaROr5ead2tU=; b=ZUe/QUJiu/rcZjOT7xH7UF/NBvQ3/Q0hSWs4tSmApPD13wZQRAUiB1z8znqNX09m twZ4Og7RJ4eceSTBvI9ATix4Z8sILZVkOMawqWKG3kVgcry3+QRWhl8LcfzDtAyK8e8 /b//PFpFtiYu6jVGVaOte24AZJLeiWx8J3APE9Z0= Received: by mx.zoho.eu with SMTPS id 177439258147715.199388222917833; Tue, 24 Mar 2026 23:49:41 +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 0/4] lib/vsprintf: assorted bug fixes Date: Tue, 24 Mar 2026 22:49:36 +0000 Message-Id: <20260324224940.50508-1-objecting@objecting.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-ZohoMailClient: External Four small fixes found during an audit of lib/vsprintf.c: 1. bstr_printf() fails to advance the args pointer past a pre-rendered pointer string when the output buffer is full, corrupting all subsequent output. 2. vbin_printf() writes end[-1] unconditionally when NUL-terminating a pointer string, which is an OOB write when size is zero. 3. vsscanf() uses s16 for field_width but assigns from skip_atoi() which returns int, silently truncating large widths to negative and aborting parsing. 4. format_decode() is missing a (u8) cast on the second lookup into the format_state table, allowing a negative array index on signed-char platforms. Josh Law (4): lib/vsprintf: always advance args in bstr_printf() pointer path lib/vsprintf: fix OOB write in vbin_printf() when size is zero lib/vsprintf: use int for field_width in vsscanf() lib/vsprintf: add missing (u8) cast in format_decode() lookup lib/vsprintf.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -- 2.34.1