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: <80cae791-663c-4589-b67e-d4d1049fcd98@web.de>
Date: Mon, 3 Feb 2025 08:24:19 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: cocci@...ia.fr, Julia Lawall <Julia.Lawall@...ia.fr>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
 Andrew Morton <akpm@...ux-foundation.org>,
 Easwar Hariharan <eahariha@...ux.microsoft.com>,
 Nicolas Palix <nicolas.palix@...g.fr>, Ricardo Ribalda
 <ribalda@...omium.org>, Victor Gambier <victor.gambier@...ia.fr>
Subject: Re: [01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too

> I tend also to present possibilities for succinct SmPL code.
> Unfortunately, software dependencies can trigger corresponding target conflicts.

@adjustment@
expression e;
@@
-msecs_to_jiffies
+secs_to_jiffies
 (
(
-e * 1000
|
-e * MSEC_PER_SEC
)
+e
 )


A command (like the following) can indicate how isomorphisms are applied
for the transformation of some data into SmPL disjunctions.
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/bd08cad3f802229dc629a13eefef2018c620e905/standard.iso#L252-257

Markus_Elfring@...ne:…/Projekte/Coccinelle/Probe> spatch --parse-cocci suggestion3_for_Easwar_Hariharan-20250128.cocci
…
@adjustment@
expression e;
@@


(
-msecs_to_jiffies
  >>> secs_to_jiffies
(-e -* -1000
  <<< e
)
|
-msecs_to_jiffies
  >>> secs_to_jiffies
(-1000 -* -e
  <<< e
)
|
-msecs_to_jiffies
  >>> secs_to_jiffies
(-e -* -MSEC_PER_SEC
  <<< e
)
|
-msecs_to_jiffies
  >>> secs_to_jiffies
(-MSEC_PER_SEC -* -e
  <<< e
)
)


Grep query
msecs_to_jiffies



I find parts of such a data representation improvable.
I would usually expect here that parentheses for the selection of call parameters
will not appear in the first text column
(so that confusion will be avoided for the usage of delimiters according to SmPL disjunctions).



The isomorphism specifications represent also a software development status.
It seems that they do not contain direct support for SmPL disjunctions so far
(as an explicit entity).



The identifier “HZ” is used by the referenced macro.
https://elixir.bootlin.com/linux/v6.13/source/include/linux/jiffies.h#L530-L540
https://lore.kernel.org/linux-kernel/173831299312.31546.8797889985487965830.tip-bot2@tip-bot2/

Is there a need to take further (preprocessor symbol) variations better into account?



How do you think about the handling of multiplication factors within bigger expressions
(and not only at the beginning or end of a term)?



Would you be looking for further restrictions on expression combinations?

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ