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

Security vuln in Satadriver: read/write past partition boundary. #130

Open
ANogin opened this issue Jul 9, 2024 · 1 comment
Open

Security vuln in Satadriver: read/write past partition boundary. #130

ANogin opened this issue Jul 9, 2024 · 1 comment
Labels
bug security relevant to security, such as integrity or confidentiality violations

Comments

@ANogin
Copy link

ANogin commented Jul 9, 2024

components/Sataserver/src/sataserver.c has the following code for read (and very similar for write):

        found = calulate_sector_offset(client, &offset, (uint32_t)sector);
        if (found) {
            err = sata_read_sectors(&sata_driver, drive, len / SATA_BLK_SIZE, sector + offset, packet);

where len is up to 4096, and sector is in SATA_BLK_SIZE units (typically, 512). This means that if sector points to a location within <8 blocks of the end of a partition, the read/write can go up to 3584 bytes past the end of partition, exposing up to 7 sectors at the beginning of the next partition, even if that partition is configured to be inaccessible to the Sataserver.

I fixed that bug while at HRL under DARPA HACMS contract; DARPA have subsequently released the code under distribution A. Attached patch was received directly from DARPA without any nondisclosure conditions
0002-Fixed-several-bugs-in-the-storage-driver.patch.

Note that there was an issue with this - it eliminates the limit in the buffer size for read/write. This did not cause issues with Ubuntu host, but did cause issues with CentOS hosts. A possible fix (which was not included in the DARPA-released code) is to support partial reads/writes.

@lsf37 lsf37 added the bug label Jul 9, 2024
@lsf37
Copy link
Member

lsf37 commented Jul 9, 2024

Hey @Furao -- is this relevant to your VM setup? Would you be able to have a look at it?

@lsf37 lsf37 added the security relevant to security, such as integrity or confidentiality violations label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug security relevant to security, such as integrity or confidentiality violations
Projects
None yet
Development

No branches or pull requests

2 participants