lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <011234f5-19f3-21c5-f0cf-8027971397e7@wanadoo.fr>
Date:   Tue, 19 Sep 2023 21:23:47 +0200
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     Kent Overstreet <kent.overstreet@...ux.dev>,
        Brian Foster <bfoster@...hat.com>
Cc:     linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        linux-bcachefs@...r.kernel.org
Subject: Re: [PATCH] bcachefs: Use snprintf() instead of scnprintf() when
 appropriate

Le 19/09/2023 à 21:02, Kent Overstreet a écrit :
> On Tue, Sep 19, 2023 at 09:17:27AM -0400, Brian Foster wrote:
>> On Sat, Sep 16, 2023 at 09:30:19AM +0200, Christophe JAILLET wrote:
>>> snprintf() and scnprintf() are the same, except for the returned value.
>>> When this value is not used, it is more logical to use snprintf() which is
>>> slightly simpler.
>>>
>>> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
>>> ---
>>
>> Seems reasonable:
>>
>> Reviewed-by: Brian Foster <bfoster@...hat.com>
> 
> No, let's stay with scnprintf as the default - snprintf should be
> deprecated except for when its return value is actually needed, using it
> incorrectly has been a source of buffer overruns in the past.
> 

Ok, I was not aware of it.

In this case, there are also some s/snprintf/scnprintf/ opportunities in 
fs/bcachefs

Does it make sense to update them or is it too low value changes?

CJ

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ