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_v4
LTP changes:
https://git.morello-project.org/Bea/morello-linux-ltp/-/tree/morello/clone3
To run clone3 tests:
./runltp -f syscalls -s clone3
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
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 | 222 +++++++++++++++++-
5 files changed, 400 insertions(+), 52 deletions(-)
--
2.25.1
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_v3
LTP changes:
https://git.morello-project.org/Bea/morello-linux-ltp/-/tree/morello/clone3
To run clone3 tests:
./runltp -f syscalls -s clone3
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
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 | 228 +++++++++++++++++-
5 files changed, 406 insertions(+), 52 deletions(-)
--
2.25.1
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_v2
LTP changes:
https://git.morello-project.org/Bea/morello-linux-ltp/-/tree/morello/clone3
To run clone3 tests:
./runltp -f syscalls -s clone3
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
fork: clone3: Add support for architectural capabilities
kselftests/arm64: morello: Add clone3 test-cases
include/linux/uaccess.h | 60 ++++-
include/uapi/linux/sched.h | 30 ++-
kernel/fork.c | 135 +++++++---
.../testing/selftests/arm64/morello/Makefile | 1 +
tools/testing/selftests/arm64/morello/clone.c | 232 +++++++++++++++++-
5 files changed, 406 insertions(+), 52 deletions(-)
--
2.25.1
void* can cause issues for alignment now that its size depends on whether
it is compat or purecap. In struct __kernel_sockaddr_storage, it is not
annotated with __user, so it is affected.
Change it to an unsigned long. Musl uses the same type for its struct
definitions.
Signed-off-by: Teo Couprie Diaz <teo.coupriediaz(a)arm.com>
---
include/uapi/linux/socket.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/linux/socket.h b/include/uapi/linux/socket.h
index 51d6bb2f6765..28ff6a4aebca 100644
--- a/include/uapi/linux/socket.h
+++ b/include/uapi/linux/socket.h
@@ -22,7 +22,7 @@ struct __kernel_sockaddr_storage {
/* space to achieve desired size, */
/* _SS_MAXSIZE value minus size of ss_family */
};
- void *__align; /* implementation specific desired alignment */
+ unsigned long __align; /* implementation specific desired alignment */
};
};
base-commit: bbd29c87073f43eb8c09e8a2c2f4508b46a831a0
--
2.25.1
Hi,
This series includes all the uAPI changes defined in the PCuABI spec
that are not already in the tree or posted on the list.
The patches are not meant to be merged right now, logically this should
happen together with the corresponding implementaton. Rather, I am
making these patches available for reference, as the emulation of PCuABI
is progressing in projects like libshim and requires the definition of
these uAPI macros.
The patches are also available in this branch:
https://git.morello-project.org/kbrodsky-arm/linux/-/commits/upcoming_uapi
Thanks,
Kevin
Kevin Brodsky (3):
uapi: errno.h: Introduce ERESERVATION
uapi: mm: Introduce PROT_MAX()
uapi: mm: Introduce PROT_CAP_INVOKE
include/uapi/asm-generic/errno.h | 2 ++
include/uapi/asm-generic/mman-common.h | 8 ++++++++
2 files changed, 10 insertions(+)
--
2.38.1
The __packed attribute for struct compat_group_req led to a failure of
the LTP test accept02 when trying to join a multicast group.
Keep it for COMPAT32 but remove it in COMPAT64, do the same for the
other structs used here.
Signed-off-by: Teo Couprie Diaz <teo.coupriediaz(a)arm.com>
---
Not really sure this is the right way to go, nor if the others structs
should be left alone.
Chaning them all didn't lead to failures in setsockopt or accept LTP
tests, which was where the issue was detected.
include/net/compat.h | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/include/net/compat.h b/include/net/compat.h
index f2d7423217d2..5cb091e2a6a6 100644
--- a/include/net/compat.h
+++ b/include/net/compat.h
@@ -68,7 +68,11 @@ struct compat_group_req {
__u32 gr_interface;
struct __kernel_sockaddr_storage gr_group
__aligned(4);
+#ifdef CONFIG_COMPAT32
} __packed;
+#else
+};
+#endif
struct compat_group_source_req {
__u32 gsr_interface;
@@ -76,7 +80,11 @@ struct compat_group_source_req {
__aligned(4);
struct __kernel_sockaddr_storage gsr_source
__aligned(4);
+#ifdef CONFIG_COMPAT32
} __packed;
+#else
+};
+#endif
struct compat_group_filter {
union {
@@ -88,7 +96,11 @@ struct compat_group_filter {
__u32 gf_numsrc_aux;
struct __kernel_sockaddr_storage gf_slist[1]
__aligned(4);
+#ifdef CONFIG_COMPAT32
} __packed;
+#else
+ };
+#endif
struct {
__u32 gf_interface;
struct __kernel_sockaddr_storage gf_group
@@ -97,8 +109,16 @@ struct compat_group_filter {
__u32 gf_numsrc;
struct __kernel_sockaddr_storage gf_slist_flex[]
__aligned(4);
+#ifdef CONFIG_COMPAT32
} __packed;
+#else
+ };
+#endif
};
-} __packed;
+#ifdef CONFIG_COMPAT32
+ } __packed;
+#else
+ };
+#endif
#endif /* NET_COMPAT_H */
base-commit: 2fcc0af155a19755f68602f400fc845d2c9e6077
--
2.25.1