diff options
author | Vamsi Krishna Samavedam <vskrishn@codeaurora.org> | 2016-11-03 17:06:34 -0700 |
---|---|---|
committer | Hemant Kumar <hemantk@codeaurora.org> | 2017-01-04 10:29:58 -0800 |
commit | 97e9f8a4c8626ec5dc85ea1015b46acfff3685e4 (patch) | |
tree | 924e149d5c6bd8d8dab7d62a7097f2b497f2a464 /drivers/usb/host/uhci-debug.c | |
parent | 054b950dfd1c9a33f093b4499438a6f7d19a2716 (diff) |
usb: host: replace %p with %pK
Format specifier %p can leak kernel addresses while not valuing the
kptr_restrict system settings. When kptr_restrict is set to (1), kernel
pointers printed using the %pK format specifier will be replaced with 0's.
Debugging Note : &pK prints only Zeros as address. If you need actual
address information, write zero to kptr_restrict.
echo 0 > /proc/sys/kernel/kptr_restrict
Change-Id: Ib2b999693224b33241141e290b70724f9e27183f
Signed-off-by: Vamsi Krishna Samavedam <vskrishn@codeaurora.org>
Diffstat (limited to 'drivers/usb/host/uhci-debug.c')
-rw-r--r-- | drivers/usb/host/uhci-debug.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index 1b28a000d5c6..466ab4fa289e 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c @@ -47,7 +47,7 @@ static int uhci_show_td(struct uhci_hcd *uhci, struct uhci_td *td, char *buf, u32 status, token; status = td_status(uhci, td); - out += sprintf(out, "%*s[%p] link (%08x) ", space, "", td, + out += sprintf(out, "%*s[%pK] link (%08x) ", space, "", td, hc32_to_cpu(uhci, td->link)); out += sprintf(out, "e%d %s%s%s%s%s%s%s%s%s%sLength=%x ", ((status >> 27) & 3), @@ -105,9 +105,9 @@ static int uhci_show_urbp(struct uhci_hcd *uhci, struct urb_priv *urbp, char *ptype; - out += sprintf(out, "urb_priv [%p] ", urbp); - out += sprintf(out, "urb [%p] ", urbp->urb); - out += sprintf(out, "qh [%p] ", urbp->qh); + out += sprintf(out, "urb_priv [%pK] ", urbp); + out += sprintf(out, "urb [%pK] ", urbp->urb); + out += sprintf(out, "qh [%pK] ", urbp->qh); out += sprintf(out, "Dev=%d ", usb_pipedevice(urbp->urb->pipe)); out += sprintf(out, "EP=%x(%s) ", usb_pipeendpoint(urbp->urb->pipe), (usb_pipein(urbp->urb->pipe) ? "IN" : "OUT")); @@ -177,13 +177,13 @@ static int uhci_show_qh(struct uhci_hcd *uhci, default: qtype = "Skel" ; break; } - out += sprintf(out, "%*s[%p] %s QH link (%08x) element (%08x)\n", + out += sprintf(out, "%*s[%pK] %s QH link (%08x) element (%08x)\n", space, "", qh, qtype, hc32_to_cpu(uhci, qh->link), hc32_to_cpu(uhci, element)); if (qh->type == USB_ENDPOINT_XFER_ISOC) out += sprintf(out, - "%*s period %d phase %d load %d us, frame %x desc [%p]\n", + "%*s period %d phase %d load %d us, frame %x desc [%pK]\n", space, "", qh->period, qh->phase, qh->load, qh->iso_frame, qh->iso_packet_desc); else if (qh->type == USB_ENDPOINT_XFER_INT) |