* [PATCH] drm/msm/dpu: Don't use %pK through printk (again)
@ 2026-02-23 7:16 Thomas Weißschuh
2026-02-23 23:31 ` Dmitry Baryshkov
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2026-02-23 7:16 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel,
Thomas Weißschuh
In the past %pK was preferable to %p as it would not leak raw pointer
values into the kernel log.
Since commit ad67b74d2469 ("printk: hash addresses printed with %p")
the regular %p has been improved to avoid this issue.
Furthermore, restricted pointers ("%pK") were never meant to be used
through printk(). They can still unintentionally leak raw pointers or
acquire sleeping locks in atomic contexts.
Switch to the regular pointer formatting which is safer and
easier to reason about.
This was previously fixed in this driver in commit 1ba9fbe40337
("drm/msm: Don't use %pK through printk") but an additional usage
was reintroduced in commit 39a750ff5fc9 ("drm/msm/dpu: Add DSPP GC
driver to provide GAMMA_LUT DRM property")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c
index 188ee0af2c90..23dcbe1ce1b8 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c
@@ -89,7 +89,7 @@ static void dpu_setup_dspp_gc(struct dpu_hw_dspp *ctx,
base = ctx->cap->sblk->gc.base;
if (!base) {
- DRM_ERROR("invalid ctx %pK gc base\n", ctx);
+ DRM_ERROR("invalid ctx %p gc base\n", ctx);
return;
}
---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20260223-restricted-pointers-msm-d6af3dbf14b6
Best regards,
--
Thomas Weißschuh <thomas.weissschuh@linutronix.de>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/msm/dpu: Don't use %pK through printk (again)
2026-02-23 7:16 [PATCH] drm/msm/dpu: Don't use %pK through printk (again) Thomas Weißschuh
@ 2026-02-23 23:31 ` Dmitry Baryshkov
2026-02-24 0:32 ` Claude review: " Claude Code Review Bot
2026-02-24 0:32 ` Claude Code Review Bot
2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2026-02-23 23:31 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
linux-arm-msm, dri-devel, freedreno, linux-kernel
On Mon, Feb 23, 2026 at 08:16:55AM +0100, Thomas Weißschuh wrote:
> In the past %pK was preferable to %p as it would not leak raw pointer
> values into the kernel log.
> Since commit ad67b74d2469 ("printk: hash addresses printed with %p")
> the regular %p has been improved to avoid this issue.
> Furthermore, restricted pointers ("%pK") were never meant to be used
> through printk(). They can still unintentionally leak raw pointers or
> acquire sleeping locks in atomic contexts.
>
> Switch to the regular pointer formatting which is safer and
> easier to reason about.
>
> This was previously fixed in this driver in commit 1ba9fbe40337
> ("drm/msm: Don't use %pK through printk") but an additional usage
> was reintroduced in commit 39a750ff5fc9 ("drm/msm/dpu: Add DSPP GC
> driver to provide GAMMA_LUT DRM property")
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Fixes: 39a750ff5fc9 ("drm/msm/dpu: Add DSPP GC driver to provide GAMMA_LUT DRM property")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Claude review: drm/msm/dpu: Don't use %pK through printk (again)
2026-02-23 7:16 [PATCH] drm/msm/dpu: Don't use %pK through printk (again) Thomas Weißschuh
2026-02-23 23:31 ` Dmitry Baryshkov
2026-02-24 0:32 ` Claude review: " Claude Code Review Bot
@ 2026-02-24 0:32 ` Claude Code Review Bot
2 siblings, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-02-24 0:32 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: drm/msm/dpu: Don't use %pK through printk (again)
Author: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <thomas.weissschuh@linutronix.de>
Patches: 2
Reviewed: 2026-02-24T10:32:44.728650
---
This is a single-patch series that changes a `%pK` format specifier to `%p` in a DRM_ERROR() call in the MSM DPU DSPP driver. The motivation is well-established kernel policy: since commit ad67b74d2469, regular `%p` hashes pointer values in printk output, making `%pK` unnecessary. Worse, `%pK` was never designed for use through printk and can leak raw pointers or take sleeping locks in atomic contexts.
The patch is trivially correct. It has already received a Reviewed-by from Dmitry Baryshkov. No issues found.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 4+ messages in thread
* Claude review: drm/msm/dpu: Don't use %pK through printk (again)
2026-02-23 7:16 [PATCH] drm/msm/dpu: Don't use %pK through printk (again) Thomas Weißschuh
2026-02-23 23:31 ` Dmitry Baryshkov
@ 2026-02-24 0:32 ` Claude Code Review Bot
2026-02-24 0:32 ` Claude Code Review Bot
2 siblings, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-02-24 0:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
> - DRM_ERROR("invalid ctx %pK gc base\n", ctx);
> + DRM_ERROR("invalid ctx %p gc base\n", ctx);
Straightforward `%pK` to `%p` conversion. No issues.
The commit message is well-written: it explains the rationale (why `%pK` is problematic), references the original cleanup commit (1ba9fbe40337) and the commit that reintroduced the usage (39a750ff5fc9). Dmitry's review reply also suggests adding a `Fixes:` tag for the latter commit, which would be a good addition for backporting purposes.
One minor note: the error message itself (`"invalid ctx %p gc base"`) is somewhat confusing -- it's the `gc.base` field that is invalid (zero), not `ctx` itself. But that's pre-existing text not introduced by this patch, so not relevant to this review.
No issues found in this patch.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-02-24 0:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-23 7:16 [PATCH] drm/msm/dpu: Don't use %pK through printk (again) Thomas Weißschuh
2026-02-23 23:31 ` Dmitry Baryshkov
2026-02-24 0:32 ` Claude review: " Claude Code Review Bot
2026-02-24 0:32 ` Claude Code Review Bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox