Skip to content

Commit 20273a8

Browse files
committed
seccomp: allow sync_file_range2 on supported architectures.
On a ppc64le host, running postgres (tried with 9.4 to 9.6) gives the following warning when trying to flush data to disks (which happens very frequently): WARNING: could not flush dirty data: Operation not permitted. A quick dig in postgres source code indicate it uses sync_file_range(2) to flush data; which on ppe64le and arm64 is translated to sync_file_range2(2) for alignements reasons. The profile did not allow sync_file_range2(2), making postgres sad because it can not flush its buffers. arm_sync_file_range(2) is an ancient alias to sync_file_range2(2), the syscall was renamed in Linux 2.6.22 when the same syscall was added for PowerPC. Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit 5862285) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 357d100 commit 20273a8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

contrib/seccomp/seccomp_default.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,11 +452,20 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
452452

453453
// include by arch
454454
switch runtime.GOARCH {
455+
case "ppc64le":
456+
s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
457+
Names: []string{
458+
"sync_file_range2",
459+
},
460+
Action: specs.ActAllow,
461+
Args: []specs.LinuxSeccompArg{},
462+
})
455463
case "arm", "arm64":
456464
s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
457465
Names: []string{
458466
"arm_fadvise64_64",
459467
"arm_sync_file_range",
468+
"sync_file_range2",
460469
"breakpoint",
461470
"cacheflush",
462471
"set_tls",

0 commit comments

Comments
 (0)