[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <176656845704.3796981.11008925293580480750.b4-ty@oss.qualcomm.com>
Date: Wed, 24 Dec 2025 11:27:47 +0200
From: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
To: robin.clark@....qualcomm.com, lumag@...nel.org, veygax <veyga@...gax.dev>
Cc: abhinav.kumar@...ux.dev, jessica.zhang@....qualcomm.com, sean@...rly.run,
marijn.suijten@...ainline.org, airlied@...il.com, simona@...ll.ch,
linux-arm-msm@...r.kernel.org, dri-devel@...ts.freedesktop.org,
freedreno@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/msm: Replace unsafe snprintf usage with scnprintf
On Sun, 30 Nov 2025 01:28:54 +0000, veygax wrote:
> The refill_buf function uses snprintf to append to a fixed-size buffer.
> snprintf returns the length that would have been written, which can
> exceed the remaining buffer size. If this happens, ptr advances beyond
> the buffer and rem becomes negative. In the 2nd iteration, rem is
> treated as a large unsigned integer, causing snprintf to write oob.
>
> While this behavior is technically mitigated by num_perfcntrs being
> locked at 5, it's still unsafe if num_perfcntrs were ever to change/a
> second source was added.
>
> [...]
Applied to msm-fixes, thanks!
[1/1] drm/msm: Replace unsafe snprintf usage with scnprintf
https://gitlab.freedesktop.org/lumag/msm/-/commit/093cbd754382
Best regards,
--
With best wishes
Dmitry
Powered by blists - more mailing lists