On Wed, Mar 27, 2024 at 9:37 PM Samuel Thibault wrote:
> But it's not getting used anywhere?
Indeed, I forgot to extract the kern/bootstrap.c part of the change.
Ooops :) Thanks for pointing it out.
Sergey
-- >8 --
If a bootstrap ELF contains a PT_GNU_STACK phdr, take stack protection
from the
Applied, thanks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:41 +0300, a ecrit:
> ---
> tests/user-qemu.mk | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tests/user-qemu.mk b/tests/user-qemu.mk
> index fd5ae1ab..4f8390b6 100644
> --- a/tests/user-qemu.mk
> +++ b/tests/user-qemu.mk
> @@ -
Applied, thanks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:40 +0300, a ecrit:
> ---
> tests/start.S| 2 ++
> tests/syscalls.S | 2 ++
> 2 files changed, 4 insertions(+)
>
> diff --git a/tests/start.S b/tests/start.S
> index b795bfbd..15970fb9 100644
> --- a/tests/start.S
> +++ b/tests/start.
Applied, thansks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:39 +0300, a ecrit:
> ---
> tests/test-syscalls.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/test-syscalls.c b/tests/test-syscalls.c
> index 63c2690a..fbfecd9c 100644
> --- a/tests/test-syscalls.c
> ++
Applied, thanks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:38 +0300, a ecrit:
> ---
> tests/testlib_thread_start.c | 19 +++
> 1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/tests/testlib_thread_start.c b/tests/testlib_thread_start.c
> index fa8af0ea..df4b19ab
Applied, thanks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:37 +0300, a ecrit:
> ---
> tests/include/testlib.h | 2 ++
> tests/testlib.c | 13 +
> 2 files changed, 15 insertions(+)
>
> diff --git a/tests/include/testlib.h b/tests/include/testlib.h
> index d2367124..035fdc28 1
Applied, thanks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:36 +0300, a ecrit:
> ---
> tests/include/testlib.h | 16 ++
> tests/test-syscalls.c | 40 +
> tests/testlib.c | 123
> 3 files changed, 142 insertions(+), 37 deletions(-
Applied, thanks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:35 +0300, a ecrit:
> Mark it as noreturn, and make sure to halt, not reboot.
> ---
> tests/include/testlib.h | 2 +-
> tests/testlib.c | 3 ++-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tests/include/tes
Applied, thanks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:34 +0300, a ecrit:
> There might be good reasons why Mach on x86 shouldn't be built as PIC/
> PIE, but there are also very good reasons to support PIE on other
> architectures. Potentially implementing KASLR is one such reason; but
> also
Sergey Bugaev, le mer. 27 mars 2024 19:18:33 +0300, a ecrit:
> Since they are implemented in copy_user.c
> ---
> i386/i386/locore.h | 4
> ipc/copy_user.h| 15 +++
> kern/exception.c | 1 +
> 3 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/i386/i386/loc
Applied, thanks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:32 +0300, a ecrit:
> ipc_entry_lookup_failed() is used with both mach_msg_user_header_t and
> mach_msg_header_t arguments, which are different types. Make it into a
> macro, so it works with both.
> ---
> ipc/ipc_space.h | 22
Applied, thanks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:31 +0300, a ecrit:
> Initializing a variable with itself is undefined, and GCC 14 rightfully
> produces a warning about the variable being used (to initialize itself)
> prior to initialization. X15 sets the variables to 0 instead, so do th
Sergey Bugaev, le mer. 27 mars 2024 19:18:30 +0300, a ecrit:
> It's not always possible to directly access user memory from kernel
> mode. While it's in theory a lot more expensive to fetch each character
> to be printed separately, mach_print() is only a debugging facility, and
> it's not supposed
Applied, thanks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:29 +0300, a ecrit:
> Depending on the architecture and setup, it may not be possible to
> access user memory directly, for example, due to user mode mappings not
> being accessible from kernel mode (x86 SMAP, AArch64 PAN). There are
> dedi
Applied, thanks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:28 +0300, a ecrit:
> Not only on x86_64.
> ---
> include/mach/exec/elf.h | 4 ++--
> kern/exception.c| 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/mach/exec/elf.h b/include/mach/exec/elf.h
>
Applied, thanks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:27 +0300, a ecrit:
> ---
> include/mach/message.h | 10 +-
> ipc/ipc_kmsg.c | 4 ++--
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/include/mach/message.h b/include/mach/message.h
> index 9790ef98..
Applied, thanks!
Sergey Bugaev, le mer. 27 mars 2024 19:18:26 +0300, a ecrit:
> It's not only x86_64, none of new architectures are going to have it.
> ---
> include/mach/mach_host.defs | 6 +++---
> kern/host.c | 4 ++--
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> dif
Hello,
Sergey Bugaev, le mer. 27 mars 2024 19:18:25 +0300, a ecrit:
> diff --git a/include/mach/exec/exec.h b/include/mach/exec/exec.h
> index 94b234b0..29fa897d 100644
> --- a/include/mach/exec/exec.h
> +++ b/include/mach/exec/exec.h
> @@ -51,6 +51,8 @@ typedef struct exec_info
> /* (ELF) A
---
tests/start.S| 2 ++
tests/syscalls.S | 2 ++
2 files changed, 4 insertions(+)
diff --git a/tests/start.S b/tests/start.S
index b795bfbd..15970fb9 100644
--- a/tests/start.S
+++ b/tests/start.S
@@ -26,3 +26,5 @@ _start:
movq%rsp,%rdi
callq c_start
#endif /* __x86_
These are generic, relatively independent patches from the AArch64
branch. I've done a quick build for i386-gnu and things still seem to
build, but please test!
Sergey
Not only on x86_64.
---
include/mach/exec/elf.h | 4 ++--
kern/exception.c| 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/mach/exec/elf.h b/include/mach/exec/elf.h
index 42920e25..55304496 100644
--- a/include/mach/exec/elf.h
+++ b/include/mach/exec/elf.h
@@
It's not only x86_64, none of new architectures are going to have it.
---
include/mach/mach_host.defs | 6 +++---
kern/host.c | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/mach/mach_host.defs b/include/mach/mach_host.defs
index a8c40af6..8fd9d6b3
If a bootstrap ELF contains a PT_GNU_STACK phdr, take stack protection
from there. Otherwise, default to VM_PROT_ALL.
---
include/mach/exec/elf.h | 1 +
include/mach/exec/exec.h | 2 ++
kern/elf-load.c | 7 +++
3 files changed, 10 insertions(+)
diff --git a/include/mach/exec/elf.h
---
tests/user-qemu.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/user-qemu.mk b/tests/user-qemu.mk
index fd5ae1ab..4f8390b6 100644
--- a/tests/user-qemu.mk
+++ b/tests/user-qemu.mk
@@ -130,6 +130,7 @@ SRC_TESTLIB= \
$(MIG_GEN_CC)
tests/errlist.c: $(addprefix $(srcdir)/in
Depending on the architecture and setup, it may not be possible to
access user memory directly, for example, due to user mode mappings not
being accessible from kernel mode (x86 SMAP, AArch64 PAN). There are
dedicated machine-specific copyin()/copyout() routines that know how to
access user memory
Initializing a variable with itself is undefined, and GCC 14 rightfully
produces a warning about the variable being used (to initialize itself)
prior to initialization. X15 sets the variables to 0 instead, so do the
same in Mach.
---
kern/rdxtree.c | 4 ++--
1 file changed, 2 insertions(+), 2 dele
---
tests/include/testlib.h | 16 ++
tests/test-syscalls.c | 40 +
tests/testlib.c | 123
3 files changed, 142 insertions(+), 37 deletions(-)
diff --git a/tests/include/testlib.h b/tests/include/testlib.h
index cdb2ce13..d236712
Mark it as noreturn, and make sure to halt, not reboot.
---
tests/include/testlib.h | 2 +-
tests/testlib.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/include/testlib.h b/tests/include/testlib.h
index a3f3a6a8..cdb2ce13 100644
--- a/tests/include/testlib.
---
tests/test-syscalls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test-syscalls.c b/tests/test-syscalls.c
index 63c2690a..fbfecd9c 100644
--- a/tests/test-syscalls.c
+++ b/tests/test-syscalls.c
@@ -34,7 +34,7 @@ static struct {
mach_port_t task;
integer_t ex
It's not always possible to directly access user memory from kernel
mode. While it's in theory a lot more expensive to fetch each character
to be printed separately, mach_print() is only a debugging facility, and
it's not supposed to be used for printing large amounts of data.
---
kern/syscall_sub
Since they are implemented in copy_user.c
---
i386/i386/locore.h | 4
ipc/copy_user.h| 15 +++
kern/exception.c | 1 +
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/i386/i386/locore.h b/i386/i386/locore.h
index 217e6dec..8ff587ed 100644
--- a/i386/i386/lo
---
tests/include/testlib.h | 2 ++
tests/testlib.c | 13 +
2 files changed, 15 insertions(+)
diff --git a/tests/include/testlib.h b/tests/include/testlib.h
index d2367124..035fdc28 100644
--- a/tests/include/testlib.h
+++ b/tests/include/testlib.h
@@ -70,6 +70,8 @@ thread_t
---
tests/testlib_thread_start.c | 19 +++
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/tests/testlib_thread_start.c b/tests/testlib_thread_start.c
index fa8af0ea..df4b19ab 100644
--- a/tests/testlib_thread_start.c
+++ b/tests/testlib_thread_start.c
@@ -30,30 +30,
There might be good reasons why Mach on x86 shouldn't be built as PIC/
PIE, but there are also very good reasons to support PIE on other
architectures. Potentially implementing KASLR is one such reason; but
also the Linux AArch64 boot protocol (that the AArch64 port will use for
booting) lets the b
ipc_entry_lookup_failed() is used with both mach_msg_user_header_t and
mach_msg_header_t arguments, which are different types. Make it into a
macro, so it works with both.
---
ipc/ipc_space.h | 22 +-
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/ipc/ipc_space.
---
include/mach/message.h | 10 +-
ipc/ipc_kmsg.c | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/mach/message.h b/include/mach/message.h
index 9790ef98..87b83951 100644
--- a/include/mach/message.h
+++ b/include/mach/message.h
@@ -240,7 +240,7 @@
36 matches
Mail list logo