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

Fix lookahead buffer size reported to littlefs2-sys #24

Merged
merged 3 commits into from
Feb 7, 2023

Commits on Feb 7, 2023

  1. Fix lookahead buffer size reported to littlefs2-sys

    Previously, we reported the lookahead buffer size in bytes but
    littlefs2-sys expects the lookahead buffer size as a multiple of 8
    bytes.  This could lead to a buffer overflow causing filesystem
    corruption.  This patch fixes the reported lookahead buffer size.
    
    Note that Storage::LOOKAHEAD_WORDS_SIZE allows users to set invalid
    values (as it is measured in 4 bytes, not in 8 bytes).  Invalid values
    that were previously accepted because of the wrong buffer size
    calculation can now be rejected by littlefs2-sys.
    
    This is a combination of two previous patches:
    	trussed-dev#19
    	#1
    
    Fixes: trussed-dev#16
    robin-nitrokey committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    82ac3eb View commit details
    Browse the repository at this point in the history
  2. Replace LOOKAHEADWORDS_SIZE with LOOKAHEAD_SIZE

    This patch replaces the LOOKAHEADWORDS_SIZE in driver::Storage (measured
    in 4 bytes) with LOOKAHEAD_SIZE (measure in 8 bytes).  This makes it
    impossible to set illegal values.
    robin-nitrokey committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    baf4424 View commit details
    Browse the repository at this point in the history
  3. Remove rust-toolchain.toml

    As we fixed the lookahead buffer overflow, we no longer have to pin the
    Rust version.
    
    Fixes trussed-dev#26
    Fixes trussed-dev#28
    robin-nitrokey committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    72f323f View commit details
    Browse the repository at this point in the history