]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
libceph: fix invalid accesses to ceph_connection_v1_info
authorIlya Dryomov <idryomov@gmail.com>
Thu, 3 Jul 2025 10:10:50 +0000 (12:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:35:47 +0000 (16:35 +0200)
commit35dbbc3dbf8bccb2d77c68444f42c1e6d2d27983
tree26ac316bc378d7b1ec1c4b767b05fa3d12bf1119
parent7e64474aba78d240f7804f48f2d454dcca78b15f
libceph: fix invalid accesses to ceph_connection_v1_info

commit cdbc9836c7afadad68f374791738f118263c5371 upstream.

There is a place where generic code in messenger.c is reading and
another place where it is writing to con->v1 union member without
checking that the union member is active (i.e. msgr1 is in use).

On 64-bit systems, con->v1.auth_retry overlaps with con->v2.out_iter,
so such a read is almost guaranteed to return a bogus value instead of
0 when msgr2 is in use.  This ends up being fairly benign because the
side effect is just the invalidation of the authorizer and successive
fetching of new tickets.

con->v1.connect_seq overlaps with con->v2.conn_bufs and the fact that
it's being written to can cause more serious consequences, but luckily
it's not something that happens often.

Cc: stable@vger.kernel.org
Fixes: cd1a677cad99 ("libceph, ceph: implement msgr2.1 protocol (crc and secure modes)")
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ceph/messenger.c