Skip to content

vfile: save memory by removing TOCTTOU protections#2880

Merged
hugelgupf merged 1 commit intou-root:mainfrom
hugelgupf:vfile
Jan 31, 2024
Merged

vfile: save memory by removing TOCTTOU protections#2880
hugelgupf merged 1 commit intou-root:mainfrom
hugelgupf:vfile

Conversation

@hugelgupf
Copy link
Copy Markdown
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 <[email protected]>
@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
@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.

2 participants