ACK/Cmnt: [SRU][F][G][PATCH 1/1] ceph: fix endianness bug when handling MDS session feature bits

Stefan Bader stefan.bader at canonical.com
Wed May 13 12:23:08 UTC 2020


On 11.05.20 11:02, frank.heimes at canonical.com wrote:
> From: Jeff Layton <jlayton at kernel.org>
> 
> BugLink: https://bugs.launchpad.net/bugs/1875863
> 
> 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 at vger.kernel.org
> Reported-and-Tested-by: Eduard Shishkin <edward6 at linux.ibm.com>
> Signed-off-by: Jeff Layton <jlayton at kernel.org>
> Reviewed-by: "Yan, Zheng" <zyan at redhat.com>
> Signed-off-by: Ilya Dryomov <idryomov at gmail.com>
> (cherry picked from commit 0fa8263367db9287aa0632f96c1a5f93cc478150)
> Signed-off-by: Frank Heimes <frank.heimes at canonical.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>
> ---

SRU justification should be in the bug reports description so the Launchpad SRU
team (archive admins) have a chance to read it.

-Stefan

>  fs/ceph/mds_client.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index 8c1f04c3a684..b79fe6549df6 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -3072,8 +3072,7 @@ static void handle_session(struct ceph_mds_session *session,
>  	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_mds_session *session,
>  			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);
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20200513/6791f3ee/attachment.sig>


More information about the kernel-team mailing list