Skip to content

Extended mount to check all metadata-pairs #9406

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

Merged
merged 1 commit into from
Jan 18, 2019

Conversation

geky
Copy link
Contributor

@geky geky commented Jan 17, 2019

Description

Okay, short explanation:

@davidsaada's idea, this improves littlefs's detection of storage format encroachment (littlefs->FAT->littlefs). This is an issue with MCC<->Mbed OS integration due to some CI/example integration issues.

Long explanation:

The most common issue with using littlefs in mbed-os is when users change from littlefs->FAT->littlefs (or with MBR or similar). When this corrupts the superblock, littlefs tries to fall back to the backup superblock. However, at this point in the time the old superblock may be very out-of-date and pointing to an incorrect filesystem.

There's no complete solution to a malicious modification of the filesystem (short of checking all metadata+data, a very expensive operation), but we can at least expand our validation to all of the metadata for the filesystem. This at least catches the common issues with changing between different filesystems.

Downside: LittleFS takes a bit longer to mount
Upside: Improved user experience when trying out different filesystems

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@davidsaada, @ARMmbed/mbed-os-storage

@geky geky requested review from davidsaada and a team January 17, 2019 07:01
@davidsaada
Copy link
Contributor

@jenia81 Can you check whether this resolved the CI issues?

Copy link
Contributor

@davidsaada davidsaada left a comment

Choose a reason for hiding this comment

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

Thanks for this change. LGTM.

@dannybenor
Copy link

@ARMmbed/mbed-os-maintainers The KCM CI passed with this PR, solving the issue https://jira.arm.com/browse/IOTSTOR-754. I think it should be merged into 5.11.2 if this is a blocker.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 17, 2019

We will check, 5.11.2 is going to be released soon. We will start CI asap for this one (it take a bit as the queue is big at the moment - we will monitor).

The most common issue with using littlefs in mbed-os is when users
change from littlefs->FAT->littlefs (or with MBR or similar). When this
corrupts the superblock, littlefs tries to fall back to the backup
superblock. However, at this point in the time the old superblock may be
very out-of-date and pointing to an incorrect filesystem.

There's no complete solution to a malicious modification of the
filesystem (short of checking all metadata+data, a very expensive
operation), but we can at least expand our validation to all of the
metadata for the filesystem. This at least catches the common issues
with changing between different filesystems.
@cmonr
Copy link
Contributor

cmonr commented Jan 17, 2019

NOTE: This PR has now been rebased.

If this was made in error, feel free to force-push your local branch to restore the PR.

@cmonr cmonr force-pushed the littlefs-validate-all-dirs branch from 20ecebd to 9d6e309 Compare January 17, 2019 17:02
@cmonr
Copy link
Contributor

cmonr commented Jan 17, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Jan 18, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 merged commit 6c6ebc6 into ARMmbed:master Jan 18, 2019
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