From patchwork Fri Jul 10 07:06:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namjae Jeon X-Patchwork-Id: 11655827 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10E6F92A for ; Fri, 10 Jul 2020 07:12:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E6D9D2077D for ; Fri, 10 Jul 2020 07:12:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="ENSl+aJF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725966AbgGJHMO (ORCPT ); Fri, 10 Jul 2020 03:12:14 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:40377 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725943AbgGJHMN (ORCPT ); Fri, 10 Jul 2020 03:12:13 -0400 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20200710071210epoutp019831a7d5f7638abae194f3cba6596343~gUqNv_t360639206392epoutp01n for ; Fri, 10 Jul 2020 07:12:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20200710071210epoutp019831a7d5f7638abae194f3cba6596343~gUqNv_t360639206392epoutp01n DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594365130; bh=/t3GOhd3EujC86HBkGwp/MyxxttlluRp2O1d8XhoX4c=; h=From:To:Cc:Subject:Date:References:From; b=ENSl+aJFuNV8/llOHJ5qCd1b+k3diEsXP6SFhSSF3falqHLTKwjAUNzhQoiPu4LNy swGvjmwgDEQEX4DWTJllnXuq98Ed7YOMhaZ8zlE0E8Zxa3Wacg6k6udF3mb3JF487O EKoCixLKFtFq9rlnEXcuWgS85qqojrUIiBA0NrCU= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20200710071209epcas1p1e22cd134d7e1aeceabf5718bdd7a8cf7~gUqNXMqae2509625096epcas1p1j; Fri, 10 Jul 2020 07:12:09 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.166]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4B343r3yt0zMqYkn; Fri, 10 Jul 2020 07:12:08 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 68.DD.28578.8C4180F5; Fri, 10 Jul 2020 16:12:08 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200710071207epcas1p2bbcd1f5c96f6aba7e3f67cbedbe85a19~gUqL2xCbX0143001430epcas1p2j; Fri, 10 Jul 2020 07:12:07 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200710071207epsmtrp202b7032d125c2b43ce843a551954940e~gUqL2GsaO0421104211epsmtrp2L; Fri, 10 Jul 2020 07:12:07 +0000 (GMT) X-AuditID: b6c32a39-8dfff70000006fa2-aa-5f0814c858b2 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 9C.77.08382.7C4180F5; Fri, 10 Jul 2020 16:12:07 +0900 (KST) Received: from localhost.localdomain (unknown [10.88.103.87]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200710071207epsmtip211d9a43c1d5acdd09b877149f77f1af4~gUqLnd1lQ1117611176epsmtip2u; Fri, 10 Jul 2020 07:12:07 +0000 (GMT) From: Namjae Jeon To: linux-fsdevel@vger.kernel.org Cc: Ilya Ponetayev , stable@vger.kernel.org, Chen Minqiang , Namjae Jeon Subject: [PATCH] exfat: fix name_hash computation on big endian systems Date: Fri, 10 Jul 2020 16:06:30 +0900 Message-Id: <20200710070630.32684-1-namjae.jeon@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHKsWRmVeSWpSXmKPExsWy7bCmvu4JEY54g20/pS1W//rEbrFn70kW ix/T6y32f//MaLFg4yNGB1aPnbPusnus7pzK6NG3ZRWjx+dNcgEsUTk2GamJKalFCql5yfkp mXnptkrewfHO8aZmBoa6hpYW5koKeYm5qbZKLj4Bum6ZOUBrlRTKEnNKgUIBicXFSvp2NkX5 pSWpChn5xSW2SqkFKTkFhgYFesWJucWleel6yfm5VoYGBkamQJUJORnTjm9nLWjkqni/9R5j A+Myji5GTg4JAROJQ+dbmboYuTiEBHYwSnyf3gflfGKU2PDjGiOE841Rovl3CxNMy58Hc6ES exkl7k++xwrXMvlKL3sXIwcHm4C2xJ8toiCmiICixOX3TiAlzAITGSXezbjDCDJIWMBd4vaB hSwgNouAqsTKVW1gcV4BG4n/n+axQCyTl1i94QAzhD2dXeJ9QxaE7SJx/vYJqLiwxKvjW9gh bCmJz+/2soHslRColvi4H6qkg1HixXdbCNtY4ub6DawgJcwCmhLrd+lDhBUldv6eC3YBswCf xLuvPawQU3glOtqEIEpUJfouHYaGgrREV/sHqKUeEgcbl4LFhQRiJQ6cP8s+gVF2FsKCBYyM qxjFUguKc9NTiw0LTJGjaBMjOCFpWe5gnP72g94hRiYOxkOMEhzMSiK8Boqs8UK8KYmVValF +fFFpTmpxYcYTYGhNZFZSjQ5H5gS80riDU2NjI2NLUzMzM1MjZXEef+dZY8XEkhPLEnNTk0t SC2C6WPi4JRqYNqdWrK0IbiO+5eNdUcd997rLw7NO6/E/C45TYBTZa12v3bt8Tt+j/Ollip+ ++p57V5Q2zVtLp/30gFsVelmF8/oqz//c7122q6/2hNL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zvOcEdeX65s0 d5S8/jgx/e43lt+eLtUJh3u5usKSgmdvVpM9HvfXZp2jEktxRqKhFnNRcSIAqhZzTYACAAA= X-CMS-MailID: 20200710071207epcas1p2bbcd1f5c96f6aba7e3f67cbedbe85a19 X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200710071207epcas1p2bbcd1f5c96f6aba7e3f67cbedbe85a19 References: Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From: Ilya Ponetayev On-disk format for name_hash field is LE, so it must be explicitly transformed on BE system for proper result. Fixes: 370e812b3ec1 ("exfat: add nls operations") Cc: stable@vger.kernel.org # v5.7 Signed-off-by: Chen Minqiang Signed-off-by: Ilya Ponetayev Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon --- fs/exfat/nls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/exfat/nls.c b/fs/exfat/nls.c index 57b5a7a4d1f7..c286a5c2e323 100644 --- a/fs/exfat/nls.c +++ b/fs/exfat/nls.c @@ -519,7 +519,7 @@ static int exfat_utf8_to_utf16(struct super_block *sb, exfat_wstrchr(bad_uni_chars, *uniname)) lossy |= NLS_NAME_LOSSY; - upname[i] = exfat_toupper(sb, *uniname); + upname[i] = cpu_to_le16(exfat_toupper(sb, *uniname)); uniname++; } @@ -611,7 +611,7 @@ static int exfat_nls_to_ucs2(struct super_block *sb, exfat_wstrchr(bad_uni_chars, *uniname)) lossy |= NLS_NAME_LOSSY; - upname[unilen] = exfat_toupper(sb, *uniname); + upname[unilen] = cpu_to_le16(exfat_toupper(sb, *uniname)); uniname++; unilen++; }