From patchwork Tue May 1 15:39:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10374107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AD92860234 for ; Tue, 1 May 2018 15:39:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DFBB28707 for ; Tue, 1 May 2018 15:39:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92F142872F; Tue, 1 May 2018 15:39:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD9E928707 for ; Tue, 1 May 2018 15:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755236AbeEAPj4 (ORCPT ); Tue, 1 May 2018 11:39:56 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:46466 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750787AbeEAPjz (ORCPT ); Tue, 1 May 2018 11:39:55 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w41FZe7U108888; Tue, 1 May 2018 15:39:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=vpB0DHZCMn9CKtQaiIYadtkwl8FySk1KFjOxZMjMGLs=; b=FaLpZFOctHq/0luLo2IDxjzOPg3cQKBiXh8DQbsRmyWWmlaG5j+9HW0R6s/3fu4TmuH0 7IiBwyQZsk8K/9UAZEkFAQUeSjNWhMTlDPDqEzoK+K5Goh5ohYEz0bwlHmbXIHIkCTXV ADDTPuoRhrelMaXEZ1zWdcFQCk7MgYClumk2EsbTp6AwDVV9oeYJpgF8maexTaRMi50s 3LmIz/FTwFcG3qw0/IUMyj+MAtsTPOq+OxowGxJDolcvz4hhw9Au39Vw9xWwo3kDoE0L C94nCDCdVgzRGmvO6y8nG4OQrdfkiLaAsp9DnBGTjemT/jZRoDB5pCDbm4sogVpU9c9n hA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2hmgxfr6fp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 01 May 2018 15:39:54 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w41FdqQs022432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 1 May 2018 15:39:53 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w41Fdqvd001302; Tue, 1 May 2018 15:39:52 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 01 May 2018 08:39:52 -0700 Subject: [PATCH 5/9] generic/45[34]: test unicode confusables From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 01 May 2018 08:39:51 -0700 Message-ID: <152518919147.23023.4713276242990600575.stgit@magnolia> In-Reply-To: <152518916007.23023.4793255395982876953.stgit@magnolia> References: <152518916007.23023.4793255395982876953.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8880 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805010154 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Test if a filesystem will allow us to create names with easily confusable unicode sequences (character spoofing) and, if on XFS, whether or not xfs_scrub will notice. Signed-off-by: Darrick J. Wong --- tests/generic/453 | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/454 | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tests/generic/453 b/tests/generic/453 index 6cb2a296..91d163ca 100755 --- a/tests/generic/453 +++ b/tests/generic/453 @@ -116,6 +116,33 @@ setf "\x6c\x69\x6e\x65\x64\x72\x61\x77\x5f\x0a\xe2\x95\x94\xe2\x95\x90\xe2\x95\x setf "moo\xe2\x80\xaegnp.txt" "Well say hello," setf "mootxt.png" "Harvey" +# mixed-script confusables +setf "mixed_t\xce\xbfp.txt" "greek omicron instead of o" +setf "mixed_top.txt" "greek omicron instead of o" + +# single-script spoofing +setf "hyphens_a\xe2\x80\x90b.txt" "hyphens" +setf "hyphens_a-b.txt" "hyphens" + +setf "dz_digraph_dze.txt" "d-z digraph" +setf "dz_digraph_\xca\xa3e.txt" "d-z digraph" + +# inadequate rendering +setf "inadequate_al.txt" "is it l or is it 1" +setf "inadequate_a1.txt" "is it l or is it 1" + +# symbols +setf "prohibition_Rs.txt" "rupee symbol" +setf "prohibition_\xe2\x82\xa8.txt" "rupee symbol" + +# zero width joiners +setf "zerojoin_moocow.txt" "zero width joiners" +setf "zerojoin_moo\xe2\x80\x8dcow.txt" "zero width joiners" + +# combining marks +setf "combmark_\xe1\x80\x9c\xe1\x80\xad\xe1\x80\xaf.txt" "combining marks" +setf "combmark_\xe1\x80\x9c\xe1\x80\xaf\xe1\x80\xad.txt" "combining marks" + ls -la $testdir >> $seqres.full echo "Test files" @@ -142,6 +169,27 @@ testf "\x6c\x69\x6e\x65\x64\x72\x61\x77\x5f\x0a\xe2\x95\x94\xe2\x95\x90\xe2\x95\ testf "moo\xe2\x80\xaegnp.txt" "Well say hello," testf "mootxt.png" "Harvey" +testf "mixed_t\xce\xbfp.txt" "greek omicron instead of o" +testf "mixed_top.txt" "greek omicron instead of o" + +testf "hyphens_a\xe2\x80\x90b.txt" "hyphens" +testf "hyphens_a-b.txt" "hyphens" + +testf "dz_digraph_dze.txt" "d-z digraph" +testf "dz_digraph_\xca\xa3e.txt" "d-z digraph" + +testf "inadequate_al.txt" "is it l or is it 1" +testf "inadequate_a1.txt" "is it l or is it 1" + +testf "prohibition_Rs.txt" "rupee symbol" +testf "prohibition_\xe2\x82\xa8.txt" "rupee symbol" + +testf "zerojoin_moocow.txt" "zero width joiners" +testf "zerojoin_moo\xe2\x80\x8dcow.txt" "zero width joiners" + +testf "combmark_\xe1\x80\x9c\xe1\x80\xad\xe1\x80\xaf.txt" "combining marks" +testf "combmark_\xe1\x80\x9c\xe1\x80\xaf\xe1\x80\xad.txt" "combining marks" + echo "Uniqueness of inodes?" stat -c '%i' "${testdir}/"* | sort | uniq -c | while read nr inum; do if [ "${nr}" -gt 1 ]; then @@ -170,6 +218,12 @@ if check_xfs_scrub; then echo "${output}" | grep -q "french_" || echo "No complaints about french e accent?" echo "${output}" | grep -q "greek_" || echo "No complaints about greek letter mess?" echo "${output}" | grep -q "arabic_" || echo "No complaints about arabic expanded string?" + echo "${output}" | grep -q "mixed_" || echo "No complaints about mixed script confusables?" + echo "${output}" | grep -q "hyphens_" || echo "No complaints about hyphenation confusables?" + echo "${output}" | grep -q "dz_digraph_" || echo "No complaints about single script confusables?" + echo "${output}" | grep -q "inadequate_" || echo "No complaints about inadequate rendering confusables?" + echo "${output}" | grep -q "prohibition_" || echo "No complaints about prohibited sequence confusables?" + echo "${output}" | grep -q "zerojoin_" || echo "No complaints about zero-width join confusables?" echo "Actual xfs_scrub output:" >> $seqres.full echo "${output}" >> $seqres.full fi diff --git a/tests/generic/454 b/tests/generic/454 index ec4fb997..fdb5ef87 100755 --- a/tests/generic/454 +++ b/tests/generic/454 @@ -114,6 +114,33 @@ setf "\x6c\x69\x6e\x65\x64\x72\x61\x77\x5f\x0a\xe2\x95\x94\xe2\x95\x90\xe2\x95\x setf "moo\xe2\x80\xaegnp.txt" "Well say hello," setf "mootxt.png" "Harvey" +# mixed-script confusables +setf "mixed_t\xce\xbfp.txt" "greek omicron instead of o" +setf "mixed_top.txt" "greek omicron instead of o" + +# single-script spoofing +setf "hyphens_a\xe2\x80\x90b.txt" "hyphens" +setf "hyphens_a-b.txt" "hyphens" + +setf "dz_digraph_dze.txt" "d-z digraph" +setf "dz_digraph_\xca\xa3e.txt" "d-z digraph" + +# inadequate rendering +setf "inadequate_al.txt" "is it l or is it 1" +setf "inadequate_a1.txt" "is it l or is it 1" + +# symbols +setf "prohibition_Rs.txt" "rupee symbol" +setf "prohibition_\xe2\x82\xa8.txt" "rupee symbol" + +# zero width joiners +setf "zerojoin_moocow.txt" "zero width joiners" +setf "zerojoin_moo\xe2\x80\x8ccow.txt" "zero width joiners" + +# combining marks +setf "combmark_\xe1\x80\x9c\xe1\x80\xad\xe1\x80\xaf.txt" "combining marks" +setf "combmark_\xe1\x80\x9c\xe1\x80\xaf\xe1\x80\xad.txt" "combining marks" + $GETFATTR_PROG --absolute-names -d "${testfile}" >> $seqres.full echo "Test files" @@ -140,6 +167,27 @@ testf "\x6c\x69\x6e\x65\x64\x72\x61\x77\x5f\x0a\xe2\x95\x94\xe2\x95\x90\xe2\x95\ testf "moo\xe2\x80\xaegnp.txt" "Well say hello," testf "mootxt.png" "Harvey" +testf "mixed_t\xce\xbfp.txt" "greek omicron instead of o" +testf "mixed_top.txt" "greek omicron instead of o" + +testf "hyphens_a\xe2\x80\x90b.txt" "hyphens" +testf "hyphens_a-b.txt" "hyphens" + +testf "dz_digraph_dze.txt" "d-z digraph" +testf "dz_digraph_\xca\xa3e.txt" "d-z digraph" + +testf "inadequate_al.txt" "is it l or is it 1" +testf "inadequate_a1.txt" "is it l or is it 1" + +testf "prohibition_Rs.txt" "rupee symbol" +testf "prohibition_\xe2\x82\xa8.txt" "rupee symbol" + +testf "zerojoin_moocow.txt" "zero width joiners" +testf "zerojoin_moo\xe2\x80\x8ccow.txt" "zero width joiners" + +testf "combmark_\xe1\x80\x9c\xe1\x80\xad\xe1\x80\xaf.txt" "combining marks" +testf "combmark_\xe1\x80\x9c\xe1\x80\xaf\xe1\x80\xad.txt" "combining marks" + echo "Uniqueness of keys?" crazy_keys="$($GETFATTR_PROG --absolute-names -d "${testfile}" | egrep -c '(french_|chinese_|greek_|arabic_|urk)')" expected_keys=11 @@ -166,6 +214,12 @@ if check_xfs_scrub; then echo "${output}" | grep -q "french_" || echo "No complaints about french e accent?" echo "${output}" | grep -q "greek_" || echo "No complaints about greek letter mess?" echo "${output}" | grep -q "arabic_" || echo "No complaints about arabic expanded string?" + echo "${output}" | grep -q "mixed_" || echo "No complaints about mixed script confusables?" + echo "${output}" | grep -q "hyphens_" || echo "No complaints about hyphenation confusables?" + echo "${output}" | grep -q "dz_digraph_" || echo "No complaints about single script confusables?" + echo "${output}" | grep -q "inadequate_" || echo "No complaints about inadequate rendering confusables?" + echo "${output}" | grep -q "prohibition_" || echo "No complaints about prohibited sequence confusables?" + echo "${output}" | grep -q "zerojoin_" || echo "No complaints about zero-width join confusables?" echo "Actual xfs_scrub output:" >> $seqres.full echo "${output}" >> $seqres.full fi