Skip to content

fix(grub2): disable os-prober by default#17741

Open
vinceaperri wants to merge 1 commit into
4.0from
user/vinceaperri/grub2-disable-os-prober-v2
Open

fix(grub2): disable os-prober by default#17741
vinceaperri wants to merge 1 commit into
4.0from
user/vinceaperri/grub2-disable-os-prober-v2

Conversation

@vinceaperri

@vinceaperri vinceaperri commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Restore upstream GRUB's secure, correct os-prober behaviour. The two key changes:

  1. os-prober is disabled by default. Automatic, silent execution of os-prober (and creating boot entries from its output) is a known attack vector, so it must not run unless an admin explicitly opts in.
  2. A user-facing typo is fixed (It's outputIts output) in the os-prober warning message.

Fedora ships three downstream reverts — Patch0001, Patch0002, and Patch0003 — that undo upstream's os-prober work (re-enabling it by default and re-introducing the typo). This change re-applies the upstream behaviour.

Approach

Rather than dropping the Fedora reverts (which shifts patch line numbers and breaks the context of later patches in the 382-patch series — exactly the failure that caused the previous attempt, #17375, to be reverted by f526821), this PR appends three trailing patches that are exact git reverts of the Fedora reverts:

Patch Reverts Effect
Patch0383 Fedora Patch0003 (Revert "templates: Disable the os-prober by default") Restores secure docs + 30_os-prober gate (xtrue)
Patch0384 Fedora Patch0002 (Revert "templates: Properly disable the os-prober by default") Restores GRUB_DISABLE_OS_PROBER="true" default in grub-mkconfig
Patch0385 Fedora Patch0001 (Revert "templates: Fix user-facing typo with an incorrect use of "it's"") Restores the correct possessive Its output in the os-prober warning

Implemented as overlays in base/comps/grub2/grub2.comp.toml (three file-add + one file-search-replace appending Patch0383/Patch0384/Patch0385 to the end of grub.patches). Because they apply last, all 382 prior patches keep their context and the build does not break.

Copilot AI review requested due to automatic review settings June 16, 2026 19:28
@vinceaperri vinceaperri requested a review from a team as a code owner June 16, 2026 19:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restore upstream GRUB behavior around os-prober by re-disabling it by default (secure default) and re-applying an upstream doc/message typo fix, without disturbing Fedora’s existing 382-patch series ordering (by appending trailing “revert of revert” patches).

Changes:

  • Add three trailing patch files (0383–0385) that revert Fedora’s downstream reverts of upstream os-prober work.
  • Update the grub2 component overlays to stage the new patch files and append Patch0383/Patch0384/Patch0385 entries to grub.patches.
  • Refresh locks/grub2.lock input fingerprint to reflect the component input changes.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
locks/grub2.lock Updates lock input fingerprint after component overlay changes.
base/comps/grub2/grub2.comp.toml Adds overlays to stage new patch files and extend the grub.patches patch series.
base/comps/grub2/0383-Revert-Revert-templates-Disable-the-os-prober-by-default.patch Re-applies upstream docs + 30_os-prober gating behavior as a trailing patch.
base/comps/grub2/0384-Revert-Revert-templates-Properly-disable-the-os-prober-by-d.patch Restores GRUB_DISABLE_OS_PROBER="true" default and related logic as a trailing patch.
base/comps/grub2/0385-Revert-Revert-templates-Fix-user-facing-typo-with-an.patch Restores the “Its output” warning message typo fix as a trailing patch.

Comment thread base/comps/grub2/grub2.comp.toml
Comment thread base/comps/grub2/grub2.comp.toml
Comment thread base/comps/grub2/grub2.comp.toml
@vinceaperri vinceaperri force-pushed the user/vinceaperri/grub2-disable-os-prober-v2 branch 2 times, most recently from 12ac6bd to d314244 Compare June 16, 2026 22:24
@vinceaperri vinceaperri changed the title Disable os-prober by default in grub2 fix(grub2): disable os-prober by default Jun 16, 2026
@vinceaperri vinceaperri force-pushed the user/vinceaperri/grub2-disable-os-prober-v2 branch 8 times, most recently from 31729f7 to 5b2ae9c Compare June 16, 2026 23:53
Azure Linux's grub2 is sourced from Fedora dist-git and customized via
azldev comp.toml overlays. Fedora ships three downstream reverts
(Patch0001, Patch0002, Patch0003) that undo upstream GRUB's os-prober
work: they re-enable os-prober by default and re-introduce a user-facing
typo. Automatic, silent execution of os-prober (and creating boot
entries from its output) is a known attack vector, so restore upstream's
secure, correct behaviour.

Append three trailing patches to the grub.patches series, each an exact
git revert of the corresponding Fedora revert:

  Patch0383  reverts Fedora Patch0003 -> os-prober disabled by default
             (30_os-prober gated on "xtrue")
  Patch0384  reverts Fedora Patch0002 -> restores
             GRUB_DISABLE_OS_PROBER="true" in grub-mkconfig
  Patch0385  reverts Fedora Patch0001 -> restores the correct possessive
             "Its output" in the os-prober warning message

Appending at the end (rather than dropping the Fedora reverts) keeps the
context of all 382 prior patches intact, avoiding the apply failure that
caused the previous attempt (#17375) to be reverted by f526821.
grub2's patch series lives in the %include'd grub.patches file, so the
patches are staged with file-add overlays and their Patch0383/0384/0385
entries appended to grub.patches via file-search-replace.
@vinceaperri vinceaperri force-pushed the user/vinceaperri/grub2-disable-os-prober-v2 branch from 5b2ae9c to 6156330 Compare June 17, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants