v2..v3:
patch 4: Added new compat_start_thread() for compat64 binaries. This
change was made in a separate patch and inserted before the previous
patch 4 that sets c0-c3.
The branch at [1] has been updated with the new commits
---
This patchset adds partial support for the new aux entries in the
PCuABI, which mainly passes capabilites to the program. The registers
c0-c3 are also set to argc/argv/envp/auxv which currently still resides
on the stack for backwards compatability. The patches are available at
[1]. The constants for the new aux entries can be found at [2]. For
reference the transitional PCuABI can be found at [3].
The capabilities placed in the aux vector do not have restricted
permissions or bounds but have the address set to the specified value,
except for AT_CHERI_STACK_CAP and AT_CHERI_CID_CAP. The upper and lower
bounds of the RX and RW regions as defined in the PCuABI spec for both
the interpreter and program are also determined, though the upper bounds
are left unused since the bounds are currently not set on the new aux
entries.
A morello kselftest ensures that the register values of c0-c3 in startup
code matches the corresponding values on the stack.
[1] https://git.morello-project.org/sherwin-dc/linux/-/commits/morello/next/
[2] https://git.morello-project.org/morello/kernel/linux/-/wikis/Morello-pure-c…
[3] https://git.morello-project.org/morello/kernel/linux/-/wikis/Transitional-M…
Sherwin da Cruz (6):
arm64: elf.h: Remove register init macro
fs/binfmt_elf: Add additional Aux vector entries
elf: Return result from START_THREAD macro
arm64/elf: Use separate compat_start_thread() for compat64
arm64: Set c0-c3 to argc/argv/envp/auxv in start_thread()
kselftests/arm64/morello: Test for new aux entries and init registers
arch/arm64/include/asm/elf.h | 11 +-
arch/arm64/include/asm/processor.h | 55 +++++++++-
fs/binfmt_elf.c | 103 +++++++++++++++++-
fs/compat_binfmt_elf.c | 24 ++--
fs/exec.c | 4 +-
include/linux/auxvec.h | 2 +-
include/linux/elf.h | 7 +-
include/uapi/linux/auxvec.h | 13 +++
.../selftests/arm64/morello/bootstrap.c | 53 ++++++---
.../arm64/morello/freestanding_start.S | 12 +-
10 files changed, 239 insertions(+), 45 deletions(-)
--
2.25.1
v2:
patch 2: Fix logic error in code
patch 2-5: Cosmetic changes and commit rewording
The branch at [1] has been updated with the new commits
---
This patchset adds partial support for the new aux entries in the
PCuABI, which mainly passes capabilites to the program. The registers
c0-c3 are also set to argc/argv/envp/auxv which currently still resides
on the stack for backwards compatability. The patches are available at
[1]. The constants for the new aux entries can be found at [2]. For
reference the transitional PCuABI can be found at [3].
The capabilities placed in the aux vector do not have restricted
permissions or bounds but have the address set to the specified value,
except for AT_CHERI_STACK_CAP and AT_CHERI_CID_CAP. The upper and lower
bounds of the RX and RW regions as defined in the PCuABI spec for both
the interpreter and program are also determined, though the upper bounds
are left unused since the bounds are currently not set on the new aux
entries.
A morello kselftest ensures that the register values of c0-c3 in startup
code matches the corresponding values on the stack.
[1] https://git.morello-project.org/sherwin-dc/linux/-/commits/morello/next/
[2] https://git.morello-project.org/morello/kernel/linux/-/wikis/Morello-pure-c…
[3] https://git.morello-project.org/morello/kernel/linux/-/wikis/Transitional-M…
Sherwin da Cruz (5):
arm64: elf.h: Remove register init macro
fs/binfmt_elf: Add additional Aux vector entries
elf: Return result from START_THREAD macro
arm64: Set c0-c3 to argc/argv/envp/auxv in start_thread()
kselftests/arm64/morello: Test for new aux entries and init registers
arch/arm64/include/asm/elf.h | 8 +-
arch/arm64/include/asm/processor.h | 35 +++++-
fs/binfmt_elf.c | 103 +++++++++++++++++-
fs/compat_binfmt_elf.c | 6 +-
fs/exec.c | 4 +-
include/linux/auxvec.h | 2 +-
include/linux/elf.h | 7 +-
include/uapi/linux/auxvec.h | 13 +++
.../selftests/arm64/morello/bootstrap.c | 53 ++++++---
.../arm64/morello/freestanding_start.S | 12 +-
10 files changed, 209 insertions(+), 34 deletions(-)
--
2.25.1
This patchset adds partial support for the new aux entries in the
PCuABI, which mainly passes capabilites to the program. The registers
c0-c3 are also set to argc/argv/envp/auxv which currently still resides
on the stack for backwards compatability. The patches are available at
[1]. The constants for the new aux entries can be found at [2]. For
reference the transitional PCuABI can be found at [3].
The capabilities placed in the aux vector do not have restricted
permissions or bounds but have the address set to the specified value,
except for AT_CHERI_STACK_CAP and AT_CHERI_CID_CAP. The upper and lower
bounds of the RX and RW regions as defined in the PCuABI spec for both
the interpreter and program are also determined, though the upper bounds
are left unused since the bounds are currently not set on the new aux
entries.
A morello kselftest ensures that the register values of c0-c3 in startup
code matches the corresponding values on the stack.
[1] https://git.morello-project.org/sherwin-dc/linux/-/commits/morello/next/
[2] https://git.morello-project.org/morello/kernel/linux/-/wikis/Morello-pure-c…
[3] https://git.morello-project.org/morello/kernel/linux/-/wikis/Transitional-M…
Sherwin da Cruz (5):
arm64: elf.h: Remove register init macro
fs/binfmt_elf: Add additional Aux vector entries
fs/binfmt_elf: Return result from START_THREAD macro
fs/binfmt_elf: Set c0-c3 to argc/argv/envp/auxv
kselftests/arm64/morello: Test for new aux entries and init registers
arch/arm64/include/asm/elf.h | 8 +-
arch/arm64/include/asm/processor.h | 30 +++++-
fs/binfmt_elf.c | 102 ++++++++++++++++--
fs/compat_binfmt_elf.c | 6 +-
fs/exec.c | 4 +-
include/linux/auxvec.h | 2 +-
include/linux/elf.h | 7 +-
include/uapi/linux/auxvec.h | 13 +++
.../selftests/arm64/morello/bootstrap.c | 58 +++++++---
.../arm64/morello/freestanding_start.S | 12 ++-
10 files changed, 208 insertions(+), 34 deletions(-)
--
2.25.1