fwupd / fwupd

A system daemon to allow session software to update firmware
GNU Lesser General Public License v2.1
2.91k stars 436 forks source link

fwupd follows infinite symlink cycles until memory full or error. #5258

Closed keskival closed 1 year ago

keskival commented 1 year ago

Describe the bug

Cannot run fwupdmgr update successfully, because fwupd process gets into an almost infinite loop going through symbolic links in /var and /proc directories.

See the stored error output of fwupdmgr get-devices here:

Devices that were not updated correctly:

 • UEFI dbx (78 → 217)

Uploading firmware reports helps hardware vendors to quickly identify failing and successful updates on real devices.
Upload report now? (Requires internet connection) [Y|n]:
Y
Target:                  https://fwupd.org/lvfs/firmware/report
Payload:                 {
                           "ReportVersion" : 2,
                           "MachineId" : "c6ae2e9be984534b5e3c515d9bc17046bf8b7bdbf3a7f05725ec39c1ae4453e4",
                           "Metadata" : {
                             "DistroId" : "ubuntu",
                             "DistroVersion" : "22.04"
                           },
                           "Reports" : [
                             {
                               "Checksum" : "ef237384c9099e0a7724e0769ae3887d3e11ca81",
                               "ReleaseId" : null,
                               "UpdateState" : 3,
                               "UpdateError" : "Blocked executable in the ESP, ensure grub and shim are up to date: Error opening directory “/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/proc/self/task/2555/fd/16/sys/kernel/debug/tracing”: Too many levels of symbolic links",
                               "Guid" : [
                                 "fda6234b-adcb-5105-8515-9af647d29775"
                               ],
                               "Plugin" : "uefi_dbx",
                               "VersionOld" : "78",
                               "VersionNew" : "217",
                               "Flags" : 4194595,
                               "Created" : 1668362835,
                               "Modified" : 1668363660,
                               "Metadata" : {
                                 "HostSku" : "All",
                                 "DistroVersion" : "22.04",
                                 "RuntimeVersion(org.freedesktop.gusb)" : "0.3.10",
                                 "FwupdSupported" : "True",
                                 "CompileVersion(org.freedesktop.fwupd)" : "1.7.9",
                                 "SecureBoot" : "Disabled",
                                 "HostFamily" : "ASUS MB",
                                 "UEFIUXCapsule" : "Disabled",
                                 "KernelName" : "Linux",
                                 "RuntimeVersion(org.kernel)" : "5.15.0-52-generic",
                                 "CompileVersion(com.hughsie.libjcat)" : "0.1.9",
                                 "RuntimeVersion(com.dell.libsmbios)" : "2.4",
                                 "CompileVersion(org.freedesktop.gusb)" : "0.3.10",
                                 "DistroId" : "ubuntu",
                                 "CpuArchitecture" : "x86_64",
                                 "BootTime" : "1668362739",
                                 "HostVendor" : "ASUS",
                                 "EfivarNvramUsed" : "30235",
                                 "HostProduct" : "All Series",
                                 "FwupdTainted" : "False",
                                 "RuntimeVersion(org.freedesktop.fwupd)" : "1.7.9",
                                 "KernelVersion" : "5.15.0-52-generic"
                               }
                             }
                           ]
                         }

I also got a similar error previously from /var directory which I fixed by removing the offending symlink.

Steps to Reproduce

I am not sure why I have symlink cycles in my /sys, but I have, and then trying to update UEFI with fwupdmgr update and saying Y hangs at this point, and sometimes gives an error, sometimes hangs up the machine if the memory gets full even with the safety check disabled:

root@Curie:/# fwupdmgr --no-safety-check update
Devices with no available firmware updates: 
 • ST4000DM004-2CV104
 • SV300S37A120G
 • System Firmware
Downloading…             [***************************************]
Downloading…             [***************************************]
Decompressing…           [***************************************]
Decompressing…           [***************************************]
Authenticating…          [***************************************]
Authenticating…          [***************************************]
Restarting device…       [***************************************]
Writing…                 [***************************************]
Decompressing…           [***************************************]

Expected behavior

A successful firmware update.

fwupd version information Please provide the version of the daemon and client.

root@Curie:/# fwupdmgr --version
runtime   org.freedesktop.fwupd         1.7.9
runtime   com.dell.libsmbios            2.4
compile   org.freedesktop.gusb          0.3.10
runtime   org.kernel                    5.15.0-52-generic
compile   com.hughsie.libjcat           0.1.9
compile   org.freedesktop.fwupd         1.7.9
runtime   org.freedesktop.gusb          0.3.10

Please note how you installed it (apt, dnf, pacman, source, etc):

apt

**fwupd device information**

Please provide the output of the fwupd devices recognized in your system.

root@Curie:/# fwupdmgr get-devices --show-all-devices
All Series
│
├─Core™ i5-4690 CPU @ 3.50GHz:
│     Device ID:          4bde70ba4e39b28f9eab1628f9dd6e6244c03027
│     Current version:    0x00000028
│     Vendor:             Intel
│     GUIDs:              b9a2dd81-159e-5537-a7db-e7101d164d3f ← cpu
│                         30249f37-d140-5d3e-9319-186b1bd5cac3 ← CPUID\PRO_0&FAM_06
│                         dd2cdaeb-2b08-599d-aaec-5a8374add8d6 ← CPUID\PRO_0&FAM_06&MOD_3C
│                         112c1ba3-2c29-5ab2-bd72-ea65bd10dd67 ← CPUID\PRO_0&FAM_06&MOD_3C&STP_3
│     Device Flags:       • Internal device
│   
├─DRW-24F1MT:
│     Device ID:          f219ac034743df43be49a235e41f128dd47d855f
│     Summary:            SCSI device
│     Current version:    1.00
│     Vendor:             ASUS (SCSI:ASUS)
│     GUIDs:              e10548bc-82ea-54bb-93ca-3b31fedc9434 ← SCSI\VEN_ASUS&DEV_DRW-24F1MT&REV_1.00
│                         b1e2d596-3226-5bf1-aeb5-4b64633a9ef7 ← SCSI\VEN_ASUS&DEV_DRW-24F1MT
│   
├─GM204 [GeForce GTX 970]:
│     Device ID:          ce4c74a5188d5b9cdb1e72ed32dad2d313c1c999
│     Current version:    a1
│     Vendor:             NVIDIA Corporation (PCI:0x10DE)
│     GUIDs:              e66c10dd-50e8-5111-9cd0-38dde28ec280 ← PCI\VEN_10DE&DEV_13C2&SUBSYS_14623160&REV_A1
│                         31d3c2a7-6b65-5afb-a495-fac80ead224d ← PCI\VEN_10DE&DEV_13C2&SUBSYS_14623160
│                         c32e752c-53d9-53dd-a7ab-f7b9a72e9b7d ← PCI\VEN_10DE&DEV_13C2&REV_A1
│                         e6857de4-0602-5690-90d1-df576c354a9b ← PCI\VEN_10DE&DEV_13C2
│     Device Flags:       • Internal device
│                         • Cryptographic hash verification is available
│   
├─ST4000DM004-2CV104:
│     Device ID:          0a8c36d4c09c803cd6b5861e443fb7a41a20cbe6
│     Summary:            ATA drive
│     Current version:    0001
│     Vendor:             Seagate (ATA:0x1BB1, OUI:000c50)
│     Serial Number:      ZTT1VEYW
│     GUIDs:              cbbc9f2c-ceae-52da-8c30-5873a0229fdd ← IDE\ST4000DM004-2CV104______________________0001
│                         a0d04afd-14d4-58d3-8f22-3a82777f1dad ← IDE\0ST4000DM004-2CV104______________________
│                         260e3820-44e9-5a3f-8d20-82acec2aa0a1 ← ST4000DM004-2CV104
│     Device Flags:       • Internal device
│                         • Updatable
│                         • System requires external power source
│                         • Needs a reboot after installation
│                         • Device is usable for the duration of the update
│   
├─SV300S37A120G:
│     Device ID:          602b0a6cc821d155208724f0e22f8d111542b74c
│     Summary:            ATA drive
│     Current version:    605ABBF2
│     Vendor:             Kingston (ATA:0x2646, OUI:0026b7)
│     Serial Number:      50026B775C01D7B0
│     GUIDs:              6edd4726-3f3f-57f4-8cc7-7d0c3ec4ff67 ← IDE\KINGSTON_SV300S37A120G__________________605ABBF2
│                         8512c90c-53c6-575d-a637-72c2490f902d ← IDE\0KINGSTON_SV300S37A120G__________________
│                         05ce8e85-28d3-53ee-b0c8-41c139e1d8a8 ← KINGSTON SV300S37A120G
│     Device Flags:       • Internal device
│                         • Updatable
│                         • System requires external power source
│                         • Needs a reboot after installation
│                         • Needs shutdown after installation
│                         • Device is usable for the duration of the update
│   
└─System Firmware:
  │   Device ID:          a45df35ac0e948ee180fe216a5f703f32dda163f
  │   Summary:            UEFI ESRT device
  │   Current version:    11
  │   Minimum Version:    11
  │   Vendor:             ASUS (DMI:American Megatrends Inc.)
  │   Update State:       Success
  │   GUIDs:              7039436b-6acf-433b-86a1-368ec2ef7e1f
  │                       230c8b18-8d9b-53ec-838b-6cfc0383493a ← main-system-firmware
  │   Device Flags:       • Internal device
  │                       • Updatable
  │                       • System requires external power source
  │                       • Needs a reboot after installation
  │                       • Device is usable for the duration of the update
  │ 
  └─UEFI dbx:
        Device ID:        362301da643102b9f38477387e2193e57abaa590
        Summary:          UEFI revocation database
        Current version:  78
        Minimum Version:  78
        Vendor:           UEFI:Linux Foundation
        Install Duration: 1 second
        GUIDs:            fda6234b-adcb-5105-8515-9af647d29775 ← UEFI\CRT_D7F66BE77CEF858C174BF4338A99263C8795B74E02026411F5F532F716AE3263
                          f8ff0d50-c757-5dc3-951a-39d86e16f419 ← UEFI\CRT_D7F66BE77CEF858C174BF4338A99263C8795B74E02026411F5F532F716AE3263&ARCH_X64
                          c6682ade-b5ec-57c4-b687-676351208742 ← UEFI\CRT_A1117F516A32CEFCBA3F2D1ACE10A87972FD6BBE8FE0D0B996E09E65D802A503
                          f8ba2887-9411-5c36-9cee-88995bb39731 ← UEFI\CRT_A1117F516A32CEFCBA3F2D1ACE10A87972FD6BBE8FE0D0B996E09E65D802A503&ARCH_X64
                          7d5759e5-9aa0-5f0c-abd6-7439bb11b9f6 ← UEFI\CRT_ED1FE72CB9CA31C9AF5B757AFCD733323D675825032E6CED7FE1AE9EB767998C
                          0c7691e1-b6f2-5d71-bc9c-aabee364c916 ← UEFI\CRT_ED1FE72CB9CA31C9AF5B757AFCD733323D675825032E6CED7FE1AE9EB767998C&ARCH_X64
        Device Flags:     • Internal device
                          • Updatable
                          • Supported on remote server
                          • Needs a reboot after installation
                          • Only version upgrades are allowed
                          • Signed Payload

System UEFI configuration Please provide the output of the following commands:

root@Curie:/# efibootmgr -v
BootCurrent: 0000
Timeout: 2 seconds
BootOrder: 0000,0004,0006,0007,0001,0002
Boot0000* ubuntu    HD(2,GPT,4d7404c7-b70a-491b-ab87-28d82fd00d48,0x800,0x39e000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0001* Hard Drive    BBS(HD,,0x0)..GO..NO........O.S.T.4.0.0.0.D.M.0.0.4.-.2.C.V.1.0.4.................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .T.Z.1.T.E.V.W.Y........BO..NO........O.K.I.N.G.S.T.O.N. .S.V.3.0.0.S.3.7.A.1.2.0.G.................>..Gd-.;.A..MQ..L.0.5.2.0.B.6.7.7.C.5.1.0.7.D.0.B. . . . ........BO
Boot0002* CD/DVD Drive  BBS(CDROM,,0x0)..GO..NO........O.A.S.U.S. . . . . .D.R.W.-.2.4.F.1.M.T.................>..Gd-.;.A..MQ..L.1.S.R.A.Y.6.G.A.0.9.1.0.A.1. . . . . . ........BO
Boot0004* UEFI OS   PciRoot(0x0)/Pci(0x1f,0x2)/Sata(1,65535,0)/HD(2,GPT,4d7404c7-b70a-491b-ab87-28d82fd00d48,0x800,0x39e000)..BO
Boot0006* UEFI OS   HD(2,GPT,4d7404c7-b70a-491b-ab87-28d82fd00d48,0x800,0x39e000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
Boot0007* ubuntu    HD(2,GPT,4d7404c7-b70a-491b-ab87-28d82fd00d48,0x800,0x39e000)/File(\EFI\UBUNTU\GRUBX64.EFI)..BO
root@Curie:/# efivar -l | grep fw
root@Curie:/# 
root@Curie:/# tree /boot
/boot
├── config-5.13.0-28-generic
├── config-5.15.0-50-generic
├── config-5.15.0-52-generic
├── efi
│   └── EFI
│       ├── BOOT
│       │   ├── BOOTX64.EFI
│       │   ├── fbx64.efi
│       │   └── mmx64.efi
│       └── ubuntu
│           ├── BOOTX64.CSV
│           ├── grub.cfg
│           ├── grubx64.efi
│           ├── mmx64.efi
│           └── shimx64.efi
├── grub
│   ├── fonts
│   │   └── unicode.pf2
│   ├── gfxblacklist.txt
│   ├── grub.cfg
│   ├── grubenv
│   ├── i386-pc
│   ├── locale
│   │   ├── en_AU.mo
│   │   ├── en_CA.mo
│   │   ├── en_GB.mo
│   │   └── en@quot.mo
│   ├── unicode.pf2
│   └── x86_64-efi
│       ├── acpi.mod
│       ├── adler32.mod
│       ├── affs.mod
│       ├── afs.mod
│       ├── afsplitter.mod
│       ├── ahci.mod
│       ├── all_video.mod
│       ├── aout.mod
│       ├── appleldr.mod
│       ├── archelp.mod
│       ├── ata.mod
│       ├── at_keyboard.mod
│       ├── backtrace.mod
│       ├── bfs.mod
│       ├── bitmap.mod
│       ├── bitmap_scale.mod
│       ├── blocklist.mod
│       ├── boot.mod
│       ├── bsd.mod
│       ├── bswap_test.mod
│       ├── btrfs.mod
│       ├── bufio.mod
│       ├── cat.mod
│       ├── cbfs.mod
│       ├── cbls.mod
│       ├── cbmemc.mod
│       ├── cbtable.mod
│       ├── cbtime.mod
│       ├── chain.mod
│       ├── cmdline_cat_test.mod
│       ├── cmp.mod
│       ├── cmp_test.mod
│       ├── command.lst
│       ├── configfile.mod
│       ├── core.efi
│       ├── cpio_be.mod
│       ├── cpio.mod
│       ├── cpuid.mod
│       ├── crc64.mod
│       ├── cryptodisk.mod
│       ├── crypto.lst
│       ├── crypto.mod
│       ├── cs5536.mod
│       ├── ctz_test.mod
│       ├── datehook.mod
│       ├── date.mod
│       ├── datetime.mod
│       ├── diskfilter.mod
│       ├── disk.mod
│       ├── div.mod
│       ├── div_test.mod
│       ├── dm_nv.mod
│       ├── echo.mod
│       ├── efifwsetup.mod
│       ├── efi_gop.mod
│       ├── efinet.mod
│       ├── efi_uga.mod
│       ├── ehci.mod
│       ├── elf.mod
│       ├── eval.mod
│       ├── exfat.mod
│       ├── exfctest.mod
│       ├── ext2.mod
│       ├── extcmd.mod
│       ├── f2fs.mod
│       ├── fat.mod
│       ├── file.mod
│       ├── fixvideo.mod
│       ├── font.mod
│       ├── fshelp.mod
│       ├── fs.lst
│       ├── functional_test.mod
│       ├── gcry_arcfour.mod
│       ├── gcry_blowfish.mod
│       ├── gcry_camellia.mod
│       ├── gcry_cast5.mod
│       ├── gcry_crc.mod
│       ├── gcry_des.mod
│       ├── gcry_dsa.mod
│       ├── gcry_idea.mod
│       ├── gcry_md4.mod
│       ├── gcry_md5.mod
│       ├── gcry_rfc2268.mod
│       ├── gcry_rijndael.mod
│       ├── gcry_rmd160.mod
│       ├── gcry_rsa.mod
│       ├── gcry_seed.mod
│       ├── gcry_serpent.mod
│       ├── gcry_sha1.mod
│       ├── gcry_sha256.mod
│       ├── gcry_sha512.mod
│       ├── gcry_tiger.mod
│       ├── gcry_twofish.mod
│       ├── gcry_whirlpool.mod
│       ├── geli.mod
│       ├── gettext.mod
│       ├── gfxmenu.mod
│       ├── gfxterm_background.mod
│       ├── gfxterm_menu.mod
│       ├── gfxterm.mod
│       ├── gptsync.mod
│       ├── grub.efi
│       ├── gzio.mod
│       ├── halt.mod
│       ├── hashsum.mod
│       ├── hdparm.mod
│       ├── hello.mod
│       ├── help.mod
│       ├── hexdump.mod
│       ├── hfs.mod
│       ├── hfspluscomp.mod
│       ├── hfsplus.mod
│       ├── http.mod
│       ├── iorw.mod
│       ├── iso9660.mod
│       ├── jfs.mod
│       ├── jpeg.mod
│       ├── json.mod
│       ├── keylayouts.mod
│       ├── keystatus.mod
│       ├── ldm.mod
│       ├── legacycfg.mod
│       ├── legacy_password_test.mod
│       ├── linux16.mod
│       ├── linuxefi.mod
│       ├── linux.mod
│       ├── loadbios.mod
│       ├── load.cfg
│       ├── loadenv.mod
│       ├── loopback.mod
│       ├── lsacpi.mod
│       ├── lsefimmap.mod
│       ├── lsefi.mod
│       ├── lsefisystab.mod
│       ├── lsmmap.mod
│       ├── ls.mod
│       ├── lspci.mod
│       ├── lssal.mod
│       ├── luks2.mod
│       ├── luks.mod
│       ├── lvm.mod
│       ├── lzopio.mod
│       ├── macbless.mod
│       ├── macho.mod
│       ├── mdraid09_be.mod
│       ├── mdraid09.mod
│       ├── mdraid1x.mod
│       ├── memdisk.mod
│       ├── memrw.mod
│       ├── minicmd.mod
│       ├── minix2_be.mod
│       ├── minix2.mod
│       ├── minix3_be.mod
│       ├── minix3.mod
│       ├── minix_be.mod
│       ├── minix.mod
│       ├── mmap.mod
│       ├── moddep.lst
│       ├── modinfo.sh
│       ├── morse.mod
│       ├── mpi.mod
│       ├── msdospart.mod
│       ├── mul_test.mod
│       ├── multiboot2.mod
│       ├── multiboot.mod
│       ├── nativedisk.mod
│       ├── net.mod
│       ├── newc.mod
│       ├── nilfs2.mod
│       ├── normal.mod
│       ├── ntfscomp.mod
│       ├── ntfs.mod
│       ├── odc.mod
│       ├── offsetio.mod
│       ├── ohci.mod
│       ├── part_acorn.mod
│       ├── part_amiga.mod
│       ├── part_apple.mod
│       ├── part_bsd.mod
│       ├── part_dfly.mod
│       ├── part_dvh.mod
│       ├── part_gpt.mod
│       ├── partmap.lst
│       ├── part_msdos.mod
│       ├── part_plan.mod
│       ├── part_sun.mod
│       ├── part_sunpc.mod
│       ├── parttool.lst
│       ├── parttool.mod
│       ├── password.mod
│       ├── password_pbkdf2.mod
│       ├── pata.mod
│       ├── pbkdf2.mod
│       ├── pbkdf2_test.mod
│       ├── pcidump.mod
│       ├── pgp.mod
│       ├── play.mod
│       ├── png.mod
│       ├── priority_queue.mod
│       ├── probe.mod
│       ├── procfs.mod
│       ├── progress.mod
│       ├── raid5rec.mod
│       ├── raid6rec.mod
│       ├── random.mod
│       ├── rdmsr.mod
│       ├── read.mod
│       ├── reboot.mod
│       ├── regexp.mod
│       ├── reiserfs.mod
│       ├── relocator.mod
│       ├── romfs.mod
│       ├── scsi.mod
│       ├── search_fs_file.mod
│       ├── search_fs_uuid.mod
│       ├── search_label.mod
│       ├── search.mod
│       ├── serial.mod
│       ├── setjmp.mod
│       ├── setjmp_test.mod
│       ├── setpci.mod
│       ├── sfs.mod
│       ├── shift_test.mod
│       ├── signature_test.mod
│       ├── sleep.mod
│       ├── sleep_test.mod
│       ├── smbios.mod
│       ├── spkmodem.mod
│       ├── squash4.mod
│       ├── strtoull_test.mod
│       ├── syslinuxcfg.mod
│       ├── tar.mod
│       ├── terminal.lst
│       ├── terminal.mod
│       ├── terminfo.mod
│       ├── test_blockarg.mod
│       ├── testload.mod
│       ├── test.mod
│       ├── testspeed.mod
│       ├── tftp.mod
│       ├── tga.mod
│       ├── time.mod
│       ├── tpm.mod
│       ├── trig.mod
│       ├── tr.mod
│       ├── true.mod
│       ├── udf.mod
│       ├── ufs1_be.mod
│       ├── ufs1.mod
│       ├── ufs2.mod
│       ├── uhci.mod
│       ├── usb_keyboard.mod
│       ├── usb.mod
│       ├── usbms.mod
│       ├── usbserial_common.mod
│       ├── usbserial_ftdi.mod
│       ├── usbserial_pl2303.mod
│       ├── usbserial_usbdebug.mod
│       ├── usbtest.mod
│       ├── video_bochs.mod
│       ├── video_cirrus.mod
│       ├── video_colors.mod
│       ├── video_fb.mod
│       ├── videoinfo.mod
│       ├── video.lst
│       ├── video.mod
│       ├── videotest_checksum.mod
│       ├── videotest.mod
│       ├── wrmsr.mod
│       ├── xfs.mod
│       ├── xnu.mod
│       ├── xnu_uuid.mod
│       ├── xnu_uuid_test.mod
│       ├── xzio.mod
│       ├── zfscrypt.mod
│       ├── zfsinfo.mod
│       ├── zfs.mod
│       └── zstd.mod
├── initrd.img -> initrd.img-5.15.0-52-generic
├── initrd.img-5.13.0-28-generic
├── initrd.img-5.15.0-50-generic
├── initrd.img-5.15.0-52-generic
├── initrd.img.old -> initrd.img-5.15.0-50-generic
├── lost+found
├── memtest86+.bin
├── memtest86+.elf
├── memtest86+_multiboot.bin
├── System.map-5.13.0-28-generic
├── System.map-5.15.0-50-generic
├── System.map-5.15.0-52-generic
├── vmlinuz -> vmlinuz-5.15.0-52-generic
├── vmlinuz-5.13.0-28-generic
├── vmlinuz-5.15.0-50-generic
├── vmlinuz-5.15.0-52-generic
└── vmlinuz.old -> vmlinuz-5.15.0-50-generic

10 directories, 314 files

Additional questions

superm1 commented 1 year ago

Something like this happened recently in another bug report. By chance is your ESP not marked as an ESP?

hughsie commented 1 year ago

We fixed this in 1.8.7 last week.

superm1 commented 1 year ago

Right it's probably a duplicate of #5211. If it's the same root cause they could at least work around it until they upgrade.