bugGNU GRUB - Bugs: bug #66827, `grub-mount' hang with 100% CPU...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #66827: `grub-mount' hang with 100% CPU usage on `ls' operations with wildcards

Submitter:  Mingcong Bai <mingcongbai>
Submitted:  Fri 21 Feb 2025 04:00:26 PM UTC
   
 
Category:  Filesystem Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Release:  other
Release:  Reproducibility:  Every Time
Planned Release:  None

Fri 21 Feb 2025 04:00:26 PM UTC, original submission:  

(GRUB 2.12)

---

If a system partition was mounted via grub-mount, whenever any script or user calls a `ls' command with wildcards, the command would never complete.

For instance, if /dev/nvme0n1p6 was mounted at /mnt via `grub-mount /dev/nvme0n1p6 /mnt' and if someone calls `ls /mnt/bin/bash*', the command would hang. With `ls /mnt/bin/bash[Tab]`, the same hang would occur. At this point, neither ^C or ^Z would be able to interrupt/suspend that command, only a SIGKILL on the `grub-mount' process would terminate the command.

However, with any `ls' command that does not involve a wildcard, say, `ls /mnt/bin/bash', the aforementioned issue would not occur.

---

Incidentally (and how I found out about this issue), in os-prober's 90linux-distro scriptlet, the `if' condition tests for certain ld.so patterns with wildcards:

  /usr/lib/os-probes/mounted/90linux-distro:

  if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then
      ...

A user indicated that their `update-grub' invocations would hang at the os-prober stage. With some script debugging I was able to locate this issue.

As such, this will cause os-prober to hang as it probes Linux system roots.

Mingcong Bai <mingcongbai>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mingcongbai (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code