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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250922163640.2fc887e4@kernel.org>
Date: Mon, 22 Sep 2025 16:36:40 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: "Julia Lawall" <Julia.Lawall@...ia.fr>, Nicolas Palix
 <nicolas.palix@...g.fr>
Cc: Tariq Toukan <tariqt@...dia.com>, Eric Dumazet <edumazet@...gle.com>,
 Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew+netdev@...n.ch>,
 "David S. Miller" <davem@...emloft.net>, Saeed Mahameed
 <saeedm@...dia.com>, Leon Romanovsky <leon@...nel.org>, Mark Bloch
 <mbloch@...dia.com>, Richard Cochran <richardcochran@...il.com>,
 <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
 <linux-rdma@...r.kernel.org>, <cocci@...ia.fr>, "Gal Pressman"
 <gal@...dia.com>
Subject: Re: [PATCH net-next 1/2] scripts/coccinelle: Find PTR_ERR() to %pe
 candidates

On Thu, 18 Sep 2025 13:43:46 +0300 Tariq Toukan wrote:
> Add a new Coccinelle script to identify places where PTR_ERR() is used
> in print functions and suggest using the %pe format specifier instead.
> 
> For printing error pointers (i.e., a pointer for which IS_ERR() is true)
> %pe will print a symbolic error name (e.g,. -EINVAL), opposed to the raw
> errno (e.g,. -22) produced by PTR_ERR().
> It also makes the code cleaner by saving a redundant call to PTR_ERR().
> 
> The script supports context, report, and org modes.
> 
> Example transformation:
>     printk("Error: %ld\n", PTR_ERR(ptr));  // Before
>     printk("Error: %pe\n", ptr);          // After

Hi Julia, Nicolas,

would you be willing to give us a review tag for this script?
Would you prefer to take the script via your tree?

https://lore.kernel.org/all/1758192227-701925-2-git-send-email-tariqt@nvidia.com/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ