Skip to content

net: Don't use %pK through printk or tracepoints

Thomas Weißschuh intel-wired-lan linux-rdma lkml netdev 5 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected] change-id 20250404-restricted-pointers-net-a8cddd03e5d1

Versions newest first

  1. v5 Latest2 patches 1 replyApplied 2/2
  2. v42 patches 2 repliesSuperseded
  3. v32 patches 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches2 repliesSuperseded
v17 patches14 repliesSuperseded

Changes in v5 from the cover letter

- Rebase on v6.17-rc1
- Bick up Reviewed-by from Paul
- Link to v4: https://lore.kernel.org/r/[email protected]

Patches in v5 All 2 applied

#Subject and filesSizeRepliesApplied
1/2ice: Don't use %pK through printk or tracepointsdrivers/net/ethernet/intel/ice/ice_main.c drivers/net/ethernet/intel/ice/ice_trace.h+6 -60 repliesApplied
2/2net/mlx5: Don't use %pK through tracepointsdrivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h+1 -10 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPrzemek KitszelAleksandr LoktionovSimon HormanPaul MenzelTariq ToukanJacob Keller
SeriesR-b
1/2A-b R-b R-b R-b
2/2R-b R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v5 thread

Cover letter [PATCH net-next v5 0/2] net: Don't use %pK through printk or tracepoints

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 are still a few users of %pK left, but these use it through seq_file, for which its usage is safe.

---
Changes in v5:
- Rebase on v6.17-rc1
- Bick up Reviewed-by from Paul
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Pick up Reviewed-by from Simon
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Fix typo in commit messages
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Drop wifi/ath patches, they are submitted on their own now
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Thomas Weißschuh (2):
ice: Don't use %pK through printk or tracepoints net/mlx5: Don't use %pK through tracepoints

 drivers/net/ethernet/intel/ice/ice_main.c                      |  2 +-
 drivers/net/ethernet/intel/ice/ice_trace.h                     | 10 +++++-----
 .../ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h   |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

---
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
change-id: 20250404-restricted-pointers-net-a8cddd03e5d1

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>