From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6DEAC61DB9 for ; Thu, 27 Aug 2026 09:45:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C46910EF6E; Thu, 27 Aug 2026 09:44:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=yahoo.pl header.i=@yahoo.pl header.b="niMehCK+"; dkim-atps=neutral Received: from sonic.asd.mail.yahoo.com (sonic-euwe1-0017.asd.mail.yahoo.com [34.2.82.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0817410EDB0 for ; Wed, 26 Aug 2026 19:01:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.pl; s=s2048; t=1787770871; bh=981Y45l28tEVjfFWKMb+Asr6a0VG+kmV1zHPYaqRojQ=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=niMehCK+HhPrpobEaqiZVCIO9pVI+cFv7EmvinS9yBUC67nFhyUosVENBcrc3nE0+e/mMK2MHUJRBxa79FnHd20b/AI04PTJiNTsBKgXcx8HQiHtFkGDamegDqo4btIHHCpMbt/WKRzLZ9NbVoep5OxnVR7QbpAnKpBSK6ISgjYDJweMzvL1Qtx1FfXSRSIbPRyVTGT5XAAtPft22II1cCdtxZxFe+jfobunfQYdkOVEfUW/jKjdVimkwM06zk1P1DdWBk0KTvahQHVUIMWN4gSJPi9+lNZmyoJw26AcbgyoqEVA/t0c+HuI4/1NwBFzRJZtJ58gHP+tE1OWwOvdcQ== X-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UL.t_0C1IBjqdiQUyDHzJqTu1Ul iQNAvXfU7nvmvzC7pQ9OHoom28nvLGwwd9dQI8ZWCxAN2.bqujyK3Ui3WoYr.um3EYZtf7aCEw8P VNutfwndbtLOREqEsfwHoT1Rjbpz5rx2_MOQfelmeKNbtLBRHZG8uszm0oXm.vNi7Lo6BMun.7KV wqwSfX8bBvXo6b9dnULPIS3Mq3hNNzvHbWmYoS5mrtRPQiaExjQmEqSmngkHABpDs6r2CY9ioKuH 9fE6rPi.CnrJvkp2IjOI6lpSgJVEQ5fB4gJzUjuJH98MiNGK8pio8KA6GWLh9apdJimU9qdOC8eY 97hb6xj7bLwIMmwK7s2zXQJsISKESQlliuOWZ54QhrQXH.ahY7SuSsR5WoTUqiX8BepXXVv3zUp6 uTCyycD_gFsF8vr29t0wA2F67RF.UpjOt7bb9tyR.0UM8mRNSlZ1hSO9najUELl.S5nzfG0VIhHi NHl8NggPUuddsgorT6rwS X-Sonic-MF: X-Sonic-ID: 39fa4574-2f94-4ffc-af95-d525be5494ba Received: from sonic.gate.mail.ne1.yahoo.com by mail-asdoutdeli-p-cin-euwe1-prod-sonicconsumer-svc-101 with HTTP; Wed, 26 Aug 2026 19:01:11 +0000 Date: Wed, 26 Aug 2026 19:01:07 +0000 (UTC) From: Tomasz Unger To: Andy Shevchenko Cc: Andy Shevchenko , Greg Kroah-Hartman , "dri-devel@lists.freedesktop.org" , "linux-fbdev@vger.kernel.org" , "linux-staging@lists.linux.dev" , "linux-kernel@vger.kernel.org" , Dan Carpenter Message-ID: <288624768.4518972.1787770867491@mail.yahoo.com> In-Reply-To: References: <20260820-fbtft-v2-final-v2-1-44d107b04634.ref@yahoo.pl> <20260820-fbtft-v2-final-v2-1-44d107b04634@yahoo.pl> Subject: Re: [PATCH v2] staging: fbtft: prefer snprintf over sprintf in fbtft-core.c MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4518971_2063055525.1787770867490" X-Mailer: WebService/1.1.26380 YMailCLDNorrin X-Mailman-Approved-At: Thu, 27 Aug 2026 09:44:45 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" ------=_Part_4518971_2063055525.1787770867490 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =20 Correct - no compiler or static analysis tool flags this. The overflow is m= athematically impossible for these argument types, so the patch doesn't fix= an actual bug. I addressed Dan's specific wording feedback but missed responding to your c= ore objection about the patch being unnecessary. Given the above, I'll drop= this patch unless you see value in keeping it as a documented safety margi= n. Regards, Tomasz Unger W poniedzia=C5=82ek, 24 sierpnia 2026 10:59:40 CEST, Andy Shevchenko napisa=C5=82(-a): =20 =20 On Thu, Aug 20, 2026 at 06:58:12PM +0200, Tomasz Unger wrote: > Using sprintf has potential for buffer overflows if the formatted sprintf() > string exceeds the destination buffer size. Replace it with > snprintf, passing sizeof() of the fixed-size stack buffers snprintf() > (text1[50] and text2[50]) so the write is always bounded. >=20 > An overflow is impossible here: even the worst case for the > argument types (size_t for text1, three ints for text2) still > fits within 50 bytes. Use snprintf() rather than scnprintf() > since the return value is not used here. Then why the patch is needed at all? Do you have any compiler that warns you about something? ... It looks like you ignored all my comments against v1... --=20 With Best Regards, Andy Shevchenko =20 ------=_Part_4518971_2063055525.1787770867490 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Correct = - no compiler or static analysis tool flags this. The overflow is mathemati= cally impossible for these argument types, so the patch doesn't fix an actu= al bug.

I addressed Dan's specific wording feedback but missed respo= nding to your core objection about the patch being unnecessary. Given the a= bove, I'll drop this patch unless you see value in keeping it as a document= ed safety margin.

Regards,
Tomasz Unger

=20
=20
W poniedzia=C5=82ek, 24 sierpnia 2026 10:59:40 CEST= , Andy Shevchenko <andriy.shevchenko@intel.com> napisa=C5=82(-a):


=20 =20
On Thu, Aug 20, 2026 at 06:58:12PM +0200, Tomasz Unger= wrote:
> Using sprintf has potential for buffer overflows if the for= matted

sprintf()

> string exceeds the destination buffer s= ize. Replace it with
> snprintf, passing sizeof() of the fixed-size s= tack buffers

snprintf()

> (text1[50] and text2[50]) so the= write is always bounded.
>
> An overflow is impossible here: = even the worst case for the
> argument types (size_t for text1, three= ints for text2) still
> fits within 50 bytes. Use snprintf() rather = than scnprintf()
> since the return value is not used here.

Th= en why the patch is needed at all? Do you have any compiler that warns
y= ou about something?

...

It looks like you ignored all my comm= ents against v1...

--
With Best Regards,
Andy Shevchenko
<= br>
------=_Part_4518971_2063055525.1787770867490--