Skip to content

Commit 042c3dd

Browse files
t-8chgregkh
authored andcommitted
usb: dwc3: Don't use %pK through printk
This is a revert of commit 04fb365 ("usb: dwc3: replace %p with %pK") When the formatting was changed from %p to %pK that was a security improvement, as %p would leak raw pointer values to the kernel log. Since commit ad67b74 ("printk: hash addresses printed with %p") the regular %p has been improved to avoid this issue. On the other hand, restricted pointers ("%pK") were never meant to be used through printk(). They can unintentionally still leak raw pointers or acquire sleeping looks in atomic contexts. Switch back to regular %p again. Link: https://lore.kernel.org/lkml/20250113171731-dc10e3c1-da64-4af0-b767-7c7070468023@linutronix.de/ Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Link: https://lore.kernel.org/r/20250310-restricted-pointers-usb-v2-2-a7598e2d47d1@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f4aa6ca commit 042c3dd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/usb/dwc3/dwc3-st.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static int st_dwc3_probe(struct platform_device *pdev)
225225

226226
dwc3_data->syscfg_reg_off = res->start;
227227

228-
dev_vdbg(dev, "glue-logic addr 0x%pK, syscfg-reg offset 0x%x\n",
228+
dev_vdbg(dev, "glue-logic addr 0x%p, syscfg-reg offset 0x%x\n",
229229
dwc3_data->glue_base, dwc3_data->syscfg_reg_off);
230230

231231
struct device_node *child __free(device_node) = of_get_compatible_child(node,

drivers/usb/dwc3/gadget.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,12 +1979,12 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
19791979
return -ESHUTDOWN;
19801980
}
19811981

1982-
if (WARN(req->dep != dep, "request %pK belongs to '%s'\n",
1982+
if (WARN(req->dep != dep, "request %p belongs to '%s'\n",
19831983
&req->request, req->dep->name))
19841984
return -EINVAL;
19851985

19861986
if (WARN(req->status < DWC3_REQUEST_STATUS_COMPLETED,
1987-
"%s: request %pK already in flight\n",
1987+
"%s: request %p already in flight\n",
19881988
dep->name, &req->request))
19891989
return -EINVAL;
19901990

@@ -2173,7 +2173,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
21732173
}
21742174
}
21752175

2176-
dev_err(dwc->dev, "request %pK was not queued to %s\n",
2176+
dev_err(dwc->dev, "request %p was not queued to %s\n",
21772177
request, ep->name);
21782178
ret = -EINVAL;
21792179
out:

0 commit comments

Comments
 (0)