* [PATCH 0/3] drm: Don't use %pK through printk
@ 2025-06-18 7:52 Thomas Weißschuh
2025-06-18 7:52 ` [PATCH 1/3] drm/bridge: samsung-dsim: " Thomas Weißschuh
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Thomas Weißschuh @ 2025-06-18 7:52 UTC (permalink / raw)
To: Inki Dae, Jagan Teki, Marek Szyprowski, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Seung-Woo Kim,
Kyungmin Park, Krzysztof Kozlowski, Alim Akhtar, Rob Clark,
Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-samsung-soc,
linux-arm-msm, freedreno, 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.
There is still a user of %pK left, but this uses it through seq_file,
for which its usage is safe.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
Thomas Weißschuh (3):
drm/bridge: samsung-dsim: Don't use %pK through printk
drm/exynos: Don't use %pK through printk
drm/msm: Don't use %pK through printk
drivers/gpu/drm/bridge/samsung-dsim.c | 4 ++--
drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +-
drivers/gpu/drm/exynos/exynos_drm_ipp.c | 32 ++++++++++++++---------------
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c | 4 ++--
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 4 ++--
drivers/gpu/drm/msm/msm_mdss.c | 2 +-
7 files changed, 25 insertions(+), 25 deletions(-)
---
base-commit: f09079bd04a924c72d555cd97942d5f8d7eca98c
change-id: 20250404-restricted-pointers-drm-87b703679fad
Best regards,
--
Thomas Weißschuh <thomas.weissschuh@linutronix.de>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] drm/bridge: samsung-dsim: Don't use %pK through printk
2025-06-18 7:52 [PATCH 0/3] drm: Don't use %pK through printk Thomas Weißschuh
@ 2025-06-18 7:52 ` Thomas Weißschuh
2025-06-27 2:00 ` Inki Dae
2025-06-18 7:52 ` [PATCH 2/3] drm/exynos: " Thomas Weißschuh
2025-06-18 7:52 ` [PATCH 3/3] drm/msm: " Thomas Weißschuh
2 siblings, 1 reply; 6+ messages in thread
From: Thomas Weißschuh @ 2025-06-18 7:52 UTC (permalink / raw)
To: Inki Dae, Jagan Teki, Marek Szyprowski, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Seung-Woo Kim,
Kyungmin Park, Krzysztof Kozlowski, Alim Akhtar, Rob Clark,
Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-samsung-soc,
linux-arm-msm, freedreno, 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.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
drivers/gpu/drm/bridge/samsung-dsim.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c
index 0014c497e3fe7d8349a119dbdda30d65d816cccf..bccc88d2594840647d7107c13d69104912087384 100644
--- a/drivers/gpu/drm/bridge/samsung-dsim.c
+++ b/drivers/gpu/drm/bridge/samsung-dsim.c
@@ -1095,7 +1095,7 @@ static void samsung_dsim_send_to_fifo(struct samsung_dsim *dsi,
bool first = !xfer->tx_done;
u32 reg;
- dev_dbg(dev, "< xfer %pK: tx len %u, done %u, rx len %u, done %u\n",
+ dev_dbg(dev, "< xfer %p: tx len %u, done %u, rx len %u, done %u\n",
xfer, length, xfer->tx_done, xfer->rx_len, xfer->rx_done);
if (length > DSI_TX_FIFO_SIZE)
@@ -1293,7 +1293,7 @@ static bool samsung_dsim_transfer_finish(struct samsung_dsim *dsi)
spin_unlock_irqrestore(&dsi->transfer_lock, flags);
dev_dbg(dsi->dev,
- "> xfer %pK, tx_len %zu, tx_done %u, rx_len %u, rx_done %u\n",
+ "> xfer %p, tx_len %zu, tx_done %u, rx_len %u, rx_done %u\n",
xfer, xfer->packet.payload_length, xfer->tx_done, xfer->rx_len,
xfer->rx_done);
--
2.49.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] drm/exynos: Don't use %pK through printk
2025-06-18 7:52 [PATCH 0/3] drm: Don't use %pK through printk Thomas Weißschuh
2025-06-18 7:52 ` [PATCH 1/3] drm/bridge: samsung-dsim: " Thomas Weißschuh
@ 2025-06-18 7:52 ` Thomas Weißschuh
2025-06-27 2:02 ` Inki Dae
2025-06-18 7:52 ` [PATCH 3/3] drm/msm: " Thomas Weißschuh
2 siblings, 1 reply; 6+ messages in thread
From: Thomas Weißschuh @ 2025-06-18 7:52 UTC (permalink / raw)
To: Inki Dae, Jagan Teki, Marek Szyprowski, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Seung-Woo Kim,
Kyungmin Park, Krzysztof Kozlowski, Alim Akhtar, Rob Clark,
Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-samsung-soc,
linux-arm-msm, freedreno, 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.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +-
drivers/gpu/drm/exynos/exynos_drm_ipp.c | 32 ++++++++++++++++----------------
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index 4787fee4696f8e6f9eecaacb1535765c246688c8..d44401a695e203bd36b3b6678fdeb3572a91bfda 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -174,7 +174,7 @@ static struct exynos_drm_gem *exynos_drm_gem_init(struct drm_device *dev,
return ERR_PTR(ret);
}
- DRM_DEV_DEBUG_KMS(dev->dev, "created file object = %pK\n", obj->filp);
+ DRM_DEV_DEBUG_KMS(dev->dev, "created file object = %p\n", obj->filp);
return exynos_gem;
}
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index ea9f66037600e1020da4b0a9c318ca2f2266a871..03c8490af4f45447d123a20777e5362ebd933b46 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -271,7 +271,7 @@ static inline struct exynos_drm_ipp_task *
task->src.rect.h = task->dst.rect.h = UINT_MAX;
task->transform.rotation = DRM_MODE_ROTATE_0;
- DRM_DEV_DEBUG_DRIVER(task->dev, "Allocated task %pK\n", task);
+ DRM_DEV_DEBUG_DRIVER(task->dev, "Allocated task %p\n", task);
return task;
}
@@ -339,7 +339,7 @@ static int exynos_drm_ipp_task_set(struct exynos_drm_ipp_task *task,
}
DRM_DEV_DEBUG_DRIVER(task->dev,
- "Got task %pK configuration from userspace\n",
+ "Got task %p configuration from userspace\n",
task);
return 0;
}
@@ -394,7 +394,7 @@ static void exynos_drm_ipp_task_release_buf(struct exynos_drm_ipp_buffer *buf)
static void exynos_drm_ipp_task_free(struct exynos_drm_ipp *ipp,
struct exynos_drm_ipp_task *task)
{
- DRM_DEV_DEBUG_DRIVER(task->dev, "Freeing task %pK\n", task);
+ DRM_DEV_DEBUG_DRIVER(task->dev, "Freeing task %p\n", task);
exynos_drm_ipp_task_release_buf(&task->src);
exynos_drm_ipp_task_release_buf(&task->dst);
@@ -559,7 +559,7 @@ static int exynos_drm_ipp_check_format(struct exynos_drm_ipp_task *task,
DRM_EXYNOS_IPP_FORMAT_DESTINATION);
if (!fmt) {
DRM_DEV_DEBUG_DRIVER(task->dev,
- "Task %pK: %s format not supported\n",
+ "Task %p: %s format not supported\n",
task, buf == src ? "src" : "dst");
return -EINVAL;
}
@@ -609,7 +609,7 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task)
bool rotate = (rotation != DRM_MODE_ROTATE_0);
bool scale = false;
- DRM_DEV_DEBUG_DRIVER(task->dev, "Checking task %pK\n", task);
+ DRM_DEV_DEBUG_DRIVER(task->dev, "Checking task %p\n", task);
if (src->rect.w == UINT_MAX)
src->rect.w = src->buf.width;
@@ -625,7 +625,7 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task)
dst->rect.x + dst->rect.w > (dst->buf.width) ||
dst->rect.y + dst->rect.h > (dst->buf.height)) {
DRM_DEV_DEBUG_DRIVER(task->dev,
- "Task %pK: defined area is outside provided buffers\n",
+ "Task %p: defined area is outside provided buffers\n",
task);
return -EINVAL;
}
@@ -642,7 +642,7 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task)
(!(ipp->capabilities & DRM_EXYNOS_IPP_CAP_SCALE) && scale) ||
(!(ipp->capabilities & DRM_EXYNOS_IPP_CAP_CONVERT) &&
src->buf.fourcc != dst->buf.fourcc)) {
- DRM_DEV_DEBUG_DRIVER(task->dev, "Task %pK: hw capabilities exceeded\n",
+ DRM_DEV_DEBUG_DRIVER(task->dev, "Task %p: hw capabilities exceeded\n",
task);
return -EINVAL;
}
@@ -655,7 +655,7 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task)
if (ret)
return ret;
- DRM_DEV_DEBUG_DRIVER(ipp->dev, "Task %pK: all checks done.\n",
+ DRM_DEV_DEBUG_DRIVER(ipp->dev, "Task %p: all checks done.\n",
task);
return ret;
@@ -667,25 +667,25 @@ static int exynos_drm_ipp_task_setup_buffers(struct exynos_drm_ipp_task *task,
struct exynos_drm_ipp_buffer *src = &task->src, *dst = &task->dst;
int ret = 0;
- DRM_DEV_DEBUG_DRIVER(task->dev, "Setting buffer for task %pK\n",
+ DRM_DEV_DEBUG_DRIVER(task->dev, "Setting buffer for task %p\n",
task);
ret = exynos_drm_ipp_task_setup_buffer(src, filp);
if (ret) {
DRM_DEV_DEBUG_DRIVER(task->dev,
- "Task %pK: src buffer setup failed\n",
+ "Task %p: src buffer setup failed\n",
task);
return ret;
}
ret = exynos_drm_ipp_task_setup_buffer(dst, filp);
if (ret) {
DRM_DEV_DEBUG_DRIVER(task->dev,
- "Task %pK: dst buffer setup failed\n",
+ "Task %p: dst buffer setup failed\n",
task);
return ret;
}
- DRM_DEV_DEBUG_DRIVER(task->dev, "Task %pK: buffers prepared.\n",
+ DRM_DEV_DEBUG_DRIVER(task->dev, "Task %p: buffers prepared.\n",
task);
return ret;
@@ -764,7 +764,7 @@ void exynos_drm_ipp_task_done(struct exynos_drm_ipp_task *task, int ret)
struct exynos_drm_ipp *ipp = task->ipp;
unsigned long flags;
- DRM_DEV_DEBUG_DRIVER(task->dev, "ipp: %d, task %pK done: %d\n",
+ DRM_DEV_DEBUG_DRIVER(task->dev, "ipp: %d, task %p done: %d\n",
ipp->id, task, ret);
spin_lock_irqsave(&ipp->lock, flags);
@@ -807,7 +807,7 @@ static void exynos_drm_ipp_next_task(struct exynos_drm_ipp *ipp)
spin_unlock_irqrestore(&ipp->lock, flags);
DRM_DEV_DEBUG_DRIVER(ipp->dev,
- "ipp: %d, selected task %pK to run\n", ipp->id,
+ "ipp: %d, selected task %p to run\n", ipp->id,
task);
ret = ipp->funcs->commit(ipp, task);
@@ -917,14 +917,14 @@ int exynos_drm_ipp_commit_ioctl(struct drm_device *dev, void *data,
*/
if (arg->flags & DRM_EXYNOS_IPP_FLAG_NONBLOCK) {
DRM_DEV_DEBUG_DRIVER(ipp->dev,
- "ipp: %d, nonblocking processing task %pK\n",
+ "ipp: %d, nonblocking processing task %p\n",
ipp->id, task);
task->flags |= DRM_EXYNOS_IPP_TASK_ASYNC;
exynos_drm_ipp_schedule_task(task->ipp, task);
ret = 0;
} else {
- DRM_DEV_DEBUG_DRIVER(ipp->dev, "ipp: %d, processing task %pK\n",
+ DRM_DEV_DEBUG_DRIVER(ipp->dev, "ipp: %d, processing task %p\n",
ipp->id, task);
exynos_drm_ipp_schedule_task(ipp, task);
ret = wait_event_interruptible(ipp->done_wq,
--
2.49.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] drm/msm: Don't use %pK through printk
2025-06-18 7:52 [PATCH 0/3] drm: Don't use %pK through printk Thomas Weißschuh
2025-06-18 7:52 ` [PATCH 1/3] drm/bridge: samsung-dsim: " Thomas Weißschuh
2025-06-18 7:52 ` [PATCH 2/3] drm/exynos: " Thomas Weißschuh
@ 2025-06-18 7:52 ` Thomas Weißschuh
2 siblings, 0 replies; 6+ messages in thread
From: Thomas Weißschuh @ 2025-06-18 7:52 UTC (permalink / raw)
To: Inki Dae, Jagan Teki, Marek Szyprowski, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Seung-Woo Kim,
Kyungmin Park, Krzysztof Kozlowski, Alim Akhtar, Rob Clark,
Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
Marijn Suijten
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-samsung-soc,
linux-arm-msm, freedreno, 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.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c | 4 ++--
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 4 ++--
drivers/gpu/drm/msm/msm_mdss.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index a4b0fe0d9899b32141928f0b6a16503a49b3c27a..9aa635f9462df6e496635e3316217f0245e03157 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -565,7 +565,7 @@ static void _dpu_crtc_complete_flip(struct drm_crtc *crtc)
spin_lock_irqsave(&dev->event_lock, flags);
if (dpu_crtc->event) {
- DRM_DEBUG_VBL("%s: send event: %pK\n", dpu_crtc->name,
+ DRM_DEBUG_VBL("%s: send event: %p\n", dpu_crtc->name,
dpu_crtc->event);
trace_dpu_crtc_complete_flip(DRMID(crtc));
drm_crtc_send_vblank_event(crtc, dpu_crtc->event);
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 829ca272873e45b122c04bea7da22dc569732e10..08cb1014299bcc9ce146b564721a6058df824cf0 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c
@@ -31,14 +31,14 @@ static void dpu_setup_dspp_pcc(struct dpu_hw_dspp *ctx,
u32 base;
if (!ctx) {
- DRM_ERROR("invalid ctx %pK\n", ctx);
+ DRM_ERROR("invalid ctx %p\n", ctx);
return;
}
base = ctx->cap->sblk->pcc.base;
if (!base) {
- DRM_ERROR("invalid ctx %pK pcc base 0x%x\n", ctx, base);
+ DRM_ERROR("invalid ctx %p pcc base 0x%x\n", ctx, base);
return;
}
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index 1fd82b6747e9058ce11dc2620729921492d5ebdd..4290ef3004985376ebd13afd1f014265cf887490 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -1345,7 +1345,7 @@ static int dpu_kms_mmap_mdp5(struct dpu_kms *dpu_kms)
dpu_kms->mmio = NULL;
return ret;
}
- DRM_DEBUG("mapped dpu address space @%pK\n", dpu_kms->mmio);
+ DRM_DEBUG("mapped dpu address space @%p\n", dpu_kms->mmio);
dpu_kms->vbif[VBIF_RT] = msm_ioremap_mdss(mdss_dev,
dpu_kms->pdev,
@@ -1380,7 +1380,7 @@ static int dpu_kms_mmap_dpu(struct dpu_kms *dpu_kms)
dpu_kms->mmio = NULL;
return ret;
}
- DRM_DEBUG("mapped dpu address space @%pK\n", dpu_kms->mmio);
+ DRM_DEBUG("mapped dpu address space @%p\n", dpu_kms->mmio);
dpu_kms->vbif[VBIF_RT] = msm_ioremap(pdev, "vbif");
if (IS_ERR(dpu_kms->vbif[VBIF_RT])) {
diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
index 709979fcfab6062c0f316f7655823e888638bfea..c5e6e98e0ced3adae9086b220fc9d5d026ac3fd1 100644
--- a/drivers/gpu/drm/msm/msm_mdss.c
+++ b/drivers/gpu/drm/msm/msm_mdss.c
@@ -456,7 +456,7 @@ static struct msm_mdss *msm_mdss_init(struct platform_device *pdev, bool is_mdp5
if (IS_ERR(msm_mdss->mmio))
return ERR_CAST(msm_mdss->mmio);
- dev_dbg(&pdev->dev, "mapped mdss address space @%pK\n", msm_mdss->mmio);
+ dev_dbg(&pdev->dev, "mapped mdss address space @%p\n", msm_mdss->mmio);
ret = msm_mdss_parse_data_bus_icc_path(&pdev->dev, msm_mdss);
if (ret)
--
2.49.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] drm/bridge: samsung-dsim: Don't use %pK through printk
2025-06-18 7:52 ` [PATCH 1/3] drm/bridge: samsung-dsim: " Thomas Weißschuh
@ 2025-06-27 2:00 ` Inki Dae
0 siblings, 0 replies; 6+ messages in thread
From: Inki Dae @ 2025-06-27 2:00 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Jagan Teki, Marek Szyprowski, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Seung-Woo Kim, Kyungmin Park, Krzysztof Kozlowski,
Alim Akhtar, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-samsung-soc, linux-arm-msm, freedreno
Hi,
2025년 6월 18일 (수) 오후 4:56, Thomas Weißschuh
<thomas.weissschuh@linutronix.de>님이 작성:
>
> 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.
Applied.
Thanks,
Inki Dae
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> drivers/gpu/drm/bridge/samsung-dsim.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c
> index 0014c497e3fe7d8349a119dbdda30d65d816cccf..bccc88d2594840647d7107c13d69104912087384 100644
> --- a/drivers/gpu/drm/bridge/samsung-dsim.c
> +++ b/drivers/gpu/drm/bridge/samsung-dsim.c
> @@ -1095,7 +1095,7 @@ static void samsung_dsim_send_to_fifo(struct samsung_dsim *dsi,
> bool first = !xfer->tx_done;
> u32 reg;
>
> - dev_dbg(dev, "< xfer %pK: tx len %u, done %u, rx len %u, done %u\n",
> + dev_dbg(dev, "< xfer %p: tx len %u, done %u, rx len %u, done %u\n",
> xfer, length, xfer->tx_done, xfer->rx_len, xfer->rx_done);
>
> if (length > DSI_TX_FIFO_SIZE)
> @@ -1293,7 +1293,7 @@ static bool samsung_dsim_transfer_finish(struct samsung_dsim *dsi)
> spin_unlock_irqrestore(&dsi->transfer_lock, flags);
>
> dev_dbg(dsi->dev,
> - "> xfer %pK, tx_len %zu, tx_done %u, rx_len %u, rx_done %u\n",
> + "> xfer %p, tx_len %zu, tx_done %u, rx_len %u, rx_done %u\n",
> xfer, xfer->packet.payload_length, xfer->tx_done, xfer->rx_len,
> xfer->rx_done);
>
>
> --
> 2.49.0
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] drm/exynos: Don't use %pK through printk
2025-06-18 7:52 ` [PATCH 2/3] drm/exynos: " Thomas Weißschuh
@ 2025-06-27 2:02 ` Inki Dae
0 siblings, 0 replies; 6+ messages in thread
From: Inki Dae @ 2025-06-27 2:02 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Jagan Teki, Marek Szyprowski, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Seung-Woo Kim, Kyungmin Park, Krzysztof Kozlowski,
Alim Akhtar, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Sean Paul, Marijn Suijten, dri-devel, linux-kernel,
linux-arm-kernel, linux-samsung-soc, linux-arm-msm, freedreno
Hi,
2025년 6월 18일 (수) 오후 4:56, Thomas Weißschuh
<thomas.weissschuh@linutronix.de>님이 작성:
>
> 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.
Applied.
Thanks,
Inki Dae
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +-
> drivers/gpu/drm/exynos/exynos_drm_ipp.c | 32 ++++++++++++++++----------------
> 2 files changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> index 4787fee4696f8e6f9eecaacb1535765c246688c8..d44401a695e203bd36b3b6678fdeb3572a91bfda 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> @@ -174,7 +174,7 @@ static struct exynos_drm_gem *exynos_drm_gem_init(struct drm_device *dev,
> return ERR_PTR(ret);
> }
>
> - DRM_DEV_DEBUG_KMS(dev->dev, "created file object = %pK\n", obj->filp);
> + DRM_DEV_DEBUG_KMS(dev->dev, "created file object = %p\n", obj->filp);
>
> return exynos_gem;
> }
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
> index ea9f66037600e1020da4b0a9c318ca2f2266a871..03c8490af4f45447d123a20777e5362ebd933b46 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
> @@ -271,7 +271,7 @@ static inline struct exynos_drm_ipp_task *
> task->src.rect.h = task->dst.rect.h = UINT_MAX;
> task->transform.rotation = DRM_MODE_ROTATE_0;
>
> - DRM_DEV_DEBUG_DRIVER(task->dev, "Allocated task %pK\n", task);
> + DRM_DEV_DEBUG_DRIVER(task->dev, "Allocated task %p\n", task);
>
> return task;
> }
> @@ -339,7 +339,7 @@ static int exynos_drm_ipp_task_set(struct exynos_drm_ipp_task *task,
> }
>
> DRM_DEV_DEBUG_DRIVER(task->dev,
> - "Got task %pK configuration from userspace\n",
> + "Got task %p configuration from userspace\n",
> task);
> return 0;
> }
> @@ -394,7 +394,7 @@ static void exynos_drm_ipp_task_release_buf(struct exynos_drm_ipp_buffer *buf)
> static void exynos_drm_ipp_task_free(struct exynos_drm_ipp *ipp,
> struct exynos_drm_ipp_task *task)
> {
> - DRM_DEV_DEBUG_DRIVER(task->dev, "Freeing task %pK\n", task);
> + DRM_DEV_DEBUG_DRIVER(task->dev, "Freeing task %p\n", task);
>
> exynos_drm_ipp_task_release_buf(&task->src);
> exynos_drm_ipp_task_release_buf(&task->dst);
> @@ -559,7 +559,7 @@ static int exynos_drm_ipp_check_format(struct exynos_drm_ipp_task *task,
> DRM_EXYNOS_IPP_FORMAT_DESTINATION);
> if (!fmt) {
> DRM_DEV_DEBUG_DRIVER(task->dev,
> - "Task %pK: %s format not supported\n",
> + "Task %p: %s format not supported\n",
> task, buf == src ? "src" : "dst");
> return -EINVAL;
> }
> @@ -609,7 +609,7 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task)
> bool rotate = (rotation != DRM_MODE_ROTATE_0);
> bool scale = false;
>
> - DRM_DEV_DEBUG_DRIVER(task->dev, "Checking task %pK\n", task);
> + DRM_DEV_DEBUG_DRIVER(task->dev, "Checking task %p\n", task);
>
> if (src->rect.w == UINT_MAX)
> src->rect.w = src->buf.width;
> @@ -625,7 +625,7 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task)
> dst->rect.x + dst->rect.w > (dst->buf.width) ||
> dst->rect.y + dst->rect.h > (dst->buf.height)) {
> DRM_DEV_DEBUG_DRIVER(task->dev,
> - "Task %pK: defined area is outside provided buffers\n",
> + "Task %p: defined area is outside provided buffers\n",
> task);
> return -EINVAL;
> }
> @@ -642,7 +642,7 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task)
> (!(ipp->capabilities & DRM_EXYNOS_IPP_CAP_SCALE) && scale) ||
> (!(ipp->capabilities & DRM_EXYNOS_IPP_CAP_CONVERT) &&
> src->buf.fourcc != dst->buf.fourcc)) {
> - DRM_DEV_DEBUG_DRIVER(task->dev, "Task %pK: hw capabilities exceeded\n",
> + DRM_DEV_DEBUG_DRIVER(task->dev, "Task %p: hw capabilities exceeded\n",
> task);
> return -EINVAL;
> }
> @@ -655,7 +655,7 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task)
> if (ret)
> return ret;
>
> - DRM_DEV_DEBUG_DRIVER(ipp->dev, "Task %pK: all checks done.\n",
> + DRM_DEV_DEBUG_DRIVER(ipp->dev, "Task %p: all checks done.\n",
> task);
>
> return ret;
> @@ -667,25 +667,25 @@ static int exynos_drm_ipp_task_setup_buffers(struct exynos_drm_ipp_task *task,
> struct exynos_drm_ipp_buffer *src = &task->src, *dst = &task->dst;
> int ret = 0;
>
> - DRM_DEV_DEBUG_DRIVER(task->dev, "Setting buffer for task %pK\n",
> + DRM_DEV_DEBUG_DRIVER(task->dev, "Setting buffer for task %p\n",
> task);
>
> ret = exynos_drm_ipp_task_setup_buffer(src, filp);
> if (ret) {
> DRM_DEV_DEBUG_DRIVER(task->dev,
> - "Task %pK: src buffer setup failed\n",
> + "Task %p: src buffer setup failed\n",
> task);
> return ret;
> }
> ret = exynos_drm_ipp_task_setup_buffer(dst, filp);
> if (ret) {
> DRM_DEV_DEBUG_DRIVER(task->dev,
> - "Task %pK: dst buffer setup failed\n",
> + "Task %p: dst buffer setup failed\n",
> task);
> return ret;
> }
>
> - DRM_DEV_DEBUG_DRIVER(task->dev, "Task %pK: buffers prepared.\n",
> + DRM_DEV_DEBUG_DRIVER(task->dev, "Task %p: buffers prepared.\n",
> task);
>
> return ret;
> @@ -764,7 +764,7 @@ void exynos_drm_ipp_task_done(struct exynos_drm_ipp_task *task, int ret)
> struct exynos_drm_ipp *ipp = task->ipp;
> unsigned long flags;
>
> - DRM_DEV_DEBUG_DRIVER(task->dev, "ipp: %d, task %pK done: %d\n",
> + DRM_DEV_DEBUG_DRIVER(task->dev, "ipp: %d, task %p done: %d\n",
> ipp->id, task, ret);
>
> spin_lock_irqsave(&ipp->lock, flags);
> @@ -807,7 +807,7 @@ static void exynos_drm_ipp_next_task(struct exynos_drm_ipp *ipp)
> spin_unlock_irqrestore(&ipp->lock, flags);
>
> DRM_DEV_DEBUG_DRIVER(ipp->dev,
> - "ipp: %d, selected task %pK to run\n", ipp->id,
> + "ipp: %d, selected task %p to run\n", ipp->id,
> task);
>
> ret = ipp->funcs->commit(ipp, task);
> @@ -917,14 +917,14 @@ int exynos_drm_ipp_commit_ioctl(struct drm_device *dev, void *data,
> */
> if (arg->flags & DRM_EXYNOS_IPP_FLAG_NONBLOCK) {
> DRM_DEV_DEBUG_DRIVER(ipp->dev,
> - "ipp: %d, nonblocking processing task %pK\n",
> + "ipp: %d, nonblocking processing task %p\n",
> ipp->id, task);
>
> task->flags |= DRM_EXYNOS_IPP_TASK_ASYNC;
> exynos_drm_ipp_schedule_task(task->ipp, task);
> ret = 0;
> } else {
> - DRM_DEV_DEBUG_DRIVER(ipp->dev, "ipp: %d, processing task %pK\n",
> + DRM_DEV_DEBUG_DRIVER(ipp->dev, "ipp: %d, processing task %p\n",
> ipp->id, task);
> exynos_drm_ipp_schedule_task(ipp, task);
> ret = wait_event_interruptible(ipp->done_wq,
>
> --
> 2.49.0
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-06-27 2:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18 7:52 [PATCH 0/3] drm: Don't use %pK through printk Thomas Weißschuh
2025-06-18 7:52 ` [PATCH 1/3] drm/bridge: samsung-dsim: " Thomas Weißschuh
2025-06-27 2:00 ` Inki Dae
2025-06-18 7:52 ` [PATCH 2/3] drm/exynos: " Thomas Weißschuh
2025-06-27 2:02 ` Inki Dae
2025-06-18 7:52 ` [PATCH 3/3] drm/msm: " Thomas Weißschuh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).