From: Christoph Hellwig <hch@infradead.org>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Arnd Bergmann <arnd@arndb.de>,
"Darrick J. Wong" <darrick.wong@oracle.com>,
linux-xfs@vger.kernel.org, Eric Sandeen <sandeen@redhat.com>,
Martin Sebor <msebor@gmail.com>,
Brian Foster <bfoster@redhat.com>,
Dave Chinner <dchinner@redhat.com>,
Dan Williams <dan.j.williams@intel.com>,
Ross Zwisler <ross.zwisler@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] xfs: fix string handling in get/set functions
Date: Wed, 6 Jun 2018 03:58:17 -0700 [thread overview]
Message-ID: <20180606105817.GA6575@infradead.org> (raw)
In-Reply-To: <7aad9fc3-ed65-a016-d477-5d830e31cb43@sandeen.net>
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index 82f7c83c1dad..596e176c19a6 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -1828,13 +1828,13 @@ xfs_ioc_getlabel(
> /* Paranoia */
> BUILD_BUG_ON(sizeof(sbp->sb_fname) > FSLABEL_MAX);
>
> + /* 1 larger than sb_fname, so this ensures a trailing NUL char */
> + memset(label, 0, sizeof(label));
I don't get the comment. In fact I don't even get why we need any
comment here. This is a structure that gets copied to userspace,
and we zero the whole structure, as we should do by default for
anything that goes to userspace.
Otherwise this looks fine to me.
next prev parent reply other threads:[~2018-06-06 10:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-25 15:14 [PATCH] xfs: mark sb_fname as nonstring Arnd Bergmann
2018-05-25 16:52 ` Christoph Hellwig
2018-05-25 20:18 ` Arnd Bergmann
2018-05-25 16:53 ` Eric Sandeen
2018-05-25 20:16 ` Arnd Bergmann
2018-05-25 20:21 ` Eric Sandeen
2018-06-05 18:44 ` Eric Sandeen
2018-06-05 21:23 ` Arnd Bergmann
2018-06-05 21:51 ` Eric Sandeen
2018-06-05 19:49 ` [PATCH V2] xfs: fix string handling in get/set functions Eric Sandeen
2018-06-05 21:28 ` Martin Sebor
2018-06-06 2:59 ` Darrick J. Wong
2018-06-06 10:58 ` Christoph Hellwig [this message]
2018-06-06 17:45 ` Eric Sandeen
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=20180606105817.GA6575@infradead.org \
--to=hch@infradead.org \
--cc=arnd@arndb.de \
--cc=bfoster@redhat.com \
--cc=dan.j.williams@intel.com \
--cc=darrick.wong@oracle.com \
--cc=dchinner@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=msebor@gmail.com \
--cc=ross.zwisler@linux.intel.com \
--cc=sandeen@redhat.com \
--cc=sandeen@sandeen.net \
/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