Skip to content
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

patch rust to fix CVE-2024-43806 #11217

Merged

Conversation

tobiasb-ms
Copy link
Contributor

@tobiasb-ms tobiasb-ms commented Nov 25, 2024

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

Patch rust CVE-2024-43806

This was complicated by the fact that rust uses multiple versions of rustix, so we need to patch it multiple times. We also need to update the checksums for the files in the vendored codebase. Here's an example of the vendored code after an rpmbuld -bp:

root [ /usr/src/mariner/BUILD/rustc-1.72.0-src ]# lsa -d vendor/rustix*
drwxr-xr-x 4 root root 4.0K Nov 25 20:09 vendor/rustix/
drwxr-xr-x 4 root root 4.0K Nov 25 20:09 vendor/rustix-0.37.11/
drwxr-xr-x 4 root root 4.0K Nov 25 20:09 vendor/rustix-0.37.20/
drwxr-xr-x 4 root root 4.0K Nov 25 20:09 vendor/rustix-0.37.6/

I wrapped all of these into a single patch file so we have a 1:1 correspondence with CVEs to patches. This final patch file is actually four paches, where I patched each version separately (and munged the checksum file), then combined those into a single patch file.

Change Log
Does this affect the toolchain?

NO

Links to CVEs
Test Methodology
  • Built in local container
  • Relying on fasttrack PR gates
  • NOTE: Tests already failed in the same way.

@jslobodzian jslobodzian merged commit 67cbb0f into fasttrack/2.0 Dec 18, 2024
16 of 19 checks passed
@jslobodzian jslobodzian deleted the tobiasb-ms/fasttrack/2.0/cve-2024-43806-rust branch December 18, 2024 00:20
CBL-Mariner-Bot pushed a commit that referenced this pull request Dec 22, 2024
Co-authored-by: Riken Maharjan <[email protected]>
(cherry picked from commit 67cbb0f)
@CBL-Mariner-Bot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants