diff options
Diffstat (limited to 'net/ceph/auth_x.c')
-rw-r--r-- | net/ceph/auth_x.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c index de6662b14e1f..7e38b729696a 100644 --- a/net/ceph/auth_x.c +++ b/net/ceph/auth_x.c | |||
@@ -149,6 +149,7 @@ static int process_one_ticket(struct ceph_auth_client *ac, | |||
149 | struct ceph_crypto_key old_key; | 149 | struct ceph_crypto_key old_key; |
150 | void *ticket_buf = NULL; | 150 | void *ticket_buf = NULL; |
151 | void *tp, *tpend; | 151 | void *tp, *tpend; |
152 | void **ptp; | ||
152 | struct ceph_timespec new_validity; | 153 | struct ceph_timespec new_validity; |
153 | struct ceph_crypto_key new_session_key; | 154 | struct ceph_crypto_key new_session_key; |
154 | struct ceph_buffer *new_ticket_blob; | 155 | struct ceph_buffer *new_ticket_blob; |
@@ -208,25 +209,19 @@ static int process_one_ticket(struct ceph_auth_client *ac, | |||
208 | goto out; | 209 | goto out; |
209 | } | 210 | } |
210 | tp = ticket_buf; | 211 | tp = ticket_buf; |
211 | dlen = ceph_decode_32(&tp); | 212 | ptp = &tp; |
213 | tpend = *ptp + dlen; | ||
212 | } else { | 214 | } else { |
213 | /* unencrypted */ | 215 | /* unencrypted */ |
214 | ceph_decode_32_safe(p, end, dlen, bad); | 216 | ptp = p; |
215 | ticket_buf = kmalloc(dlen, GFP_NOFS); | 217 | tpend = end; |
216 | if (!ticket_buf) { | ||
217 | ret = -ENOMEM; | ||
218 | goto out; | ||
219 | } | ||
220 | tp = ticket_buf; | ||
221 | ceph_decode_need(p, end, dlen, bad); | ||
222 | ceph_decode_copy(p, ticket_buf, dlen); | ||
223 | } | 218 | } |
224 | tpend = tp + dlen; | 219 | ceph_decode_32_safe(ptp, tpend, dlen, bad); |
225 | dout(" ticket blob is %d bytes\n", dlen); | 220 | dout(" ticket blob is %d bytes\n", dlen); |
226 | ceph_decode_need(&tp, tpend, 1 + sizeof(u64), bad); | 221 | ceph_decode_need(ptp, tpend, 1 + sizeof(u64), bad); |
227 | blob_struct_v = ceph_decode_8(&tp); | 222 | blob_struct_v = ceph_decode_8(ptp); |
228 | new_secret_id = ceph_decode_64(&tp); | 223 | new_secret_id = ceph_decode_64(ptp); |
229 | ret = ceph_decode_buffer(&new_ticket_blob, &tp, tpend); | 224 | ret = ceph_decode_buffer(&new_ticket_blob, ptp, tpend); |
230 | if (ret) | 225 | if (ret) |
231 | goto out; | 226 | goto out; |
232 | 227 | ||