Skip to content

Use pledge(2) on OpenBSD#1451

Open
estrogently wants to merge 8 commits intomicro-editor:masterfrom
estrogently:pledge
Open

Use pledge(2) on OpenBSD#1451
estrogently wants to merge 8 commits intomicro-editor:masterfrom
estrogently:pledge

Conversation

@estrogently
Copy link
Contributor

pledge(2) restricts which system calls can be called, terminating the process on a violation.

Probably not very essential for micro, but nice to have.

@zyedidia
Copy link
Member

zyedidia commented Feb 8, 2020

What sort of system calls does this disallow and how are you sure that micro doesn't violate the pledges? Sorry I'm just worried that this could cause a crash because micro pledges the wrong set of system calls.

@deliciouslytyped
Copy link

I like the idea here.

FWIW, if you're considering adding something like this, you might want to abstract it a bit or something to add multi-platform capability because stuff like seccomp on linux might be interesting.

But then you kind of have to start thinking about "what should be the threat model for a text editor?" and I don't know.

You might also want to make the call list flexible depending on what someone is doing with their plugins, but then at that point a question is how do you secure the configuration?

And if you allow exec, can't someone just run an executable that has less restrictions?

Disclaimer: I am an armchair security engineer.

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