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

kern: reply buffer capacity checking #1962

Closed

Conversation

cbiffle
Copy link
Collaborator

@cbiffle cbiffle commented Dec 26, 2024

The syscall docs say that attempting to reply with a message that's too big for your client to accept is a programming error. Programming errors are expected to produce faults in the program with the error. This fault is documented as being of type ReplyTooLarge.

However, there is no such fault defined in the ABI, and the actual behavior of the kernel is to deliver the prefix of the reply that fits, and hand the client the length of that prefix. In our current world, this means the client will generally die shortly thereafter with a deserialization error.

In a potential future world where messages can contain variable length portions, the client might not even hit an error when the reply is truncated.

The code in the kernel has been marked with a TODO since forever. This commit resolves the TODO by adding a check and fault reason.

The syscall docs say that attempting to reply with a message that's too
big for your client to accept is a programming error. Programming errors
are expected to produce faults in the program with the error. This fault
is documented as being of type `ReplyTooLarge`.

However, there is no such fault defined in the ABI, and the actual
behavior of the kernel is to deliver the prefix of the reply that fits,
and hand the client the length of that prefix. In our current world,
this means the client will generally die shortly thereafter with a
deserialization error.

In a potential future world where messages can contain variable length
portions, the client might not even hit an error when the reply is
truncated.

The code in the kernel has been marked with a TODO since forever. This
commit resolves the TODO by adding a check and fault reason.
@cbiffle cbiffle requested a review from hawkw December 26, 2024 04:23
@cbiffle
Copy link
Collaborator Author

cbiffle commented Dec 26, 2024

Whoops, this is a duplicate.

@cbiffle cbiffle closed this Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant