mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
libceph: prevent potential out-of-bounds reads in handle_auth_done()
Perform an explicit bounds check on payload_len to avoid a possible out-of-bounds access in the callout. [ idryomov: changelog ] Cc: stable@vger.kernel.org Signed-off-by: ziming zhang <ezrakiez@gmail.com> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
committed by
Ilya Dryomov
parent
9ace4753a5
commit
818156caff
@@ -2376,7 +2376,9 @@ static int process_auth_done(struct ceph_connection *con, void *p, void *end)
|
||||
|
||||
ceph_decode_64_safe(&p, end, global_id, bad);
|
||||
ceph_decode_32_safe(&p, end, con->v2.con_mode, bad);
|
||||
|
||||
ceph_decode_32_safe(&p, end, payload_len, bad);
|
||||
ceph_decode_need(&p, end, payload_len, bad);
|
||||
|
||||
dout("%s con %p global_id %llu con_mode %d payload_len %d\n",
|
||||
__func__, con, global_id, con->v2.con_mode, payload_len);
|
||||
|
||||
Reference in New Issue
Block a user