From: Matthew Wilcox <willy@infradead.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Jeremy Kerr <jk@ozlabs.org>, Arnd Bergmann <arnd@arndb.de>,
linuxppc-dev@lists.ozlabs.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/6] exec: open code copy_string_kernel
Date: Mon, 6 Apr 2020 05:10:32 -0700 [thread overview]
Message-ID: <20200406121032.GX21484@bombadil.infradead.org> (raw)
In-Reply-To: <20200406120312.1150405-7-hch@lst.de>
On Mon, Apr 06, 2020 at 02:03:12PM +0200, Christoph Hellwig wrote:
> + int len = strnlen(arg, MAX_ARG_STRLEN) + 1 /* terminating null */;
If you end up doing another version of this, it's a terminating NUL, not null.
I almost wonder if we shouldn't have
#define TERMINATING_NUL 1
in kernel.h.
int len = strnlen(arg, MAX_ARG_STRLEN) + TERMINATING_NUL;
has a certain appeal. There's the risk people might misuse it though ...
str[end] = TERMINATING_NUL;
so probably not a good idea.
prev parent reply other threads:[~2020-04-06 12:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-06 12:03 remove set_fs calls from the exec and coredump code Christoph Hellwig
2020-04-06 12:03 ` [PATCH 1/6] powerpc/spufs: simplify spufs core dumping Christoph Hellwig
2020-04-06 13:12 ` Arnd Bergmann
2020-04-07 0:01 ` Jeremy Kerr
2020-04-06 12:03 ` [PATCH 2/6] binfmt_elf: open code copy_siginfo_to_user to kernelspace buffer Christoph Hellwig
2020-04-06 13:01 ` Arnd Bergmann
2020-04-06 13:04 ` Christoph Hellwig
2020-04-06 12:03 ` [PATCH 3/6] binfmt_elf: remove the set_fs(KERNEL_DS) in elf_core_dump Christoph Hellwig
2020-04-06 13:02 ` Al Viro
2020-04-06 13:03 ` Christoph Hellwig
2020-04-06 12:03 ` [PATCH 4/6] binfmt_elf_fdpic: remove the set_fs(KERNEL_DS) in elf_fdpic_core_dump Christoph Hellwig
2020-04-06 12:03 ` [PATCH 5/6] exec: simplify the copy_strings_kernel calling convention Christoph Hellwig
2020-04-06 12:03 ` [PATCH 6/6] exec: open code copy_string_kernel Christoph Hellwig
2020-04-06 12:10 ` Matthew Wilcox [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=20200406121032.GX21484@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=hch@lst.de \
--cc=jk@ozlabs.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=viro@zeniv.linux.org.uk \
/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).