staging: android: Change %p to %pK in debug messages
The format specifier %p can leak kernel addresses
while not valuing the kptr_restrict system settings.
Use %pK instead of %p, which also evaluates whether
kptr_restrict is set.
Bug: 30148243
Change-Id: Ib1adf14e9620ad7b1bd3e962001c852610210d46
Signed-off-by: Divya Ponnusamy <pdivya@codeaurora.org>
diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index d094e29..115ef2e 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -611,14 +611,14 @@
return err;
if (fence->status < 0) {
- pr_info("fence error %d on [%p]\n", fence->status, fence);
+ pr_info("fence error %d on [%pK]\n", fence->status, fence);
sync_dump(fence);
return fence->status;
}
if (fence->status == 0) {
if (timeout > 0) {
- pr_info("fence timeout on [%p] after %dms\n", fence,
+ pr_info("fence timeout on [%pK] after %dms\n", fence,
jiffies_to_msecs(timeout));
sync_dump(fence);
}
@@ -914,7 +914,7 @@
struct list_head *pos;
unsigned long flags;
- seq_printf(s, "[%p] %s: %s\n", fence, fence->name,
+ seq_printf(s, "[%pK] %s: %s\n", fence, fence->name,
sync_status_str(fence->status));
list_for_each(pos, &fence->pt_list_head) {