Skip to content

Addressed multiple grub2 CVEs #14017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.0-dev
Choose a base branch
from

Conversation

kgodara912
Copy link
Contributor

@kgodara912 kgodara912 commented Jun 17, 2025

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

Addressing Grub2 multiple CVEs

Change Log
Does this affect the toolchain?

YES/NO

Associated issues
  • #xxxx
Links to CVEs
Test Methodology

@microsoft-github-policy-service microsoft-github-policy-service bot added Packaging 3.0-dev PRs Destined for AzureLinux 3.0 labels Jun 17, 2025
@kgodara912 kgodara912 force-pushed the kgodara/3.0-dev/grub2/CVEs branch from 3d62362 to f0bc161 Compare June 17, 2025 04:14
@kgodara912 kgodara912 marked this pull request as ready for review June 18, 2025 15:13
@kgodara912 kgodara912 requested a review from a team as a code owner June 18, 2025 15:13
@kgodara912 kgodara912 requested review from Copilot and a team June 18, 2025 15:15
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a large collection of GRUB2 security vulnerabilities by bumping the package release and integrating numerous upstream CVE patches.

  • Bumped the Release number from 24 to 25 and updated the changelog entries
  • Added bulk CVE patch entries to the main spec and corresponding .patch files
  • Aligned the EFI binary–signed spec’s release with the main GRUB2 release

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

File Description
SPECS/grub2/grub2.spec Bumped release and registered multiple CVE patches
SPECS-SIGNED/grub2-efi-binary-signed/*.spec Bumped release in signed EFI spec
SPECS/grub2/*.patch Added and updated numerous CVE fix patches
Comments suppressed due to low confidence (2)

SPECS/grub2/CVE-2019-13627.patch:32

  • The type MPI is not defined in this context; it should likely be gcry_mpi_t to match the existing code base and avoid compilation errors.
   /* Select a random k with 0 < k < q */

SPECS/grub2/CVE-2024-45781.patch:21

  • [nitpick] The variable sz is not shown in this snippet; ensure that it correctly represents the destination buffer size to avoid truncation issues or buffer overflows. Consider using a more descriptive name or an explicit constant.
+    grub_strlcpy (symlink, (char *) data->inode.symlink, sz);

+ grub_error (GRUB_ERR_OUT_OF_RANGE, N_("overflow is detected"));
+ return NULL;
+ }
+ tmp = grub_realloc (line, alloc_size);
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

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

After realloc, the returned pointer is assigned to tmp but not to line. This can lead to use-after-free or memory corruption. You should add line = tmp; before continuing.

Suggested change
+ tmp = grub_realloc (line, alloc_size);
+ tmp = grub_realloc (line, alloc_size);
+ line = tmp;

Copilot uses AI. Check for mistakes.

Patch: CVE-2024-45781.patch
Patch: CVE-2024-45775.patch
Patch: CVE-2025-1118.patch
Patch: CVE-2025-0677_CVE-2025-0684_CVE-2025-0685_CVE-2025-0686_CVE-2025-0689.patch
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

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

[nitpick] This concatenated patch filename groups five CVEs together, which can make tracing and backporting harder. Consider splitting it into individual patch files or grouping by year for better readability.

Suggested change
Patch: CVE-2025-0677_CVE-2025-0684_CVE-2025-0685_CVE-2025-0686_CVE-2025-0689.patch
Patch: CVE-2025-0677.patch
Patch: CVE-2025-0684.patch
Patch: CVE-2025-0685.patch
Patch: CVE-2025-0686.patch
Patch: CVE-2025-0689.patch

Copilot uses AI. Check for mistakes.

@kgodara912
Copy link
Contributor Author

@microsoft/cbl-mariner-bootloader, please do let me know any specific testing I need to do for grub2 package? Will a full build do the needful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0-dev PRs Destined for AzureLinux 3.0 Packaging security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant