From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Patrice Chotard <patrice.chotard@foss.st.com>,
Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2] usb: dwc3: Don't use %pK through printk
Date: Wed, 19 Feb 2025 22:43:25 +0000 [thread overview]
Message-ID: <20250219224317.o4usb7flepnvbide@synopsys.com> (raw)
In-Reply-To: <20250217-restricted-pointers-usb-v1-2-78da55158832@linutronix.de>
On Mon, Feb 17, 2025, Thomas Weißschuh wrote:
> Restricted pointers ("%pK") are not meant to be used through printk().
> It can unintentionally expose security sensitive, raw pointer values.
>
> Use regular pointer formatting instead.
>
> Link: https://urldefense.com/v3/__https://lore.kernel.org/lkml/20250113171731-dc10e3c1-da64-4af0-b767-7c7070468023@linutronix.de/__;!!A4F2R9G_pg!aL6340JEjoiSy7grYBE9C7kitN3lR7BsH4zWSkY6QKPCrC_SDBPIL8rZaoIXxABAdIRsEC2YPI_AtCU9tMrD1byOXeZ93YpywfAFLw$
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> drivers/usb/dwc3/dwc3-st.c | 2 +-
> drivers/usb/dwc3/gadget.c | 6 +++---
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
> index ef7c43008946e15b72d88aba4941dc52bf0788d7..5d513decaacd22de15825dc061c2747cf09fef07 100644
> --- a/drivers/usb/dwc3/dwc3-st.c
> +++ b/drivers/usb/dwc3/dwc3-st.c
> @@ -225,7 +225,7 @@ static int st_dwc3_probe(struct platform_device *pdev)
>
> dwc3_data->syscfg_reg_off = res->start;
>
> - dev_vdbg(dev, "glue-logic addr 0x%pK, syscfg-reg offset 0x%x\n",
> + dev_vdbg(dev, "glue-logic addr 0x%p, syscfg-reg offset 0x%x\n",
> dwc3_data->glue_base, dwc3_data->syscfg_reg_off);
>
> struct device_node *child __free(device_node) = of_get_compatible_child(node,
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index ddd6b2ce57107cb62c5cec02eae3fe3524164469..7ea1dcd07f02999c913f1520ec05bbcf1a43d8d5 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -1971,12 +1971,12 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
> return -ESHUTDOWN;
> }
>
> - if (WARN(req->dep != dep, "request %pK belongs to '%s'\n",
> + if (WARN(req->dep != dep, "request %p belongs to '%s'\n",
> &req->request, req->dep->name))
> return -EINVAL;
>
> if (WARN(req->status < DWC3_REQUEST_STATUS_COMPLETED,
> - "%s: request %pK already in flight\n",
> + "%s: request %p already in flight\n",
> dep->name, &req->request))
> return -EINVAL;
>
> @@ -2165,7 +2165,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
> }
> }
>
> - dev_err(dwc->dev, "request %pK was not queued to %s\n",
> + dev_err(dwc->dev, "request %p was not queued to %s\n",
> request, ep->name);
> ret = -EINVAL;
> out:
>
> --
> 2.48.1
>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Thanks,
Thinh
prev parent reply other threads:[~2025-02-19 22:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-17 13:20 [PATCH 0/2] usb: Don't use %pK through printk Thomas Weißschuh
2025-02-17 13:20 ` [PATCH 1/2] usb: core: " Thomas Weißschuh
2025-02-17 13:52 ` Greg Kroah-Hartman
2025-02-17 14:50 ` Thomas Weißschuh
2025-02-18 8:10 ` Greg Kroah-Hartman
2025-02-17 13:20 ` [PATCH 2/2] usb: dwc3: " Thomas Weißschuh
2025-02-19 22:43 ` Thinh Nguyen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250219224317.o4usb7flepnvbide@synopsys.com \
--to=thinh.nguyen@synopsys.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=patrice.chotard@foss.st.com \
--cc=thomas.weissschuh@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.