From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Kees Cook <keescook@chromium.org>
Cc: Andy Shevchenko <andy@kernel.org>,
Richard Weinberger <richard@nod.at>,
linux-um@lists.infradead.org,
Justin Stitt <justinstitt@google.com>,
Anton Ivanov <anton.ivanov@cambridgegreys.com>,
Johannes Berg <johannes@sipsolutions.net>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Jason Wang <jasowang@redhat.com>,
kernel test robot <lkp@intel.com>,
Nathan Chancellor <nathan@kernel.org>,
Azeem Shaikh <azeemshaikh38@gmail.com>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3 4/4] um: Convert strscpy() usage to 2-argument style
Date: Tue, 6 Feb 2024 17:02:16 +0200 [thread overview]
Message-ID: <CAHp75Vf3c0Q7tV8ih5fRL6Bsjr6dhspFe+mxV7xUN=vZ1JdTKQ@mail.gmail.com> (raw)
In-Reply-To: <20240206142221.2208763-4-keescook@chromium.org>
On Tue, Feb 6, 2024 at 4:22 PM Kees Cook <keescook@chromium.org> wrote:
>
> The ARCH=um build has its own idea about strscpy()'s definition. Adjust
> the callers to remove the redundant sizeof() arguments ahead of treewide
> changes, since it needs a manual adjustment for the newly named
> sized_strscpy() export.
...
> - strscpy(dir, home, sizeof(dir));
> + strscpy(dir, home);
> uml_dir++;
> }
> strlcat(dir, uml_dir, sizeof(dir));
An (unrelated) side note: are we going to get rid of strlcat() as well
(after strlcpy() is gone)?
...
> if (*umid == '\0') {
> - strscpy(tmp, uml_dir, sizeof(tmp));
> + strscpy(tmp, uml_dir);
> strlcat(tmp, "XXXXXX", sizeof(tmp));
This code is interesting... (Esp. taking into account making a
temporary folder out of this...)
--
With Best Regards,
Andy Shevchenko
next parent reply other threads:[~2024-02-06 15:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240206142027.make.107-kees@kernel.org>
[not found] ` <20240206142221.2208763-4-keescook@chromium.org>
2024-02-06 15:02 ` Andy Shevchenko [this message]
[not found] ` <20240206142221.2208763-1-keescook@chromium.org>
2024-02-07 0:32 ` [PATCH v3 1/4] string: Redefine strscpy_pad() as a macro Justin Stitt
[not found] ` <20240206142221.2208763-3-keescook@chromium.org>
2024-02-07 0:51 ` [PATCH v3 3/4] string: Allow 2-argument strscpy_pad() Justin Stitt
[not found] ` <202402070115.2C86687F@keescook>
2024-02-10 12:34 ` David Laight
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='CAHp75Vf3c0Q7tV8ih5fRL6Bsjr6dhspFe+mxV7xUN=vZ1JdTKQ@mail.gmail.com' \
--to=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=anton.ivanov@cambridgegreys.com \
--cc=azeemshaikh38@gmail.com \
--cc=jasowang@redhat.com \
--cc=johannes@sipsolutions.net \
--cc=justinstitt@google.com \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=lkp@intel.com \
--cc=nathan@kernel.org \
--cc=richard@nod.at \
--cc=willemdebruijn.kernel@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).