* [PATCH 9/9] sunrpc: auth_gss: misused copy_to_user() return value
@ 2010-07-30 11:10 Kulikov Vasiliy
2010-07-30 17:48 ` Trond Myklebust
0 siblings, 1 reply; 2+ messages in thread
From: Kulikov Vasiliy @ 2010-07-30 11:10 UTC (permalink / raw)
To: kernel-janitors
Cc: Trond Myklebust, J. Bruce Fields, Neil Brown, David S. Miller,
Jeff Layton, Steve Dickson, Suresh Jayaraman, Kevin Coffman,
linux-nfs, netdev
copy_to_user() returns nonzero value on error, this value may be any
value between 0 and requested count, not only requested count.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
net/sunrpc/auth_gss/auth_gss.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 8da2a0e..232d7dc 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -610,7 +610,7 @@ gss_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg,
unsigned long left;
left = copy_to_user(dst, data, mlen);
- if (left == mlen) {
+ if (left)
msg->errno = -EFAULT;
return -EFAULT;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 9/9] sunrpc: auth_gss: misused copy_to_user() return value
2010-07-30 11:10 [PATCH 9/9] sunrpc: auth_gss: misused copy_to_user() return value Kulikov Vasiliy
@ 2010-07-30 17:48 ` Trond Myklebust
0 siblings, 0 replies; 2+ messages in thread
From: Trond Myklebust @ 2010-07-30 17:48 UTC (permalink / raw)
To: Kulikov Vasiliy
Cc: kernel-janitors, J. Bruce Fields, Neil Brown, David S. Miller,
Jeff Layton, Steve Dickson, Suresh Jayaraman, Kevin Coffman,
linux-nfs, netdev
On Fri, 2010-07-30 at 15:10 +0400, Kulikov Vasiliy wrote:
> copy_to_user() returns nonzero value on error, this value may be any
> value between 0 and requested count, not only requested count.
>
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> ---
> net/sunrpc/auth_gss/auth_gss.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
> index 8da2a0e..232d7dc 100644
> --- a/net/sunrpc/auth_gss/auth_gss.c
> +++ b/net/sunrpc/auth_gss/auth_gss.c
> @@ -610,7 +610,7 @@ gss_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg,
> unsigned long left;
>
> left = copy_to_user(dst, data, mlen);
> - if (left == mlen) {
> + if (left)
> msg->errno = -EFAULT;
> return -EFAULT;
> }
Ditto unnecessary...
Trond
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-30 17:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-30 11:10 [PATCH 9/9] sunrpc: auth_gss: misused copy_to_user() return value Kulikov Vasiliy
2010-07-30 17:48 ` Trond Myklebust
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).