Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: cd1a677cad99 ("libceph, ceph: implement msgr2.1 protocol (crc and secure modes)")
Reported-by: Luis Henriques <lhenriques@suse.de>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

+2 -1
+2 -1
net/ceph/messenger_v2.c
··· 1333 1333 void *buf; 1334 1334 int ret; 1335 1335 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))); 1337 1338 if (!buf) 1338 1339 return -ENOMEM; 1339 1340