Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pi351-0002Si-AO for mharc-grub-devel@gnu.org; Thu, 30 Mar 2023 20:57:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pi34u-0002SP-Fa for grub-devel@gnu.org; Thu, 30 Mar 2023 20:57:16 -0400 Received: from mail-qv1-xf2d.google.com ([2607:f8b0:4864:20::f2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pi34r-0005ma-QE for grub-devel@gnu.org; Thu, 30 Mar 2023 20:57:16 -0400 Received: by mail-qv1-xf2d.google.com with SMTP id kr22so1446752qvb.5 for ; Thu, 30 Mar 2023 17:57:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; t=1680224230; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=JdY3ICBF5Aa3PDevTLhw+5WAFyfX+l/eUdIVRSHkPCQ=; b=b1Be7sdAq6NX8VuUpEe3MH0TfLqr+0a/lgYO2Hjz+kj1R3GbtlttgGN5t/s8NvURdk pBL3o4+WjbvFIzUMli8n+nOCPS316YmzETTBR977jjTr2Xk/1kSwi11/KOBuEpDPC0QF nMgg49mta/Z1tiMCfxT3jmEtfsLmpwAmOhhtF/aNzcH6pH3sMa9wIC+nkNZSe9yhZRcY BwIB/z9TdVa7dklAgWjzsFMEC+RVmlE6SSmFGzvzygorW2HcV1YCbXJJTDfKyOpWtGk+ yExQyR+e6OttftEurI2YX2dsioacC2ZXoB86lCfghpcl07JcUaoGgRvQz564Aa6YpkWy 0G7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680224230; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JdY3ICBF5Aa3PDevTLhw+5WAFyfX+l/eUdIVRSHkPCQ=; b=huVeetm7KLm8i14p8zymvL2OYR8cSrgBAS0Ibb5PJA0tvEcbFX+DMdV6vFVa7m2bfO AT5qg/d4tBGWdsJXb4YYgHOiTPvCu9Qvji4zWd2snzWEDUUk02KJ4TfGoWyJ2EXGrBu9 7iuVW2ycvvi9YNVzpOvdAOSak/InhGkqckpvS6OLCANTGBeB6adlUQVaaNmGlAKSiaYx NI30iffKYltu+QT6Wn4WYTZUI98af8UbtE7ABwCPkqc3YPQtCKU4iTx2rMAA0lZoLGes 62TRRtZVYxAPzwXsS+th3JOkp/0xO2abfKYC94fMCrj5TKxLZsK4l+SZKjAdh4lsC5+8 M3Og== X-Gm-Message-State: AAQBX9eGtusmarsgnzXq4G357KOf8lnfBl36lPizSlCFKfKLf1DOJBIn NQwEKfp2exKkltZKRbWpzQThRQ== X-Google-Smtp-Source: AKy350bL93X8eqTdT2RXPA9I2Y1XHk0eFBFPH8kiLDiVMrN0QJ4wggP/8R//54Q6KaBPmrSuPcwEsg== X-Received: by 2002:a05:6214:d66:b0:5a3:2814:59e with SMTP id 6-20020a0562140d6600b005a32814059emr14201050qvs.4.1680224229911; Thu, 30 Mar 2023 17:57:09 -0700 (PDT) Received: from [10.41.0.46] ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id kd12-20020a056214400c00b005dd8b934589sm236379qvb.33.2023.03.30.17.57.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Mar 2023 17:57:09 -0700 (PDT) Message-ID: <6990389e-3afc-d80c-40c8-9e8bdda9e856@efficientek.com> Date: Fri, 31 Mar 2023 00:57:05 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH 0/2] fs/iso9660: Delay CE hop until end of current SUSP area Content-Language: en-US To: Daniel Kiper , Thomas Schmitt Cc: grub-devel@gnu.org, lidong.chen@oracle.com References: <20230307165651.733429-1-scdbackup@gmx.net> <20230330183010.ndmhyzb7ebeokhzm@tomti.i.net-space.pl> From: Glenn Washburn In-Reply-To: <20230330183010.ndmhyzb7ebeokhzm@tomti.i.net-space.pl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::f2d; envelope-from=development@efficientek.com; helo=mail-qv1-xf2d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2023 00:57:16 -0000 On 3/30/23 18:30, Daniel Kiper wrote: > On Tue, Mar 07, 2023 at 05:56:49PM +0100, Thomas Schmitt wrote: >> Hi, >> >> SUSP 1.12 says: >> >> The "CE" System Use Entry indicates a Continuation Area that shall be >> processed after the current System Use field or Continuation Area is >> processed. >> >> But GRUB rather takes an encountered CE entry as reason to immediately >> switch reading to the location that is given by the CE entry. >> This can skip over important information. >> >> The usual ISO 9660 producers on GNU/Linux write the CE entry as last >> entry of System Use field or Continuation Area. So the problem does not >> show up with their output. Nevertheless, Linux and libisofs obey the >> specs whereas GRUB does not. >> >> As demonstration i crafted a small ISO, where the CE entry comes before >> the NM entry which tells the Rock Ridge file name "RockRidgeName:x". >> Linux shows the NM name, nevertheless: >> $ sudo mount iso9660_early_ce.iso /mnt/iso >> mount: /mnt/iso: WARNING: source write-protected, mounted read-only. >> $ ls /mnt/iso >> RockRidgeName:x >> $ >> >> GRUB does not see the NM entry and thus shows the dull ISO 9660 name >> (which is actually "ROCKRIDG.;1"): >> $ ./grub-fstest iso9660_early_ce.iso ls / >> rockridg >> $ >> >> After the code change of my patch, i get: >> $ ./grub-fstest iso9660_early_ce.iso ls / >> RockRidgeName:x >> $ >> >> A new code block in tests/iso9660_test.in verifies that the patched code >> is in effect: >> make check TESTS=iso9660_test >> detects the old code state and shows that the new code still has the >> capability to cope with endless CE loops. >> >> ------------------------------------------------------------------------- >> How to create an ISO 9660 filesystem where CE is not the last SUSP entry >> of a file's directory record: >> >> # Deliberately chosen names >> iso=iso9660_early_ce.iso >> # rr_path is longer than 8, mixed-case, with non-ISO-9660 character >> rr_path=/RockRidgeName:x >> >> # A dummy file as payload >> echo x >x >> >> # 250 fattr characters to surely exceed the size of a directory record >> long_string=0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 >> >> # Create ISO with the payload file and attached fattr named user.dummy . >> # Make it small with the most restrictive ISO 9660 file name rules. >> test -e "$iso" && rm "$iso" >> xorriso -compliance no_emul_toc:iso_9660_level=1 \ >> -padding 0 \ >> -outdev "$iso" \ >> -xattr on \ >> -map x "$rr_path" \ >> -setfattr user.dummy "$long_string" "$rr_path" -- >> >> # Cut out the NM field and the CE field from the directory record >> # of $rr_path. The numbers were determined by looking at a hex dump. >> dd if="$iso" bs=1 skip=37198 count=20 of=nm_field >> dd if="$iso" bs=1 skip=37218 count=28 of=ce_field >> >> # Put them back in reverse sequence >> dd conv=notrunc if=ce_field bs=1 seek=37198 of="$iso" >> dd conv=notrunc if=nm_field bs=1 seek=37226 of="$iso" > > Patch set LGTM. Though I would prefer to hear Glenn's opinion on the test > Thomas introduces because AIUI this [1] email presented some concerns. > > Glenn? > > Daniel > > [1] https://lists.gnu.org/archive/html/grub-devel/2023-03/msg00022.html I had partially written a response to the above referenced email a couple weeks ago, but didn't sent it because it seemed unnecessary with the way Thomas changed the test to work with or without extra trailing spaces. So the concerns in the referenced email aren't a concern for this test patch. As for a more general concern, not really either. If the trailing spaces are removed later on, tests will fail and then they can be fixed. To sum up what I was going to say in response to the referenced email, grub-fstest is a tool for running grub commands/code in user-space and has subcommands corresponding for specifying what code to run. I haven't verified, but I believe that in this case the grub "ls" command is creating the output, so its likely that the command is what is producing the extra space, not grub-fstest itself. Again, not something to worry about here, IMO. So patch #2, the test patch, in the series LGTM. Glenn