From: Greg KH <gregkh@linuxfoundation.org>
To: Ioana Ciornei <ciorneiioana@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] staging: lustre: lent: add missing __user __user annotation
Date: Thu, 8 Oct 2015 23:58:02 -0400 [thread overview]
Message-ID: <20151009035802.GA30302@kroah.com> (raw)
In-Reply-To: <1444339813-12063-1-git-send-email-ciorneiioana@gmail.com>
On Fri, Oct 09, 2015 at 12:30:13AM +0300, Ioana Ciornei wrote:
> Add missing __user annotation when using copy_{to/from}_user() to indicate that is
> a pointer from userspace and that it should not be derefenced.
> Also, remove sparse warnings such as:
>
> drivers/staging/lustre/lnet/selftest/console.c:1474:26: warning: incorrect type in argument 1 (different address spaces)
> 1 drivers/staging/lustre/lnet/selftest/console.c:1474:26: expected void [noderef] <asn:1>*to
> 2 drivers/staging/lustre/lnet/selftest/console.c:1474:26: got struct sfw_counters_t [usertype] *[assigned] sfwk_stat
>
> Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
> ---
> drivers/staging/lustre/lnet/selftest/console.c | 44 +++++++++++++-------------
> 1 file changed, 22 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
> index 024aaee..7ba9022 100644
> --- a/drivers/staging/lustre/lnet/selftest/console.c
> +++ b/drivers/staging/lustre/lnet/selftest/console.c
> @@ -384,9 +384,9 @@ lstcon_sesrpc_readent(int transop, srpc_msg_t *msg,
> case LST_TRANS_SESQRY:
> rep = &msg->msg_body.dbg_reply;
>
> - if (copy_to_user(&ent_up->rpe_priv[0],
> + if (copy_to_user((void __user *)&ent_up->rpe_priv[0],
> &rep->dbg_timeout, sizeof(int)) ||
> - copy_to_user(&ent_up->rpe_payload[0],
> + copy_to_user((void __user *)&ent_up->rpe_payload[0],
> &rep->dbg_name, LST_NAME_SIZE))
> return -EFAULT;
>
The __user annotation in the lustre code is a mess, lots of work needs
to be done here, but it's complex and tricky, and in the end is going to
probably require some API changes to do correctly. I strongly recommend
just leaving it alone and letting the lustre developers fix it up
properly sometime in the future, papering over the warnings with these
casts just gives the impression that the issue is fixed, when it really
isn't.
sorry, but I can't take this change.
greg k-h
next prev parent reply other threads:[~2015-10-09 3:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-08 21:30 [PATCH] staging: lustre: lent: add missing __user __user annotation Ioana Ciornei
2015-10-08 21:34 ` [Outreachy kernel] " Arnd Bergmann
2015-10-08 22:29 ` Ioana Ciornei
2015-10-09 8:38 ` Arnd Bergmann
2015-10-09 3:58 ` Greg KH [this message]
2015-10-09 6:06 ` Ioana Ciornei
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=20151009035802.GA30302@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=ciorneiioana@gmail.com \
--cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.