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

vfile: save memory by removing TOCTTOU protections #2880

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

hugelgupf
Copy link
Member

On low memory systems, vfile contributes one of many copies of an OS to be kexec'd in u-root. To enable only-one-copy kexec, drop TOCTTOU protections.

On low memory systems, vfile contributes one of many copies of an OS to
be kexec'd in u-root. To enable only-one-copy kexec, drop TOCTTOU
protections.

Signed-off-by: Chris Koch <chrisko@google.com>
Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (c5c7116) 77.31% compared to head (86e0890) 77.30%.

Files Patch % Lines
pkg/vfile/vfile.go 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2880      +/-   ##
==========================================
- Coverage   77.31%   77.30%   -0.01%     
==========================================
  Files         429      429              
  Lines       43094    43088       -6     
==========================================
- Hits        33316    33308       -8     
- Misses       9778     9780       +2     
Flag Coverage Δ
.-amd64 67.87% <ø> (ø)
cmds/...-amd64 71.35% <ø> (-0.06%) ⬇️
integration/generic-tests/...-amd64 18.21% <ø> (ø)
integration/generic-tests/...-arm 0.00% <ø> (ø)
integration/generic-tests/...-arm64 21.80% <ø> (ø)
integration/gotests/...-amd64 74.14% <90.90%> (+<0.01%) ⬆️
integration/gotests/...-arm 75.37% <90.90%> (+<0.01%) ⬆️
integration/gotests/...-arm64 75.09% <ø> (-0.01%) ⬇️
pkg/...-amd64 76.12% <90.90%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chrisfenner
Copy link
Member

LGTMing with the following assumptions in case I'm not seeing this right:

  • TOCTTOU protection was best effort/aspirational for uroot kexec and wasn't a firm requirement in the first place
  • Attempting TOCTTOU proof kexec requires loading the entire OS into memory and verifying it from there, which is not practical
  • uroot users can protect themselves from threats that would exploit the TOCTTOU gap in some other way; or there is some future work-item to track creating a version of uroot that can provide this (perhaps at the cost of higher memory usage)

@hugelgupf hugelgupf merged commit cd3d81d into u-root:main Jan 31, 2024
26 checks passed
@hugelgupf hugelgupf deleted the vfile branch January 31, 2024 17:12
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.

None yet

2 participants