Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3067599imu; Mon, 19 Nov 2018 10:08:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/VbSN9Vh6AXqhxW1dbEUIpuKDZ0HFf+bBD+M4UzSJBa9poZZI0RvHqjwG+hgxgXansjW8A3 X-Received: by 2002:a17:902:14b:: with SMTP id 69mr8205881plb.52.1542650884144; Mon, 19 Nov 2018 10:08:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542650884; cv=none; d=google.com; s=arc-20160816; b=Ts1BBeS21xGJjPDXGw2057+1LkM76WXefOSrNAEPUlBjAnqDTYduWPoC9WR3R07Op6 125haZgaWCBaFP4PcN/rpByA/V5bbA1kBILMHvgR3eIeN+IbGvINjxJpOdPY5T7UIHBy r+IvhJ9bYPsEU0Xr+VG17Hi0wWjBLlO7akLJdCagmX0tJKfTf4bl6ZdBiEJkG/+Sf3w0 oIqG/F4SPwePWLASf0ZPylkQ+ajakF527VMkJ8lPZmnyGShdZ6APg6GgmoErNawi5/P+ LU9lQOTE46/M2gmuT6Q6vF0XkePHcMFCzIoafwOkCxRXtIWeI13Zng1XIexFUaA6yK36 4M6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3baJoziSQBOW01fjf3HkW9ZVMSlyg2791cJwEEdt7Zw=; b=h4J4641+wsKkoiG4n2OStO5yPshONKm+937eKtYctr9ITmwQ7UHstZLUnV8T+2erle Mt6cK9Z3vlMSEsgv84J6njJxeRm7ehVVv2spK4LB/nUX1g0IOm/gxGdZ+bze2AuuCCIk PXXvgtmIU21Ndg/ErSK2ylFfPfi1UvUyGfpIzpjUv0YuxOX1xRMAeTzOmiZ4HfT/qrCV L/nTO22b7ParfWiV3Ghpo8SVhRG+pqeaBLzdoaz3gYvSda7vG334mTxwb3zv4ZswFIAC rbLLTGNdPDh4xRpVK8hNaLuby9ufQjwePIFdnkgyn1vsDB8LerBEQwa+zZn/Nk9OjMXV fkew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KFRdl2ge; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d187-v6si44928837pfa.68.2018.11.19.10.07.49; Mon, 19 Nov 2018 10:08:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KFRdl2ge; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730995AbeKTC5M (ORCPT + 99 others); Mon, 19 Nov 2018 21:57:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:55722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730162AbeKTC5M (ORCPT ); Mon, 19 Nov 2018 21:57:12 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3C0B02086A; Mon, 19 Nov 2018 16:33:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542645184; bh=/I429B/ea4r3vV6CbZRVAVHm4tajAJSeWBPh+WNw9AA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KFRdl2gel4CLoscFSeX4kQxsQsXiTzed6X4RNzwn5aWasy+1NxjcryrnxvzWZQqGn YZCdLQ7g94SGjnlJk5WMG33gouI6d7aL2dnoXUkB3Z18zblIpuZ9A4zYKq+UmoeCSd zuvb46l5LGDDDXAjE4fCCrYQVThBy0ST+9g0iysQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chao Yu , Gao Xiang , Sasha Levin Subject: [PATCH 4.19 029/205] staging: erofs: fix a missing endian conversion Date: Mon, 19 Nov 2018 17:25:36 +0100 Message-Id: <20181119162622.731665592@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162616.586062722@linuxfoundation.org> References: <20181119162616.586062722@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gao Xiang [ Upstream commit 37ec35a6cc2b99eb7fd6b85b7d7b75dff46bc353 ] This patch fixes a missing endian conversion in vle_get_logical_extent_head. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/erofs/unzip_vle.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/drivers/staging/erofs/unzip_vle.c +++ b/drivers/staging/erofs/unzip_vle.c @@ -1490,6 +1490,7 @@ static erofs_off_t vle_get_logical_exten unsigned long long ofs; const unsigned int clusterbits = EROFS_SB(inode->i_sb)->clusterbits; const unsigned int clustersize = 1 << clusterbits; + unsigned int delta0; if (page->index != blkaddr) { kunmap_atomic(*kaddr_iter); @@ -1504,12 +1505,13 @@ static erofs_off_t vle_get_logical_exten di = *kaddr_iter + vle_extent_blkoff(inode, lcn); switch (vle_cluster_type(di)) { case Z_EROFS_VLE_CLUSTER_TYPE_NONHEAD: - BUG_ON(!di->di_u.delta[0]); - BUG_ON(lcn < di->di_u.delta[0]); + delta0 = le16_to_cpu(di->di_u.delta[0]); + DBG_BUGON(!delta0); + DBG_BUGON(lcn < delta0); ofs = vle_get_logical_extent_head(inode, page_iter, kaddr_iter, - lcn - di->di_u.delta[0], pcn, flags); + lcn - delta0, pcn, flags); break; case Z_EROFS_VLE_CLUSTER_TYPE_PLAIN: *flags ^= EROFS_MAP_ZIPPED;