Skip to content

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Oct 5, 2021

Similar to #23178, this is a follow up to #20487, which has broken running the unit tests for some developers. Fix this by adding newfstatat to the list of allowed filesystem related calls.

@achow101
Copy link
Member

achow101 commented Oct 5, 2021

Closer, but now missing copy_file_range too:

ERROR: The syscall "copy_file_range" (syscall number 326) is not allowed by the syscall sandbox in thread "httpworker.2". Please report.

@fanquake
Copy link
Member Author

fanquake commented Oct 5, 2021

Closer, but now missing copy_file_range too:

Added copy_file_range to the list of allowed file related syscalls. File related syscalls are already enabled for the HTTP worker threads.

@achow101
Copy link
Member

achow101 commented Oct 5, 2021

ACK 44d77d2

Tested that this does fix the test issues I was running into.

@fanquake fanquake changed the title sandbox: add newfstatat to allowed filesystem syscalls sandbox: add newfstatat & copy_file_range to allowed filesystem syscalls Oct 5, 2021
@laanwj
Copy link
Member

laanwj commented Oct 5, 2021

Code review ACK 44d77d2

@laanwj
Copy link
Member

laanwj commented Oct 5, 2021

Doing a GUIX build with #23179 and #23178 because I'm slightly afraid newfstatat & copy_file_range are new syscalls that need to be defined manually as well.

If so, do you mind if I cherry-pick this into #23178?

@fanquake
Copy link
Member Author

fanquake commented Oct 5, 2021

If so, do you mind if I cherry-pick this into #23178?

Yes that's fine.

@laanwj
Copy link
Member

laanwj commented Oct 5, 2021

Looks like it's not neccessary, GUIX build passes with those two PRs as-is.

allowed_syscalls.insert(__NR_statfs); // get filesystem statistics
allowed_syscalls.insert(__NR_statx); // get file status (extended)
allowed_syscalls.insert(__NR_unlink); // delete a name and possibly the file it refers to
allowed_syscalls.insert(__NR_access); // check user's permissions for a file
Copy link
Member

Choose a reason for hiding this comment

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

I think it creates somewhat of a merge hotspot to re-align these comments every time something is added/removed.

Copy link
Contributor

@practicalswift practicalswift left a comment

Choose a reason for hiding this comment

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

cr ACK 44d77d2

Thanks for improving the experimental syscall sandbox! :)

@maflcko maflcko merged commit c79d9fb into bitcoin:master Oct 5, 2021
@fanquake fanquake deleted the add_newfstatat_to_syscall_exceptions branch October 5, 2021 10:08
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 5, 2021
… allowed filesystem syscalls

44d77d2 sandbox: add copy_file_range to allowed filesystem syscalls (fanquake)
ee08741 sandbox: add newfstatat to allowed filesystem syscalls (fanquake)

Pull request description:

  Similar to bitcoin#23178, this is a follow up to bitcoin#20487, which has broken running the unit tests for some developers. Fix this by adding `newfstatat` to the list of allowed filesystem related calls.

ACKs for top commit:
  achow101:
    ACK 44d77d2
  laanwj:
    Code review ACK  44d77d2
  practicalswift:
    cr ACK 44d77d2

Tree-SHA512: ce9d1b441ebf25bd2cf290566e05864223c1418dab315c962e1094ad877db5dd9fcab94ab98a46da8b712a8f5f46675d62ca3349215d8df46ec5b3c4d72dbaa6
@bitcoin bitcoin locked and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants