Skip to contentSkip to conversation

dovetail: Adjust EXIT_SYSCALL_* values to avoid clash with seccomp

PATCH Applied Jan Kiszka 2 participants 2 messages Nov 12, 2021 – Nov 14, 2021 Generic entry code

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH v2 1/1 dovetail: Adjust EXIT_SYSCALL_* values to avoid clash with seccomp

From: Jan Kiszka <[email protected]>

__secure_computing, called by syscall_trace_enter, returns -1 when a call should be skipped. We must avoid that this is interpreted as EXIT_SYSCALL_OOB in the dovetail case.

Fixes, e.g., crashes of Chrome in sandbox mode.

---
 include/linux/entry-common.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
include/linux/entry-common.h +4 -3
index 2a08b00632b9..26a89e869f3c 100644
@@ -64,10 +64,11 @@
 
 /*
  * Status codes of syscall entry when Dovetail is enabled. Must not
- * conflict with valid syscall numbers.
+ * conflict with valid syscall numbers. And with -1 which seccomp uses
+ * to skip an syscall.
  */
-#define EXIT_SYSCALL_OOB	(-1)
-#define EXIT_SYSCALL_TAIL	(-2)
+#define EXIT_SYSCALL_OOB	(-2)
+#define EXIT_SYSCALL_TAIL	(-3)
 
 /**
  * arch_check_user_regs - Architecture specific sanity check for user mode regs
Signature · 1 line
2.31.1
#1 lore raw
Quoted 22 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

__secure_computing, called by syscall_trace_enter, returns -1 when a call should be skipped. We must avoid that this is interpreted as EXIT_SYSCALL_OOB in the dovetail case.

Fixes, e.g., crashes of Chrome in sandbox mode.

---
 include/linux/entry-common.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
include/linux/entry-common.h +0 -1
index 2a08b00632b9..26a89e869f3c 100644
@@ -64,10 +64,11 @@
 
 /*
  * Status codes of syscall entry when Dovetail is enabled. Must not
- * conflict with valid syscall numbers.

include/linux/entry-common.h line 74

Quoted 10 lines
include/linux/entry-common.h +4 -2
+ * conflict with valid syscall numbers. And with -1 which seccomp uses
+ * to skip an syscall.
  */
-#define EXIT_SYSCALL_OOB	(-1)
-#define EXIT_SYSCALL_TAIL	(-2)
+#define EXIT_SYSCALL_OOB	(-2)
+#define EXIT_SYSCALL_TAIL	(-3)
 
 /**
  * arch_check_user_regs - Architecture specific sanity check for user mode regs

Merged, thanks.

Signature · 1 line
Philippe.