aboutsummaryrefslogtreecommitdiffstats
path: root/lib/chaseccomp
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-12-22 22:18:07 +0100
committerbptato <nincsnevem662@gmail.com>2024-12-22 22:18:07 +0100
commit2d2b5fcfbe7e97f3d96c1959b25b797b0a9dafac (patch)
tree34cfccfc1b77c36bbd8d3f8082934cdb7623d299 /lib/chaseccomp
parentbeed7244d46cc2a0595861d1bab7e83873e4d891 (diff)
downloadchawan-2d2b5fcfbe7e97f3d96c1959b25b797b0a9dafac.tar.gz
buffer.chasc: allow reversed clone syscall signature
This caused buffer cloning to choke on armhf. It seems that cris and S/390 architectures also swap flags and stack; luckily, both are dead.
Diffstat (limited to 'lib/chaseccomp')
-rw-r--r--lib/chaseccomp/buffer.chasc8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chaseccomp/buffer.chasc b/lib/chaseccomp/buffer.chasc
index 14abddd4..c497145a 100644
--- a/lib/chaseccomp/buffer.chasc
+++ b/lib/chaseccomp/buffer.chasc
@@ -43,8 +43,12 @@ load args[1] # child_stack
ifne 0 deny
load args[2] # parent_tid
ifne 0 deny
-# 3 is child_tid. Let through whatever we got.
-load args[4] # tls
+# 3, 4 are child_tid and tls respectively. tls in particular is normally
+# 0, but it is swapped with child_tid on some architectures.
+# This still means that at least one of the two must be 0.
+load args[3]
+ifeq 0 allow
+load args[4]
ifeq 0 allow
: not_clone