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: <IA3PR11MB89861576F966DA66BC9165F5E59EA@IA3PR11MB8986.namprd11.prod.outlook.com>
Date: Thu, 29 Jan 2026 10:32:36 +0000
From: "Loktionov, Aleksandr" <aleksandr.loktionov@...el.com>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>, Jonathan Corbet
	<corbet@....net>, Linux Doc Mailing List <linux-doc@...r.kernel.org>
CC: "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
	"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
	"linux-hardening@...r.kernel.org" <linux-hardening@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>, Mauro Carvalho Chehab
	<mchehab@...nel.org>, Randy Dunlap <rdunlap@...radead.org>
Subject: RE: [Intel-wired-lan] [PATCH v3 18/30] docs: kdoc_re: Change
 NestedMath args replacement to \0



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf
> Of Mauro Carvalho Chehab
> Sent: Thursday, January 29, 2026 9:08 AM
> To: Jonathan Corbet <corbet@....net>; Linux Doc Mailing List <linux-
> doc@...r.kernel.org>
> Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>;
> bpf@...r.kernel.org; intel-wired-lan@...ts.osuosl.org; linux-
> hardening@...r.kernel.org; linux-kernel@...r.kernel.org;
> netdev@...r.kernel.org; Mauro Carvalho Chehab <mchehab@...nel.org>;
> Randy Dunlap <rdunlap@...radead.org>
> Subject: [Intel-wired-lan] [PATCH v3 18/30] docs: kdoc_re: Change
> NestedMath args replacement to \0
> 
> Future patches will allow parsing each argument instead of the hole
> set. Prepare for it by changing the replace all args from
> \1 to \0.
> 
> No functional changes.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
> ---
>  tools/lib/python/kdoc/kdoc_parser.py | 2 +-
>  tools/lib/python/kdoc/kdoc_re.py     | 9 +++++----
>  2 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/lib/python/kdoc/kdoc_parser.py
> b/tools/lib/python/kdoc/kdoc_parser.py
> index db140363104a..4d52a00acfad 100644
> --- a/tools/lib/python/kdoc/kdoc_parser.py
> +++ b/tools/lib/python/kdoc/kdoc_parser.py
> @@ -160,7 +160,7 @@ struct_xforms = [
>  # is allowed.
>  #
>  struct_nested_prefixes = [
> -    (re.compile(r'\bSTRUCT_GROUP\('), r'\1'),
> +    (re.compile(r'\bSTRUCT_GROUP\('), r'\0'),
>  ]
> 
>  #
> diff --git a/tools/lib/python/kdoc/kdoc_re.py
> b/tools/lib/python/kdoc/kdoc_re.py
> index 7b7ddc50ac36..8933e1a62776 100644
> --- a/tools/lib/python/kdoc/kdoc_re.py
> +++ b/tools/lib/python/kdoc/kdoc_re.py
> @@ -289,8 +289,9 @@ class NestedMatch:
>          It matches a regex that it is followed by a delimiter,
>          replacing occurrences only if all delimiters are paired.
> 
> -        if r'\1' is used, it works just like re: it places there the
> -        matched paired data with the delimiter stripped.
> +        if r'\0' is used, it works on a similar way of using
> re.group(0):
> +        it places the entire args of the matched paired data, with
> the
> +        delimiter stripped.
> 
>          If count is different than zero, it will replace at most
> count
>          items.
> @@ -306,9 +307,9 @@ class NestedMatch:
>              # Value, ignoring start/end delimiters
>              value = line[end:pos - 1]
> 
> -            # replaces \1 at the sub string, if \1 is used there
> +            # replaces \0 at the sub string, if \0 is used there
>              new_sub = sub
> -            new_sub = new_sub.replace(r'\1', value)
> +            new_sub = new_sub.replace(r'\0', value)
> 
>              out += new_sub
> 
> --
> 2.52.0

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ