Bug#959425: loopback command hangs in 2.04 under UEFI
Dear Maintainer, I further tried to get some more logging output by "set debug=all". There I found that the loopback command actually returns after around 2 minutes for my 335 MB ISO file. >From the logging is looks like the whole ISO is read to memory, if the tpm module is loaded. If it is not loaded the ISO seems to get not touched at all. Is it "just" checking if the file is signed? (Even when running without secureboot?) Kind regards, Bernhard 13:42:00 13:44:03 ~123 seconds #serial --speed=115200 efi0 terminal_input console serial_efi0 terminal_output gfxterm serial_efi0 set debug=all #set pager=1 date; loopback loop /debian-10.3.0-amd64-netinst.iso; date ### # With module tpm loaded: grub> set debug=all script/script.c:65: free 0xbbc4fdc0 script/script.c:65: free 0xbbc4fe00 script/script.c:65: free 0xbbc4fe40 script/script.c:65: free 0xbbc4f960 script/script.c:65: free 0xbbc4f9c0 script/script.c:65: free 0xbbc4fa00 script/script.c:65: free 0xbbc4fa60 script/script.c:65: free 0xbbc4fac0 script/script.c:65: free 0xbbc4fba0 script/script.c:65: free 0xbbc4fc80 script/script.c:65: free 0xbbc4fce0 script/script.c:65: free 0xbbc4fd20 grub> date; loopback loop /debian-10.3.0-amd64-netinst.iso; date script/lexer.c:321: token 288 text [date] script/script.c:50: malloc 0xbbc4fb40 script/script.c:50: malloc 0xbbc4fb00 script/script.c:163: arglist script/script.c:50: malloc 0xbbc4faa0 script/lexer.c:321: token 265 text [;] script/script.c:50: malloc 0xbbc4fa40 script/script.c:50: malloc 0xbbc4fa00 script/script.c:198: cmdline script/script.c:50: malloc 0xbbc4f9a0 script/lexer.c:321: token 288 text [loopback] script/script.c:50: malloc 0xbbc4f940 script/script.c:50: malloc 0xbbc4f900 script/script.c:294: append command script/script.c:50: malloc 0xbbc4f8c0 script/script.c:163: arglist script/script.c:50: malloc 0xbbc4f860 script/lexer.c:321: token 288 text [loop] script/script.c:50: malloc 0xbbc4f800 script/script.c:50: malloc 0xbbc4f7c0 script/script.c:163: arglist script/script.c:50: malloc 0xbbc4f760 script/lexer.c:321: token 289 text [/debian-10.3.0-amd64-netinst.iso] script/script.c:50: malloc 0xbbc4f4c0 script/script.c:50: malloc 0xbbc4f460 script/script.c:163: arglist script/script.c:50: malloc 0xbbc4f400 script/lexer.c:321: token 265 text [;] script/script.c:50: malloc 0xbbc4f3a0 script/script.c:50: malloc 0xbbc4f360 script/script.c:198: cmdline script/script.c:50: malloc 0xbbc4f300 script/lexer.c:321: token 288 text [date] script/script.c:50: malloc 0xbbc4f2a0 script/script.c:50: malloc 0xbbc4f260 script/script.c:294: append command script/script.c:163: arglist script/script.c:50: malloc 0xbbc4f200 script/lexer.c:321: token 259 text [ ] script/script.c:50: malloc 0xbbc4f1a0 script/script.c:50: malloc 0xbbc4f160 script/script.c:198: cmdline script/script.c:50: malloc 0xbbc4f100 script/lexer.c:321: token 0 text [] script/script.c:50: malloc 0xbbc4fca0 script/script.c:50: malloc 0xbbc4fc60 script/script.c:294: append command kern/disk.c:196: Opening `hd0,gpt2'... disk/efi/efidisk.c:482: opening hd0 disk/efi/efidisk.c:511: m = 0xbef1d300, last block = 27f, block size = 200, io align = 8 disk/efi/efidisk.c:531: opening hd0 succeeded partmap/gpt.c:90: Read a valid GPT header partmap/gpt.c:112: GPT entry 0: start=2048, length=1048576 partmap/gpt.c:112: GPT entry 1: start=1050624, length=36704256 kern/fs.c:56: Detecting procfs... kern/fs.c:78: procfs detection failed. kern/fs.c:56: Detecting zfs... disk/efi/efidisk.c:593: reading 0x100 sectors at the sector 0x100900 from hd0 fs/zfs/zfs.c:1192: label ok 0 disk/efi/efidisk.c:593: reading 0x40 sectors at the sector 0x100800 from hd0 disk/efi/efidisk.c:593: reading 0xc0 sectors at the sector 0x100840 from hd0 disk/efi/efidisk.c:593: reading 0x100 sectors at the sector 0x100b00 from hd0 fs/zfs/zfs.c:1192: label ok 1 disk/efi/efidisk.c:593: reading 0x40 sectors at the sector 0x100a00 from hd0 disk/efi/efidisk.c:593: reading 0xc0 sectors at the sector 0x100a40 from hd0 disk/efi/efidisk.c:593: reading 0x100 sectors at the sector 0x2400500 from hd0 fs/zfs/zfs.c:1192: label ok 2 disk/efi/efidisk.c:593: reading 0x40 sectors at the sector 0x2400400 from hd0 disk/efi/efidisk.c:593: reading 0xc0 sectors at the sector 0x2400440 from hd0 disk/efi/efidisk.c:593: reading 0x100 sectors at the sector 0x2400700 from hd0 fs/zfs/zfs.c:1192: label ok 3 disk/efi/efidisk.c:593: reading 0x40 sectors at the sector 0x2400600 from hd0 disk/efi/efidisk.c:593: reading 0xc0 sectors at the sector 0x2400640 from hd0 kern/fs.c:78: zfs detection failed. kern/fs.c:56: Detecting xfs... fs/xfs.c:907: Reading sb fs/xfs.c:257: Validating superblock kern/fs.c:78: xfs detection failed. kern/fs.c:56: Detecting squash4... kern/fs.c:78: squash4 detection failed. kern/fs.c:56: Detecting ntfs... kern/fs.c:78: ntfs detection failed. kern/fs.c:56: Detecting jfs... kern/fs.c:78: jfs detection failed. kern/fs.c:56: Detecting iso9660... kern/fs.c:78: iso9660 detection failed. kern/fs.c:56:
Bug#959425: loopback command hangs in 2.04 under UEFI
I can confirm that running `rmmod tpm` is a workaround. After removing tpm, `loopback loop some.iso` works without hanging. Thank you Bernhard.
Bug#959425: loopback command hangs in 2.04 under UEFI
Dear Maintainer, I could reproduce this issue with these grub images inside a QEmu EFI enabled VM (no secureboot enabled). grub-efi-amd64-signed: /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed grub-efi-amd64-bin:/usr/lib/grub/x86_64-efi/monolithic/grubx64.efi Further tried to track it down by manually creating the image like it is done in grub2-2.04/debian/build-efi-images. At the end I had a not hanging image, where just the "tpm" module was left out. Kind regards, Bernhard 5956434be4b81e6376151b64ef9b1596 debian-10.3.0-amd64-netinst.iso loopback loop /debian-10.3.0-amd64-netinst.iso # # # Bullseye/testing amd64 qemu VM 2020-05-03 apt update apt dist-upgrade apt install efitools fakeroot mc apt build-dep grub2 mkdir /home/benutzer/source/grub2/orig -p cd/home/benutzer/source/grub2/orig apt source grub2 cd # # apt install grub-efi-amd64-signed Die folgenden NEUEN Pakete werden installiert: grub-efi-amd64-signed mokutil shim-helpers-amd64-signed shim-signed shim-signed-common shim-unsigned root@debian:~# dpkg -l | grep -i grub ii grub-common 2.04-7 amd64 GRand Unified Bootloader (common files) ii grub-efi-amd642.04-7 amd64 GRand Unified Bootloader, version 2 (EFI-AMD64 version) ii grub-efi-amd64-bin2.04-7 amd64 GRand Unified Bootloader, version 2 (EFI-AMD64 modules) ii grub-efi-amd64-signed 1+2.04+7 amd64 GRand Unified Bootloader, version 2 (amd64 UEFI signed by Debian) ii grub2-common 2.04-7 amd64 GRand Unified Bootloader (common files for version 2) root@debian:~# dpkg -L grub-efi-amd64-signed ... /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed ... root@debian:~# md5sum /boot/efi/EFI/debian/ BOOTX64.CSV fbx64.efigrub.cfg grubx64.efi mmx64.efishimx64.efi root@debian:~# md5sum /boot/efi/EFI/debian/grubx64.efi b9a9e8799558393ac6e50f111ff11719 /boot/efi/EFI/debian/grubx64.efi root@debian:~# file /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/debian/grubx64.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows root@debian:~# ls -lisah /boot/efi/EFI/debian/grubx64.efi 22 1,6M -rwx-- 1 root root 1,6M Mai 3 09:17 /boot/efi/EFI/debian/grubx64.efi root@debian:~# md5sum /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed b9a9e8799558393ac6e50f111ff11719 /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed root@debian:~# file /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows root@debian:~# ls -lisah /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed 919451 1,6M -rw-r--r-- 1 root root 1,6M Apr 22 15:52 /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed -> Hangs # dpkg --purge grub-efi-amd64-signed grub-install root@debian:~# md5sum /boot/efi/EFI/debian/grubx64.efi 5e1c77f5da51d2ed6500315f2d662bda /boot/efi/EFI/debian/grubx64.efi root@debian:~# dpkg -S grubx64 grub-efi-amd64-bin: /usr/lib/grub/x86_64-efi/monolithic/grubx64.efi root@debian:~# md5sum /usr/lib/grub/x86_64-efi/monolithic/grubx64.efi c440c1cb17c6f6442fa72bb256d191d1 /usr/lib/grub/x86_64-efi/monolithic/grubx64.efi root@debian:~# ls -lisah /boot/efi/EFI/debian/grubx64.efi /usr/lib/grub/x86_64-efi/monolithic/grubx64.efi 22 128K -rwx-- 1 root root 128K Mai 3 11:05 /boot/efi/EFI/debian/grubx64.efi 927732 1,6M -rw-r--r-- 1 root root 1,6M Apr 22 15:52 /usr/lib/grub/x86_64-efi/monolithic/grubx64.efi cp /usr/lib/grub/x86_64-efi/monolithic/grubx64.efi /boot/efi/EFI/debian/grubx64.efi -> Hangs # root@debian:~# grub-install x86_64-efi wird für Ihre Plattform installiert. installation beendet. Keine Fehler aufgetreten. root@debian:~# md5sum /boot/efi/EFI/debian/grubx64.efi 5e1c77f5da51d2ed6500315f2d662bda /boot/efi/EFI/debian/grubx64.efi -> Works # cp /usr/lib/grub/x86_64-efi/monolithic/grubx64.efi /boot/efi/EFI/debian/grubx64-backup.efi workdir=/tmp platform=x86_64-efi GRUB_MODULES="all_video boot btrfs cat chain configfile echo efifwsetup efinet ext2 fat font f2fs gettext gfxmenu gfxterm gfxterm_background gzio halt help hfsplus iso9660 jfs jpeg keystatus loadenv loopback linux ls lsefi lsefimmap lsefisystab lssal memdisk minicmd normal ntfs part_apple part_msdos part_gpt password_pbkdf2 png probe reboot regexp search search_fs_uuid search_fs_file search_label sleep squash4 test true video xfs zfs zfscrypt zfsinfo cpuid linuxefi play tpm cryptodisk gcry_arcfour gcry_blowfish gcry_camellia gcry_cast5 gcry_crc gcry_des gcry_dsa gcry_idea gcry_md4 gcry_md5 gcry_rfc2268 gcry_rijndael gcry_rmd160 gcry_rsa gcry_seed gcry_serpent gcry_sha1 gcry_sha256 gcry_sha512 gcry_tiger gcry_twofish
Bug#959425: loopback command hangs in 2.04 under UEFI
Source: grub2 Version: 2.04-7 Severity: important Hi, if I boot with grubx64.efi and run the following command: loopback loop some.iso ...it hangs in 2.04 under UEFI, while it worked fine up to 2.02. This affects Debian and Ubuntu, but not Fedora. BIOS mode isn't affected. I tested with grubx64.efi from the following packages: BAD: http://ftp.us.debian.org/debian/pool/main/g/grub2/grub-efi-amd64-bin_2.04-7_amd64.deb BAD: https://launchpad.net/ubuntu/+source/grub2-signed/1.117/+build/17277557/+files/grub-efi-amd64-signed_1.117+2.04-1ubuntu1_amd64.deb GOOD: https://launchpad.net/ubuntu/+source/grub2-signed/1.116/+build/17166212/+files/grub-efi-amd64-signed_1.116+2.02+dfsg1-12ubuntu3_amd64.deb GOOD: https://kojipkgs.fedoraproject.org//packages/grub2/2.04/15.fc33/x86_64/grub2-efi-x64-2.04-15.fc33.x86_64.rpm Related Ubuntu bug report: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1851311 Thank you.