Skip to content

Commit ad32fe8

Browse files
committed
libceph: fix auth_signature buffer allocation in secure mode
auth_signature frame is 68 bytes in plain mode and 96 bytes in secure mode but we are requesting 68 bytes in both modes. By luck, this doesn't actually result in any invalid memory accesses because the allocation is satisfied out of kmalloc-96 slab and so exactly 96 bytes are allocated, but KASAN rightfully complains. Fixes: cd1a677 ("libceph, ceph: implement msgr2.1 protocol (crc and secure modes)") Reported-by: Luis Henriques <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 60267ba commit ad32fe8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ceph/messenger_v2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,8 @@ static int prepare_auth_signature(struct ceph_connection *con)
13331333
void *buf;
13341334
int ret;
13351335

1336-
buf = alloc_conn_buf(con, head_onwire_len(SHA256_DIGEST_SIZE, false));
1336+
buf = alloc_conn_buf(con, head_onwire_len(SHA256_DIGEST_SIZE,
1337+
con_secure(con)));
13371338
if (!buf)
13381339
return -ENOMEM;
13391340

0 commit comments

Comments
 (0)