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: <3b04f763-aaba-41ee-a81f-94195043fd4b@nvidia.com>
Date: Wed, 29 Oct 2025 19:35:25 +0200
From: Gal Pressman <gal@...dia.com>
To: Johan Hovold <johan@...nel.org>
Cc: Julia Lawall <Julia.Lawall@...ia.fr>,
 Nicolas Palix <nicolas.palix@...g.fr>, Jakub Kicinski <kuba@...nel.org>,
 Alexei Lazar <alazar@...dia.com>, Simon Horman <horms@...nel.org>,
 cocci@...ia.fr, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Revert "scripts/coccinelle: Find PTR_ERR() to %pe
 candidates"

On 29/10/2025 18:38, Johan Hovold wrote:
> On Wed, Oct 29, 2025 at 03:59:50PM +0200, Gal Pressman wrote:
>> On 29/10/2025 15:29, Johan Hovold wrote:
>>> This reverts commit 57c49d2355729c12475554b4c51dbf830b02d08d.
>>>
>>> Using "%pe" to print errnos is in no way mandated and a driver authors
>>> may chose not to use it, for example, for consistency reasons.
>>>
>>> Drop the recently added cocci script that has gotten the build bots to
>>> send warning emails about perfectly valid code and which will likely
>>> only result in churn and inconsistency.
>>>
>>> Link: https://lore.kernel.org/all/aQHi4nUfIlcN1ac6@hovoldconsulting.com/
>>> Signed-off-by: Johan Hovold <johan@...nel.org>
>>
>> The test by no means mandates authors to use %pe, as the output says:
>> WARNING: Consider using %pe to print PTR_ERR()
>>
>> "Consider" :).
> 
> Right, but it's preceded by a big "WARNING".

Right, I don't mind removing it.

> 
>> I would consider it best practice to use it, and a few drivers were
>> converted thanks to this test.
> 
> Unlike the rest of the misc cocci scripts I skimmed, this one does not
> guard against any bugs. Instead it's pushing for a subjective style
> preference, which is just going to result in churn when the clean up
> crew starts sending mindless conversions of individual printks.

Not all cocci scripts are used for fixing bugs:
err_cast.cocci
memdup.cocci
minmax.cocci
string_choices.cocci

They are used to improve the code.
We can probably agree that for new code %pe is preferable, but I
understand your concerns about the churn of conversions.

> 
> By all means, use %pe for your drivers, but it should not be forced
> upon the rest of us this way.

Agree.
This script helps us for our drivers.

> 
>> If the issue is with automatic build bots, then maybe this test should
>> be excluded from them, rather than deleted?
> 
> It's both; it's the noise the new warnings generate but also the coming
> flood up patches to "fix" them. There are already some 40 commits or so
> in linux-next referencing this script.

It's OK to not like these conversion patches, it's up to the maintainer
to accept/reject them.

For example, I know Jakub dislikes the string_choices.cocci script and
rejects conversion patches. But the script still exists and can be used
in other places in the kernel who might have a different opinion.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ