Skip to contentSkip to conversation

dovetail: Adjust EXIT_SYSCALL_* values to avoid clash with seccomp

PATCH Superseded Jan Kiszka 3 participants 4 messages Nov 11, 2021 – Nov 12, 2021 Generic entry code

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 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.

---

"Fixes" is my observation - Yuta-san, please confirm also for your setup.

 include/linux/entry-common.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/entry-common.h +2 -2
index 2a08b00632b9..43cf846111d9 100644
@@ -66,8 +66,8 @@
  * Status codes of syscall entry when Dovetail is enabled. Must not
  * conflict with valid syscall numbers.
  */
-#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

Hi Jan-san

Thanks for the fix.
I checked, and the browser now works fine with xenomai3.2 dovetail.

Thank you for your quick response.
It was very helpful.

Yuta Ando

-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Friday, November 12, 2021 3:57 AM
To: Philippe Gerum <[email protected]>
Cc: Xenomai <[email protected]>; Ando Yuta <[email protected]>
Subject: [PATCH] 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.

---

"Fixes" is my observation - Yuta-san, please confirm also for your setup.

 include/linux/entry-common.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/entry-common.h +2 -2
@@ -66,8 +66,8 @@
  * Status codes of syscall entry when Dovetail is enabled. Must not
  * conflict with valid syscall numbers.
  */
-#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

--
2.31.1

#2 lore raw
In reply to Jan Kiszka
Quoted 22 lines · Jan Kiszka via Xenomai

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.

---

"Fixes" is my observation - Yuta-san, please confirm also for your setup.

 include/linux/entry-common.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/entry-common.h +0 -0
index 2a08b00632b9..43cf846111d9 100644

include/linux/entry-common.h line 67

Quoted 2 lines
include/linux/entry-common.h +0 -0
@@ -66,8 +66,8 @@
  * Status codes of syscall entry when Dovetail is enabled. Must not
  * conflict with valid syscall numbers.

Maybe extend this comment why -1 can not be used here?

Quoted 8 lines
include/linux/entry-common.h +2 -2
  */
-#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
author
#3 lore raw
Quoted 18 lines · Florian (T RDA IOT SES-DE)
Quoted 17 lines · Jan Kiszka via Xenomai

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.

---

"Fixes" is my observation - Yuta-san, please confirm also for your setup.

 include/linux/entry-common.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 10 lines

include/linux/entry-common.h line 67

Quoted 7 lines
include/linux/entry-common.h +0 -0
index 2a08b00632b9..43cf846111d9 100644
@@ -66,8 +66,8 @@
  * Status codes of syscall entry when Dovetail is enabled. Must not
  * conflict with valid syscall numbers.

Maybe extend this comment why -1 can not be used here?

Good point.

Jan

Quoted 9 lines
Quoted 8 lines
include/linux/entry-common.h +2 -2
  */
-#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 · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux