From: Christoph Hellwig <hch@infradead.org>
To: Scott Bauer <scott.bauer@intel.com>
Cc: linux-nvme@lists.infradead.org, David.Laight@ACULAB.COM,
arnd@arndb.de, axboe@fb.com, keith.busch@intel.com,
jonathan.derrick@intel.com, hch@infradead.org,
linux-kernel@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH V4 2/2] Move stack parameters for sed_ioctl to prevent oversized stack with CONFIG_KASAN
Date: Sun, 12 Feb 2017 23:54:22 -0800 [thread overview]
Message-ID: <20170213075422.GB20361@infradead.org> (raw)
In-Reply-To: <1486742454-3254-3-git-send-email-scott.bauer@intel.com>
> int sed_ioctl(struct opal_dev *dev, unsigned int cmd, unsigned long ptr)
> {
> + void *ioctl_ptr;
> + int ret = -ENOTTY;
> void __user *arg = (void __user *)ptr;
Can we use this opportunity to clean up the usual ioctl argument mess.
Id say pass the "void __user *argp" argument already (nvme_ioctl should
have a local variable for it anyway), and then just rename ioctl_ptr
variable to the usual short p.
> + unsigned int cmd_size = _IOC_SIZE(cmd);
>
> + ioctl_ptr = memdup_user(arg, cmd_size);
cmd_size is only used once, so why not opencode the expression in the
argument to memdup_user.
prev parent reply other threads:[~2017-02-13 7:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-10 16:00 Sed-opal Fixes Scott Bauer
2017-02-10 16:00 ` [PATCH V4 1/2] uapi: sed-opal fix IOW for activate lsp to use correct struct Scott Bauer
2017-02-13 7:50 ` Christoph Hellwig
2017-02-10 16:00 ` [PATCH V4 2/2] Move stack parameters for sed_ioctl to prevent oversized stack with CONFIG_KASAN Scott Bauer
2017-02-13 7:54 ` Christoph Hellwig [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=20170213075422.GB20361@infradead.org \
--to=hch@infradead.org \
--cc=David.Laight@ACULAB.COM \
--cc=arnd@arndb.de \
--cc=axboe@fb.com \
--cc=jonathan.derrick@intel.com \
--cc=keith.busch@intel.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=scott.bauer@intel.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®