From ee519781a1c67e404002e667738b13f743b02336 Mon Sep 17 00:00:00 2001 From: Divya Ponnusamy <pdivya@codeaurora.org> Date: Wed, 15 Jun 2016 16:22:11 +0530 Subject: [PATCH] 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> --- drivers/staging/android/sync.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index d094e292f008..115ef2e88bb5 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -611,14 +611,14 @@ int sync_fence_wait(struct sync_fence *fence, long timeout) 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 @@ static void sync_print_fence(struct seq_file *s, struct sync_fence *fence) 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) { -- GitLab