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

Support (or not) for "Large" file mode #95

Closed
jphickey opened this issue Dec 7, 2021 · 2 comments · Fixed by #179
Closed

Support (or not) for "Large" file mode #95

jphickey opened this issue Dec 7, 2021 · 2 comments · Fixed by #179
Assignees
Milestone

Comments

@jphickey
Copy link
Contributor

jphickey commented Dec 7, 2021

The CFDP specification (specifically CCSDS 727.0-B-5, table 5-1) defines a "Large File Flag" bit. When this bit is set in the PDU header, it means that all file sizes and offsets are 64 bits in size, rather than the historical 32 bits.

The CF implementation currently does not have this bit defined - the position it resides is defined as RESERVED in this code - and all file sizes are defined as a fixed 32 bits in the PDU structures, with no provisions to permit use of 64 bit values here.

The CF requirements also do not appear to require large file transfer to be supported.

However, even if large file is not supported by this implementation of CFDP, for interoperability reasons CF should at least recognize and check for this flag being set, and reject packets for which it is set. Due to the fact that this flag changes the size and location of elements that follow, if it is ignored then one runs the risk of misinterpreting packets and triggering undefined behavior, which could corrupt the filesystem.

@skliper
Copy link
Contributor

skliper commented Dec 13, 2021

Somewhat related to nasa/osal#657 on the transmit side where OS_lseek silently truncates OS results larger than 32 bit.

@jphickey
Copy link
Contributor Author

jphickey commented Jan 6, 2022

Similar to #129 here, this should check if the bit is set and reject packets for which it is set. In this case encode/decode routines are still hardcoded to 32-bit file sizes, so CF still has a bit interpretation error if this is ever set, even after PR #137.

jphickey added a commit to jphickey/CF that referenced this issue Jan 13, 2022
This bit indicates that the PDU has 64-bit size and offset fields.
CF currently does not support large file sizes.  It needs to reject
these packets as they will corrupt the data because they are not
decoded properly (decode is fixed at 32 bit sizes).
jphickey added a commit to jphickey/CF that referenced this issue Jan 13, 2022
This bit indicates that the PDU has 64-bit size and offset fields.
CF currently does not support large file sizes.  It needs to reject
these packets as they will corrupt the data because they are not
decoded properly (decode is fixed at 32 bit sizes).
astrogeco added a commit that referenced this issue Jan 18, 2022
Fix #95, reject PDUs with large bit set
@skliper skliper added this to the Draco milestone Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants