From: Amit Daniel Kachhap <hidden> Date: 2021-09-17 05:58:25
Annotating a pointer from kernel to __user and then back again requires
an extra __force annotation to silent sparse warning. In call_undef_hook()
this unnecessary complexity can be avoided by modifying the intermediate
user pointer to unsigned long.
This way there is no inter-changeable use of user and kernel pointers
and the code is consistent.
Note: This patch adds no functional changes to code.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Amit Daniel Kachhap <redacted>
---
Changes from v1:
* Instead of directly using instruction_pointer() for kernel pointers,
modified the pc type from void __user * to unsigned long as suggested
by Mark Rutland.
arch/arm64/kernel/traps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Mark Rutland <mark.rutland@arm.com> Date: 2021-09-17 09:36:48
On Fri, Sep 17, 2021 at 11:28:11AM +0530, Amit Daniel Kachhap wrote:
Annotating a pointer from kernel to __user and then back again requires
an extra __force annotation to silent sparse warning. In call_undef_hook()
this unnecessary complexity can be avoided by modifying the intermediate
user pointer to unsigned long.
This way there is no inter-changeable use of user and kernel pointers
and the code is consistent.
Note: This patch adds no functional changes to code.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Amit Daniel Kachhap <redacted>
I like that this clarifies that `pc` is not necessarily a user pointer,
and this makes the relevant lines shorter and eaier to read, so FWIW:
Acked-by: Mark Rutland <mark.rutland@arm.com>
Thanks,
Mark.
quoted hunk
---
Changes from v1:
* Instead of directly using instruction_pointer() for kernel pointers,
modified the pc type from void __user * to unsigned long as suggested
by Mark Rutland.
arch/arm64/kernel/traps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Will Deacon <will@kernel.org> Date: 2021-09-29 17:48:37
On Fri, 17 Sep 2021 11:28:11 +0530, Amit Daniel Kachhap wrote:
Annotating a pointer from kernel to __user and then back again requires
an extra __force annotation to silent sparse warning. In call_undef_hook()
this unnecessary complexity can be avoided by modifying the intermediate
user pointer to unsigned long.
This way there is no inter-changeable use of user and kernel pointers
and the code is consistent.
[...]