We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Calling function open that uses "EEPROM.DAT" after a check function. This can cause a time-of-check, time-of-use race condition.
Expected behavior The most basic advice for TOCTOU vulnerabilities is to not perform a check before the use. Could also use the O_CREAT and O_EXCL flags of POSIX's open() function. https://cwe.mitre.org/data/definitions/367.html https://wiki.sei.cmu.edu/confluence/display/c/FIO45-C.+Avoid+TOCTOU+race+conditions+while+accessing+files
Code snips
PSP/fsw/modules/eeprom_mmap_file/cfe_psp_eeprom_mmap_file.c
Lines 102 to 108 in 1bd7bd9
System observed on: Coverity: https://scan.coverity.com/projects/arielsadamsnasa-cfs-jsf-rules?tab=overview
Reporter Info Ariel Adams, ASRC Federal
The text was updated successfully, but these errors were encountered:
Could just open w/ O_CREAT, fstat to get the size and lseek/write if it's not EEPROMSize to get the same behavior as currently implemented.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Calling function open that uses "EEPROM.DAT" after a check function. This can cause a time-of-check, time-of-use race condition.
Expected behavior
The most basic advice for TOCTOU vulnerabilities is to not perform a check before the use. Could also use the O_CREAT and O_EXCL flags of POSIX's open() function.
https://cwe.mitre.org/data/definitions/367.html
https://wiki.sei.cmu.edu/confluence/display/c/FIO45-C.+Avoid+TOCTOU+race+conditions+while+accessing+files
Code snips
PSP/fsw/modules/eeprom_mmap_file/cfe_psp_eeprom_mmap_file.c
Lines 102 to 108 in 1bd7bd9
System observed on:
Coverity: https://scan.coverity.com/projects/arielsadamsnasa-cfs-jsf-rules?tab=overview
Reporter Info
Ariel Adams, ASRC Federal
The text was updated successfully, but these errors were encountered: