linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: Kees Cook <keescook@chromium.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
	linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Akira Yokosawa <akiyks@gmail.com>
Subject: Re: [PATCH] string: Rewrite and add more kern-doc for the str*() functions
Date: Sat, 24 Sep 2022 16:13:57 +0900	[thread overview]
Message-ID: <9b0cf584-01b3-3013-b800-1ef59fe82476@gmail.com> (raw)
In-Reply-To: <20220922062817.2283352-1-keescook@chromium.org>

Hi Kees,
Thank you for sharing your devel branch.

On Wed, 21 Sep 2022 23:28:17 -0700, Kees Cook wrote:
> While there were varying degrees of kern-doc for various str*()-family
> functions, many needed updating and clarification, or to just be
> entirely written. Update (and relocate) existing kern-doc and add missing
> functions, sadly shaking my head at how many times I have written "Do
> not use this function". Include the results in the core kernel API doc.
> 
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> Follow up to https://lore.kernel.org/lkml/20220902223507.2537469-1-keescook@chromium.org
> Note that this is on top of my recent fortify-string.h series:
> https://lore.kernel.org/lkml/20220920192202.190793-1-keescook@chromium.org/
[...]
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index 8bb89deb9a91..adbc4d307770 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -1448,6 +1448,8 @@ sub create_parameterlist($$$$) {
>      foreach my $arg (split($splitter, $args)) {
>  	# strip comments
>  	$arg =~ s/\/\*.*\*\///;
> +	# ignore argument attributes
> +	$arg =~ s/\sPOS0?\s/ /;
>  	# strip leading/trailing spaces
>  	$arg =~ s/^\s*//;
>  	$arg =~ s/\s*$//;
> @@ -1657,6 +1659,7 @@ sub dump_function($$) {
>      $prototype =~ s/^__inline +//;
>      $prototype =~ s/^__always_inline +//;
>      $prototype =~ s/^noinline +//;
> +    $prototype =~ s/^__FORTIFY_INLINE +//;
>      $prototype =~ s/__init +//;
>      $prototype =~ s/__init_or_module +//;
>      $prototype =~ s/__deprecated +//;
> @@ -1667,6 +1670,7 @@ sub dump_function($$) {
>      $prototype =~ s/__sched +//;
>      $prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//;
>      $prototype =~ s/__(?:re)?alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +//;
> +    $prototype =~ s/__diagnose_as\s*\(\s*\S+\s*(?:,\s*\d+\s*)*\) +//;
>      my $define = $prototype =~ s/^#\s*define\s+//; #ak added
>      $prototype =~ s/__attribute_const__ +//;
>      $prototype =~ s/__attribute__\s*\(\(

This hunk in the corresponding commit 87cb97a66ae9 of your devel branch
looks a little different:

@@ -1666,7 +1669,8 @@ sub dump_function($$) {
     $prototype =~ s/__weak +//;
     $prototype =~ s/__sched +//;
     $prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//;
-    $prototype =~ s/__alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +//;
+    $prototype =~ s/__(?:re)?alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +//;
+    $prototype =~ s/__diagnose_as\s*\(\s*\S+\s*(?:,\s*\d+\s*)*\) +//;
     my $define = $prototype =~ s/^#\s*define\s+//; #ak added
     $prototype =~ s/__attribute_const__ +//;
     $prototype =~ s/__attribute__\s*\(\(

This was what prevented me from applying the patch.

Anyway, "make htmldocs" works just fine now. FWIW,

Tested-by: Akira Yokosawa <akiyks@gmail.com>

        Thanks, Akira

      parent reply	other threads:[~2022-09-24  7:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22  6:28 [PATCH] string: Rewrite and add more kern-doc for the str*() functions Kees Cook
2022-09-24  2:31 ` Akira Yokosawa
2022-09-24  4:24   ` Kees Cook
2022-09-24  7:13 ` Akira Yokosawa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9b0cf584-01b3-3013-b800-1ef59fe82476@gmail.com \
    --to=akiyks@gmail.com \
    --cc=corbet@lwn.net \
    --cc=keescook@chromium.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).