Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MacroFake
Tor
Commits
e4f2b52d
Commit
e4f2b52d
authored
3 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge branch 'maint-0.4.5' into maint-0.4.6
parents
5acf18bf
d85ef0d5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/ticket40382
+6
-0
6 additions, 0 deletions
changes/ticket40382
src/lib/sandbox/sandbox.c
+22
-0
22 additions, 0 deletions
src/lib/sandbox/sandbox.c
with
28 additions
and
0 deletions
changes/ticket40382
0 → 100644
+
6
−
0
View file @
e4f2b52d
o Minor features (compatibility, Linux seccomp sandbox):
- Add a workaround to enable the Linux sandbox to work correctly
on systems running Glibc 2.33. These versions have started
using the fstatat() system call, which previously our sandbox did not
allow.
Closes ticket 40382; see the ticket for a discussion of tradeoffs.
This diff is collapsed.
Click to expand it.
src/lib/sandbox/sandbox.c
+
22
−
0
View file @
e4f2b52d
...
...
@@ -1608,6 +1608,28 @@ add_noparam_filter(scmp_filter_ctx ctx)
}
}
if
(
is_libc_at_least
(
2
,
33
))
{
#ifdef __NR_newfstatat
// Libc 2.33 uses this syscall to implement both fstat() and stat().
//
// The trouble is that to implement fstat(fd, &st), it calls:
// newfstatat(fs, "", &st, AT_EMPTY_PATH)
// We can't detect this usage in particular, because "" is a pointer
// we don't control. And we can't just look for AT_EMPTY_PATH, since
// AT_EMPTY_PATH only has effect when the path string is empty.
//
// So our only solution seems to be allowing all fstatat calls, which
// means that an attacker can stat() anything on the filesystem. That's
// not a great solution, but I can't find a better one.
rc
=
seccomp_rule_add_0
(
ctx
,
SCMP_ACT_ALLOW
,
SCMP_SYS
(
newfstatat
));
if
(
rc
!=
0
)
{
log_err
(
LD_BUG
,
"(Sandbox) failed to add newfstatat() syscall; "
"received libseccomp error %d"
,
rc
);
return
rc
;
}
#endif
}
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment