From: He Zhe <[email protected]>
tail is a pointer while buftail.fp is a u32.
arch/arm64/kernel/perf_callchain.c:100:6: warning: cast from pointer to
integer of different size [-Wpointer-to-int-cast]
100 | if ((u32)tail + 4 >= buftail.fp)
| ^
arch/arm64/kernel/perf_callchain.c:103:9: warning: cast to pointer from
integer of different size [-Wint-to-pointer-cast]{noformat}
103 | return (struct compat_frame_tail __user *)(buftail.fp - 4);
| ^
Fixes: 8818670c17d2 ("arm64/perf: fix backtrace for AAPCS with FP enabled")
Signed-off-by: He Zhe <[email protected]>
---
arch/arm64/kernel/perf_callchain.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kernel/perf_callchain.c
b/arch/arm64/kernel/perf_callchain.c
index 1be96e3631ea..a4b0864c4e32 100644
--- a/arch/arm64/kernel/perf_callchain.c
+++ b/arch/arm64/kernel/perf_callchain.c
@@ -97,10 +97,10 @@ compat_user_backtrace(struct compat_frame_tail __user *tail,
* Frame pointers should strictly progress back up the stack
* (towards higher addresses).
*/
- if ((u32)tail + 4 >= buftail.fp)
+ if ((u64)tail + 4 >= (u64)buftail.fp)
return NULL;
- return (struct compat_frame_tail __user *)(buftail.fp - 4);
+ return (struct compat_frame_tail __user *)((u64)buftail.fp - 4);
}
#endif /* CONFIG_COMPAT */
--
2.17.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8980):
https://lists.yoctoproject.org/g/linux-yocto/message/8980
Mute This Topic: https://lists.yoctoproject.org/mt/76312403/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-