On Tue, Oct 18, 2022 at 10:43:42AM +0200, Kevin Brodsky wrote:
On 17/10/2022 16:30, Beata Michalska wrote:
For the syscall framework to be able to recognize capabilities as a valid syscall return type, alterations were required, ending-up in modifying syscall wrappers and basically injecting an additional argument, that specifies the expected return type for given syscall handler. For some reason, SYSCALL_METADATA macro slipped under the radar, leaving it broken for arm64. The extra argument passed, crippled the overall logic for the tracing metadata macro, resulting in compile-time errors when CONFIG_FTRACE_SYSCALLS was enabled. This has been partially addressed by:
commit ("tracing/syscalls: Allow amending metadata macro arguments")
still, though, leaving SYSCALL_METADATA trying to process (unconsciously) the return type argument, which is bogus and leaves the tracing metadata in an overall mess. Make a full use of the above mentioned changes and drop the additional argument from the tracing metadata macro, restoring its original logic.
Fixes: ("arm64/syscalls: Allow syscalls to return capabilities") Signed-off-by: Beata Michalska beata.michalska@arm.com
arch/arm64/include/asm/syscall_wrapper.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm64/include/asm/syscall_wrapper.h b/arch/arm64/include/asm/syscall_wrapper.h index 97e08c4a6520..30d4fd12e114 100644 --- a/arch/arm64/include/asm/syscall_wrapper.h +++ b/arch/arm64/include/asm/syscall_wrapper.h @@ -142,6 +142,10 @@ struct pt_regs; #define __SYSCALL_ANNOTATE(name, ret_type) name, __SYSCALL_RET_T##ret_type #define SYSCALL_PREP(name, ...) __SYSCALL_ANNOTATE(_##name, __VA_ARGS__) +#ifdef CONFIG_FTRACE_SYSCALLS +#define SYSCALL_METADATA(x, name, ret_type, ...) \
- __SYSCALL_METADATA(x, name, __VA_ARGS__)
+#endif
Nit: it looks a bit strange without an empty line to separate it from the comment, I would add one.
Happy with the series otherwise, if you're happy with that I can add the newline when merging the series.
If that's not too much to ask go ahead and amend the commit, otherwise let me know and I will respin the series with this fix.
On a side note: Zachary did add his 'tested-by' so he might want to have a second look at this version and decide whether to keep his tag on that one (?) @Zachary
Thanks.
--- B.
Kevin
/*
- Some syscalls with no parameters return valid capabilities, so __SYSCALL_DEFINE0
- is added to handle such cases.