libceph: fix CEPH_FEATURE_CEPHX_V2 check in calc_signature()
authorIlya Dryomov <idryomov@gmail.com>
Wed, 9 Jan 2019 14:17:09 +0000 (15:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 09:03:50 +0000 (10:03 +0100)
Upstream commit cc255c76c70f ("libceph: implement CEPHX_V2 calculation
mode") was adjusted incorrectly: CEPH_FEATURE_CEPHX_V2 if condition got
inverted, thus breaking 4.9.144 and later kernels for all setups that
use cephx.

Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
net/ceph/auth_x.c

index 29e23b5cb2edb141a87991543ea18a854f20ebc1..a4896e4a1c9ac72eb72f450ab7d036dc6373536b 100644 (file)
@@ -804,7 +804,7 @@ static int calc_signature(struct ceph_x_authorizer *au, struct ceph_msg *msg,
        void *enc_buf = au->enc_buf;
        int ret;
 
-       if (msg->con->peer_features & CEPH_FEATURE_CEPHX_V2) {
+       if (!(msg->con->peer_features & CEPH_FEATURE_CEPHX_V2)) {
                struct {
                        __le32 len;
                        __le32 header_crc;