projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
130f52f
)
libceph: weaken sizeof check in ceph_x_verify_authorizer_reply()
author
Ilya Dryomov
<
[email protected]
>
Fri, 27 Jul 2018 17:45:36 +0000
(19:45 +0200)
committer
Ilya Dryomov
<
[email protected]
>
Thu, 2 Aug 2018 19:33:26 +0000
(21:33 +0200)
Allow for extending ceph_x_authorize_reply in the future.
Signed-off-by: Ilya Dryomov <
[email protected]
>
Reviewed-by: Sage Weil <
[email protected]
>
net/ceph/auth_x.c
patch
|
blob
|
history
diff --git
a/net/ceph/auth_x.c
b/net/ceph/auth_x.c
index 462786f571e7b183d77de8a78e4337933771bf09..b52732337ca6491b7510fc51f664c0785856037d 100644
(file)
--- a/
net/ceph/auth_x.c
+++ b/
net/ceph/auth_x.c
@@
-737,8
+737,10
@@
static int ceph_x_verify_authorizer_reply(struct ceph_auth_client *ac,
ret = ceph_x_decrypt(&au->session_key, &p, p + CEPHX_AU_ENC_BUF_LEN);
if (ret < 0)
return ret;
- if (ret != sizeof(*reply))
- return -EPERM;
+ if (ret < sizeof(*reply)) {
+ pr_err("bad size %d for ceph_x_authorize_reply\n", ret);
+ return -EINVAL;
+ }
if (au->nonce + 1 != le64_to_cpu(reply->nonce_plus_one))
ret = -EPERM;