Subject: Re: [PATCH net-next] ptp: ocp: fix sprintf overflow in ptp_ocp_verify()

From: Dan Carpenter <[email-masked]>
Date: Fri, 18 Mar 2022 10:45:04 +0300

On Thu, Mar 17, 2022 at 10:04:49AM -0700, Jonathan Lemon wrote:
> On Thu, Mar 17, 2022 at 10:59:57AM +0300, Dan Carpenter wrote:
> > The "chan" value comes from the user via sysfs.  A large like UINT_MAX
> > could overflow the buffer by three bytes.  Make the buffer larger and
> > use snprintf() instead of sprintf().
> > 
> > Fixes: 1aa66a3a135a ("ptp: ocp: Program the signal generators via PTP_CLK_REQ_PEROUT")
> > Signed-off-by: Dan Carpenter <[email-masked]>
> 
> This needs to be respun to catch up with the last patch.

Thanks.  It turns out you can't actually trigger this bug.  Still using
snprintf() is better so I will resend.

regards,
dan carpenter