Skip to content

c18n: add partial SYSERRCAUSE to kern.proc.c18n.compartments #2388

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

brooksdavis
Copy link
Member

Report error cause for things that might cause EFAULT

cc @rwatson

Report error cause for things that might cause EFAULT
@brooksdavis brooksdavis requested a review from dpgao April 3, 2025 01:15
@@ -2683,14 +2689,21 @@ sysctl_kern_proc_c18n_compartments(SYSCTL_HANDLER_ARGS)
*/
error = proc_read_string_properly(curthread, p,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Robert's failure is actually EPROT from his ktrace, and I bet it is inside of here, perhaps where we use cheri_can_access.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, there is an EPROT a few lines earlier here due to a cheri_can_access you'd want to log as well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, I wonder why we do a separate cheri_can_access on each entry instead of just doing a single check for the entire array of info.comparts up front.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, good point. We can definitely do that.

Copy link
Contributor

@dpgao dpgao left a comment

Choose a reason for hiding this comment

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

We can lift the cheri_can_access out of the loop in a future commit.

@bsdjhb
Copy link
Collaborator

bsdjhb commented Apr 10, 2025

I actually have lifted it out in another branch already.

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.

3 participants