jart / jart/pledge

fallocate fails because it is not in any promise group

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
143
Forks
7
PR merge metrics
No merged PRs in 30d

Description

`__NR_fallocate` isn't used anywhere.

Should it be in [`kPledgeStdio[]`](https://github.com/jart/pledge/blob/8693ebe15a30bd4235165ad72a469da29ca067cf/libc/calls/pledge-linux.c#L547)?

Currently gives `EPERM`:

```
fallocate(3, 0, 0, 10485760) = -1 EPERM (Operation not permitted)
```

---

Is / should there be a CLI flag that allows me to give individual syscalls directly, to handle cases like this?

---

Also, would it make sense to have some test that checks that each syscall is in some promise group?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in libc/calls/pledge-linux.c around kPledgeStdio[] and trace how __NR_fallocate is assigned to promise groups. Check the existing syscall-related tests or test entry points, then verify that fallocate no longer returns EPERM under the appropriate promise and that any proposed syscall-coverage check has a clear passing condition.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
operating-systems, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.