On 15/12/2022 10:21, Beata Michalska wrote:
Hi All,
This series adds capabilities support for clone3 syscall along with set of testcases in morello clone kselftests.
Changes available at: https://git.morello-project.org/Bea/linux/-/tree/morello/clone3_v5 LTP changes: https://git.morello-project.org/Bea/morello-linux-ltp/-/tree/morello/clone3 To run clone3 tests: ./runltp -f syscalls -s clone3
v5: [PATCH 3/3]
- improved handling of default size for clone3 args
- fixed alignment in code layout
- dropped redundant cast
v4: [PATCH 1/3]
- fixed commit message referring to the wrong copy routine
[PATCH 3/3]
- dropped setting default size for clone3 args
- dropped stale comment regarding re-using bits from clone_args flags
- switched ASSERT_FALSE to ASSERT_EQ when comparing pids in child process
- added caching tls value to safely unmap memory
- added validation for both clone stack and tls
- switch from clone_args-> tls to actual thread data when checking for tag in cloned process
v3: [PATCH 1/3]:
- updated commit message to reflect actual changes
[PATCH 2/3]:
- fixed type casting and sizes for copy routines
- swapped order of args for clone_args_size_ver
[PATCH 3/3]:
- added dedicated field for test custom flags instead of 'borrowing' one from clone_args struct
- added test for stack before calling munmap in failing test cases
- switched to WSTOPPED for waitid call
v2:
- add copy_struct_from_user_with_ptr variant
- drop explicit padding from clone_args struct
- switch __alignof__ to sizeof for struct sizing conditions
- use __clone_args_size_ver macro when validating struct layout
- cache the current compat mode instead of relying on compiler optimizations
- drop use of as_user_ptr in favour of explicit casting
- use clone_args struct directly for kselftest test fixture
- add signalling to better handle dependencies between test threads
Beata Michalska (3): uaccess: Preserve capability tags with copy_struct_from_user_with_ptr fork: clone3: Add support for architectural capabilities kselftests/arm64: morello: Add clone3 test-cases
Looks all good now. As discussed offline, I'm waiting for the LTP patch to be ready to merge these patches, as unfortunately they will break the clone3* LTP tests (already part of the main Morello list) unless we merge the LTP patch at the same time.
Kevin
include/linux/uaccess.h | 60 ++++- include/uapi/linux/sched.h | 30 ++- kernel/fork.c | 139 ++++++++--- .../testing/selftests/arm64/morello/Makefile | 1 + tools/testing/selftests/arm64/morello/clone.c | 223 +++++++++++++++++- 5 files changed, 401 insertions(+), 52 deletions(-)