On 8/27/23 08:57, Karim Taha wrote:
From: Stacey Son <s...@freebsd.org>
Signed-off-by: Stacey Son <s...@freebsd.org>
Signed-off-by: Karim Taha <kariem.taha...@gmail.com>
---
bsd-user/freebsd/os-proc.h | 38 +++++++++++++++++++++++++++++++++++
bsd-user/freebsd/os-syscall.c | 4 ++++
2 files changed, 42 insertions(+)
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
+ /*
+ * XXX We need to handle RFMEM here, as well. Neither are safe to execute
+ * as-is on x86 hosts because they'll split memory but not the stack,
+ * wreaking havoc on host architectures that use the stack to store the
+ * return address as both threads try to pop it off. Rejecting RFSPAWN
+ * entirely for now is ok, the only consumer at the moment is posix_spawn
+ * and it will fall back to classic vfork(2) if we return EINVAL.
+ */
+ if ((flags & TARGET_RFSPAWN) != 0)
+ return -TARGET_EINVAL;
Braces.
r~