From: Arvind Sankar <nivedita@alum.mit.edu>
To: Kees Cook <keescook@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Hans de Goede <hdegoede@redhat.com>,
Joe Perches <joe@perches.com>,
Masahiro Yamada <masahiroy@kernel.org>,
Yury Norov <yury.norov@gmail.com>,
Arvind Sankar <nivedita@alum.mit.edu>,
Alexandru Ardelean <alexandru.ardelean@analog.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lib/string.c: Clarify kerndoc for stpcpy()
Date: Sun, 6 Sep 2020 12:08:09 -0400 [thread overview]
Message-ID: <20200906160809.GA1620946@rani.riverdale.lan> (raw)
In-Reply-To: <202009060302.4574D8D0E0@keescook>
On Sun, Sep 06, 2020 at 03:06:29AM -0700, Kees Cook wrote:
> Fix the language around return values to indicate destination instead of
> source.
>
> Reported-by: Masahiro Yamada <masahiroy@kernel.org>
> Link: https://lore.kernel.org/lkml/CAK7LNAQvQBhjYgSkvm-dVyNz2Jd2C2qAtfyRk-rngEDfjkc38g
> Cc: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> This is a fix for lib-stringc-implement-stpcpy.patch in -mm.
>
> Andrew, please note that it would be nice to get this into -rc6
> to unbreak the clang builds.
>
> Thanks!
> ---
> lib/string.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/lib/string.c b/lib/string.c
> index 6bd0cf0fb009..32a56436c7eb 100644
> --- a/lib/string.c
> +++ b/lib/string.c
> @@ -280,12 +280,12 @@ EXPORT_SYMBOL(strscpy_pad);
> * @src: pointer to the beginning of string being copied from. Must not overlap
> * dest.
> *
> - * stpcpy differs from strcpy in a key way: the return value is the new
> - * %NUL-terminated character. (for strcpy, the return value is a pointer to
> - * src. This interface is considered unsafe as it doesn't perform bounds
> - * checking of the inputs. As such it's not recommended for usage. Instead,
> - * its definition is provided in case the compiler lowers other libcalls to
> - * stpcpy.
> + * stpcpy differs from strcpy in a key way: the return value is a pointer
> + * to the new %NUL-terminated character in @dest. (For strcpy, the return
> + * value is a pointer to the start of @dest. This interface is considered
^ need closing parenthesis
Thanks.
next prev parent reply other threads:[~2020-09-06 16:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-06 10:06 Kees Cook
2020-09-06 16:08 ` Arvind Sankar [this message]
2020-09-06 20:26 ` Kees Cook
2020-09-14 3:30 ` Andrew Morton
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=20200906160809.GA1620946@rani.riverdale.lan \
--to=nivedita@alum.mit.edu \
--cc=akpm@linux-foundation.org \
--cc=alexandru.ardelean@analog.com \
--cc=hdegoede@redhat.com \
--cc=joe@perches.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=ndesaulniers@google.com \
--cc=yury.norov@gmail.com \
/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
all inboxes | Powered by JetHome®