[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Ve1WUKYmv6sfGZ6amujs=C7MnxauLM+C2MeW8vxBV1NfQ@mail.gmail.com>
Date: Tue, 22 Oct 2024 12:15:41 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Jiri Slaby <jirislaby@...nel.org>
Cc: Bartosz Golaszewski <brgl@...ev.pl>, Kees Cook <kees@...nel.org>, Andy Shevchenko <andy@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
James Bottomley <James.Bottomley@...senpartnership.com>,
Greg KH <gregkh@...uxfoundation.org>, linux-hardening@...r.kernel.org,
linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>, stable@...r.kernel.org
Subject: Re: [PATCH] lib: string_helpers: fix potential snprintf() output truncation
On Tue, Oct 22, 2024 at 10:15 AM Jiri Slaby <jirislaby@...nel.org> wrote:
>
> On 21. 10. 24, 12:04, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> >
> > The output of ".%03u" with the unsigned int in range [0, 4294966295] may
> > get truncated if the target buffer is not 12 bytes.
>
> Perhaps, if you elaborate on how 'remainder' can become > 999?
The problem here that we have a two-way road: on one hand we ought to
fix the bugs in the kernel, on the other hand the compiler warnings
(even false positives) better to be fixed as we don't know which
compiler gets it fixed, but now we have a problem with building with
`make W=1` for the default configurations (it prevents build due to
compilation errors), so this change is definitely is an improvement.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists