Skip to content

Commit 9cdf0ed

Browse files
krzkdaeinki
authored andcommitted
drm/exynos: Print kernel pointers in a restricted form
Printing raw kernel pointers might reveal information which sometimes we try to hide (e.g. with Kernel Address Space Layout Randomization). Use the "%pK" format so these pointers will be hidden for unprivileged users. Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Inki Dae <[email protected]>
1 parent f07d9c2 commit 9cdf0ed

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

drivers/gpu/drm/exynos/exynos_drm_dsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ static void exynos_dsi_send_to_fifo(struct exynos_dsi *dsi,
966966
bool first = !xfer->tx_done;
967967
u32 reg;
968968

969-
dev_dbg(dev, "< xfer %p: tx len %u, done %u, rx len %u, done %u\n",
969+
dev_dbg(dev, "< xfer %pK: tx len %u, done %u, rx len %u, done %u\n",
970970
xfer, length, xfer->tx_done, xfer->rx_len, xfer->rx_done);
971971

972972
if (length > DSI_TX_FIFO_SIZE)
@@ -1164,7 +1164,7 @@ static bool exynos_dsi_transfer_finish(struct exynos_dsi *dsi)
11641164
spin_unlock_irqrestore(&dsi->transfer_lock, flags);
11651165

11661166
dev_dbg(dsi->dev,
1167-
"> xfer %p, tx_len %zu, tx_done %u, rx_len %u, rx_done %u\n",
1167+
"> xfer %pK, tx_len %zu, tx_done %u, rx_len %u, rx_done %u\n",
11681168
xfer, xfer->packet.payload_length, xfer->tx_done, xfer->rx_len,
11691169
xfer->rx_done);
11701170

drivers/gpu/drm/exynos/exynos_drm_fimc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,7 @@ static int fimc_probe(struct platform_device *pdev)
16951695
goto err_put_clk;
16961696
}
16971697

1698-
DRM_DEBUG_KMS("id[%d]ippdrv[%p]\n", ctx->id, ippdrv);
1698+
DRM_DEBUG_KMS("id[%d]ippdrv[%pK]\n", ctx->id, ippdrv);
16991699

17001700
spin_lock_init(&ctx->lock);
17011701
platform_set_drvdata(pdev, ctx);

drivers/gpu/drm/exynos/exynos_drm_gem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static struct exynos_drm_gem *exynos_drm_gem_init(struct drm_device *dev,
218218
return ERR_PTR(ret);
219219
}
220220

221-
DRM_DEBUG_KMS("created file object = %p\n", obj->filp);
221+
DRM_DEBUG_KMS("created file object = %pK\n", obj->filp);
222222

223223
return exynos_gem;
224224
}

drivers/gpu/drm/exynos/exynos_drm_gsc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,7 @@ static int gsc_probe(struct platform_device *pdev)
17231723
return ret;
17241724
}
17251725

1726-
DRM_DEBUG_KMS("id[%d]ippdrv[%p]\n", ctx->id, ippdrv);
1726+
DRM_DEBUG_KMS("id[%d]ippdrv[%pK]\n", ctx->id, ippdrv);
17271727

17281728
mutex_init(&ctx->lock);
17291729
platform_set_drvdata(pdev, ctx);

drivers/gpu/drm/exynos/exynos_drm_ipp.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static struct exynos_drm_ippdrv *ipp_find_drv_by_handle(u32 prop_id)
208208
* e.g PAUSE state, queue buf, command control.
209209
*/
210210
list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) {
211-
DRM_DEBUG_KMS("count[%d]ippdrv[%p]\n", count++, ippdrv);
211+
DRM_DEBUG_KMS("count[%d]ippdrv[%pK]\n", count++, ippdrv);
212212

213213
mutex_lock(&ippdrv->cmd_lock);
214214
list_for_each_entry(c_node, &ippdrv->cmd_list, list) {
@@ -388,7 +388,7 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data,
388388
}
389389
property->prop_id = ret;
390390

391-
DRM_DEBUG_KMS("created prop_id[%d]cmd[%d]ippdrv[%p]\n",
391+
DRM_DEBUG_KMS("created prop_id[%d]cmd[%d]ippdrv[%pK]\n",
392392
property->prop_id, property->cmd, ippdrv);
393393

394394
/* stored property information and ippdrv in private data */
@@ -518,7 +518,7 @@ static int ipp_put_mem_node(struct drm_device *drm_dev,
518518
{
519519
int i;
520520

521-
DRM_DEBUG_KMS("node[%p]\n", m_node);
521+
DRM_DEBUG_KMS("node[%pK]\n", m_node);
522522

523523
if (!m_node) {
524524
DRM_ERROR("invalid dequeue node.\n");
@@ -562,7 +562,7 @@ static struct drm_exynos_ipp_mem_node
562562
m_node->buf_id = qbuf->buf_id;
563563
INIT_LIST_HEAD(&m_node->list);
564564

565-
DRM_DEBUG_KMS("m_node[%p]ops_id[%d]\n", m_node, qbuf->ops_id);
565+
DRM_DEBUG_KMS("m_node[%pK]ops_id[%d]\n", m_node, qbuf->ops_id);
566566
DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]\n", qbuf->prop_id, m_node->buf_id);
567567

568568
for_each_ipp_planar(i) {
@@ -659,7 +659,7 @@ static void ipp_put_event(struct drm_exynos_ipp_cmd_node *c_node,
659659

660660
mutex_lock(&c_node->event_lock);
661661
list_for_each_entry_safe(e, te, &c_node->event_list, base.link) {
662-
DRM_DEBUG_KMS("count[%d]e[%p]\n", count++, e);
662+
DRM_DEBUG_KMS("count[%d]e[%pK]\n", count++, e);
663663

664664
/*
665665
* qbuf == NULL condition means all event deletion.
@@ -750,7 +750,7 @@ static struct drm_exynos_ipp_mem_node
750750

751751
/* find memory node from memory list */
752752
list_for_each_entry(m_node, head, list) {
753-
DRM_DEBUG_KMS("count[%d]m_node[%p]\n", count++, m_node);
753+
DRM_DEBUG_KMS("count[%d]m_node[%pK]\n", count++, m_node);
754754

755755
/* compare buffer id */
756756
if (m_node->buf_id == qbuf->buf_id)
@@ -767,7 +767,7 @@ static int ipp_set_mem_node(struct exynos_drm_ippdrv *ippdrv,
767767
struct exynos_drm_ipp_ops *ops = NULL;
768768
int ret = 0;
769769

770-
DRM_DEBUG_KMS("node[%p]\n", m_node);
770+
DRM_DEBUG_KMS("node[%pK]\n", m_node);
771771

772772
if (!m_node) {
773773
DRM_ERROR("invalid queue node.\n");
@@ -1232,7 +1232,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv,
12321232
m_node = list_first_entry(head,
12331233
struct drm_exynos_ipp_mem_node, list);
12341234

1235-
DRM_DEBUG_KMS("m_node[%p]\n", m_node);
1235+
DRM_DEBUG_KMS("m_node[%pK]\n", m_node);
12361236

12371237
ret = ipp_set_mem_node(ippdrv, c_node, m_node);
12381238
if (ret) {
@@ -1601,7 +1601,7 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
16011601
}
16021602
ippdrv->prop_list.ipp_id = ret;
16031603

1604-
DRM_DEBUG_KMS("count[%d]ippdrv[%p]ipp_id[%d]\n",
1604+
DRM_DEBUG_KMS("count[%d]ippdrv[%pK]ipp_id[%d]\n",
16051605
count++, ippdrv, ret);
16061606

16071607
/* store parent device for node */
@@ -1659,7 +1659,7 @@ static int ipp_subdrv_open(struct drm_device *drm_dev, struct device *dev,
16591659

16601660
file_priv->ipp_dev = dev;
16611661

1662-
DRM_DEBUG_KMS("done priv[%p]\n", dev);
1662+
DRM_DEBUG_KMS("done priv[%pK]\n", dev);
16631663

16641664
return 0;
16651665
}
@@ -1676,7 +1676,7 @@ static void ipp_subdrv_close(struct drm_device *drm_dev, struct device *dev,
16761676
mutex_lock(&ippdrv->cmd_lock);
16771677
list_for_each_entry_safe(c_node, tc_node,
16781678
&ippdrv->cmd_list, list) {
1679-
DRM_DEBUG_KMS("count[%d]ippdrv[%p]\n",
1679+
DRM_DEBUG_KMS("count[%d]ippdrv[%pK]\n",
16801680
count++, ippdrv);
16811681

16821682
if (c_node->filp == file) {

drivers/gpu/drm/exynos/exynos_drm_rotator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ static int rotator_probe(struct platform_device *pdev)
748748
goto err_ippdrv_register;
749749
}
750750

751-
DRM_DEBUG_KMS("ippdrv[%p]\n", ippdrv);
751+
DRM_DEBUG_KMS("ippdrv[%pK]\n", ippdrv);
752752

753753
platform_set_drvdata(pdev, rot);
754754

0 commit comments

Comments
 (0)