[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200513094416.106484588@linuxfoundation.org>
Date: Wed, 13 May 2020 11:44:58 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Jeff Layton <jlayton@...nel.org>,
"Yan, Zheng" <zyan@...hat.com>, Ilya Dryomov <idryomov@...il.com>,
Eduard Shishkin <edward6@...ux.ibm.com>
Subject: [PATCH 5.4 62/90] ceph: fix endianness bug when handling MDS session feature bits
From: Jeff Layton <jlayton@...nel.org>
commit 0fa8263367db9287aa0632f96c1a5f93cc478150 upstream.
Eduard reported a problem mounting cephfs on s390 arch. The feature
mask sent by the MDS is little-endian, so we need to convert it
before storing and testing against it.
Cc: stable@...r.kernel.org
Reported-and-Tested-by: Eduard Shishkin <edward6@...ux.ibm.com>
Signed-off-by: Jeff Layton <jlayton@...nel.org>
Reviewed-by: "Yan, Zheng" <zyan@...hat.com>
Signed-off-by: Ilya Dryomov <idryomov@...il.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/ceph/mds_client.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -3072,8 +3072,7 @@ static void handle_session(struct ceph_m
void *end = p + msg->front.iov_len;
struct ceph_mds_session_head *h;
u32 op;
- u64 seq;
- unsigned long features = 0;
+ u64 seq, features = 0;
int wake = 0;
bool blacklisted = false;
@@ -3092,9 +3091,8 @@ static void handle_session(struct ceph_m
goto bad;
/* version >= 3, feature bits */
ceph_decode_32_safe(&p, end, len, bad);
- ceph_decode_need(&p, end, len, bad);
- memcpy(&features, p, min_t(size_t, len, sizeof(features)));
- p += len;
+ ceph_decode_64_safe(&p, end, features, bad);
+ p += len - sizeof(features);
}
mutex_lock(&mdsc->mutex);
Powered by blists - more mailing lists