sunrpc: auth_gss: misused copy_to_user() return value
Subsystems (5)
PATCH 9/9 sunrpc: auth_gss: misused copy_to_user() return value
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 <[email protected]>
--- net/sunrpc/auth_gss/auth_gss.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/sunrpc/auth_gss/auth_gss.c +1 -1
@@ -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 ; }
Signature · 1 line
1.7.0.4
Quoted 13 lines · Kulikov Vasiliy
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 <[email protected]>--- net/sunrpc/auth_gss/auth_gss.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)net/sunrpc/auth_gss/auth_gss.c +0
-0
net/sunrpc/auth_gss/auth_gss.c gss_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg, · line 616
Quoted 8 lines
net/sunrpc/auth_gss/auth_gss.c +1
-1@@ -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