ath10k.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/7] net: Don't use %pK through printk
@ 2025-04-14  8:26 Thomas Weißschuh
  2025-04-14  8:26 ` [PATCH net-next 1/7] wifi: ath10k: " Thomas Weißschuh
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Thomas Weißschuh @ 2025-04-14  8:26 UTC (permalink / raw)
  To: Jeff Johnson, Loic Poulain, Brian Norris, Francesco Dolcini,
	Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Saeed Mahameed,
	Leon Romanovsky, Tariq Toukan
  Cc: ath10k, linux-kernel, ath11k, ath12k, wcn36xx, linux-wireless,
	intel-wired-lan, netdev, linux-rdma, 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 looks 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.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
Thomas Weißschuh (7):
      wifi: ath10k: Don't use %pK through printk
      wifi: ath11k: Don't use %pK through printk
      wifi: ath12k: Don't use %pK through printk
      wifi: wcn36xx: Don't use %pK through printk
      wifi: mwifiex: Don't use %pK through printk
      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 +++++-----
 .../mlx5/core/sf/dev/diag/dev_tracepoint.h         |  2 +-
 drivers/net/wireless/ath/ath10k/ahb.c              |  2 +-
 drivers/net/wireless/ath/ath10k/bmi.c              |  6 +++---
 drivers/net/wireless/ath/ath10k/ce.c               |  4 ++--
 drivers/net/wireless/ath/ath10k/core.c             |  4 ++--
 drivers/net/wireless/ath/ath10k/htc.c              |  6 +++---
 drivers/net/wireless/ath/ath10k/htt_rx.c           |  2 +-
 drivers/net/wireless/ath/ath10k/mac.c              | 22 +++++++++++-----------
 drivers/net/wireless/ath/ath10k/pci.c              |  2 +-
 drivers/net/wireless/ath/ath10k/testmode.c         |  4 ++--
 drivers/net/wireless/ath/ath10k/txrx.c             |  2 +-
 drivers/net/wireless/ath/ath10k/usb.c              |  4 ++--
 drivers/net/wireless/ath/ath10k/wmi.c              |  4 ++--
 drivers/net/wireless/ath/ath11k/testmode.c         |  2 +-
 drivers/net/wireless/ath/ath12k/testmode.c         |  4 ++--
 drivers/net/wireless/ath/wcn36xx/testmode.c        |  2 +-
 drivers/net/wireless/marvell/mwifiex/pcie.c        |  2 +-
 19 files changed, 43 insertions(+), 43 deletions(-)
---
base-commit: 8ffd015db85fea3e15a77027fda6c02ced4d2444
change-id: 20250404-restricted-pointers-net-a8cddd03e5d1

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh@linutronix.de>



^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH net-next 1/7] wifi: ath10k: Don't use %pK through printk
  2025-04-14  8:26 [PATCH net-next 0/7] net: Don't use %pK through printk Thomas Weißschuh
@ 2025-04-14  8:26 ` Thomas Weißschuh
  2025-04-14 16:16   ` [Intel-wired-lan] " Loktionov, Aleksandr
  2025-04-14  8:26 ` [PATCH net-next 2/7] wifi: ath11k: " Thomas Weißschuh
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Thomas Weißschuh @ 2025-04-14  8:26 UTC (permalink / raw)
  To: Jeff Johnson, Loic Poulain, Brian Norris, Francesco Dolcini,
	Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Saeed Mahameed,
	Leon Romanovsky, Tariq Toukan
  Cc: ath10k, linux-kernel, ath11k, ath12k, wcn36xx, linux-wireless,
	intel-wired-lan, netdev, linux-rdma, 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 looks 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.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 drivers/net/wireless/ath/ath10k/ahb.c      |  2 +-
 drivers/net/wireless/ath/ath10k/bmi.c      |  6 +++---
 drivers/net/wireless/ath/ath10k/ce.c       |  4 ++--
 drivers/net/wireless/ath/ath10k/core.c     |  4 ++--
 drivers/net/wireless/ath/ath10k/htc.c      |  6 +++---
 drivers/net/wireless/ath/ath10k/htt_rx.c   |  2 +-
 drivers/net/wireless/ath/ath10k/mac.c      | 22 +++++++++++-----------
 drivers/net/wireless/ath/ath10k/pci.c      |  2 +-
 drivers/net/wireless/ath/ath10k/testmode.c |  4 ++--
 drivers/net/wireless/ath/ath10k/txrx.c     |  2 +-
 drivers/net/wireless/ath/ath10k/usb.c      |  4 ++--
 drivers/net/wireless/ath/ath10k/wmi.c      |  4 ++--
 12 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/ahb.c b/drivers/net/wireless/ath/ath10k/ahb.c
index db9f9ebcb62d20e5cdcf9e7b08f5ea23e0dc3d22..eb8b35b6224dbf2540013a4a066646ecc9a3db75 100644
--- a/drivers/net/wireless/ath/ath10k/ahb.c
+++ b/drivers/net/wireless/ath/ath10k/ahb.c
@@ -497,7 +497,7 @@ static int ath10k_ahb_resource_init(struct ath10k *ar)
 
 	ath10k_dbg(ar, ATH10K_DBG_BOOT, "irq: %d\n", ar_ahb->irq);
 
-	ath10k_dbg(ar, ATH10K_DBG_BOOT, "mem: 0x%pK mem_len: %lu gcc mem: 0x%pK tcsr_mem: 0x%pK\n",
+	ath10k_dbg(ar, ATH10K_DBG_BOOT, "mem: 0x%p mem_len: %lu gcc mem: 0x%p tcsr_mem: 0x%p\n",
 		   ar_ahb->mem, ar_ahb->mem_len,
 		   ar_ahb->gcc_mem, ar_ahb->tcsr_mem);
 	return 0;
diff --git a/drivers/net/wireless/ath/ath10k/bmi.c b/drivers/net/wireless/ath/ath10k/bmi.c
index 9a4f8e815412cba207f3a788013d362a36a02ac3..48efdc71d54dc699e1d43d01507a7a30c9c495b4 100644
--- a/drivers/net/wireless/ath/ath10k/bmi.c
+++ b/drivers/net/wireless/ath/ath10k/bmi.c
@@ -349,7 +349,7 @@ static int ath10k_bmi_lz_data_large(struct ath10k *ar, const void *buffer, u32 l
 	int ret;
 	size_t buf_len;
 
-	ath10k_dbg(ar, ATH10K_DBG_BMI, "large bmi lz data buffer 0x%pK length %d\n",
+	ath10k_dbg(ar, ATH10K_DBG_BMI, "large bmi lz data buffer 0x%p length %d\n",
 		   buffer, length);
 
 	if (ar->bmi.done_sent) {
@@ -395,7 +395,7 @@ int ath10k_bmi_lz_data(struct ath10k *ar, const void *buffer, u32 length)
 	u32 txlen;
 	int ret;
 
-	ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi lz data buffer 0x%pK length %d\n",
+	ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi lz data buffer 0x%p length %d\n",
 		   buffer, length);
 
 	if (ar->bmi.done_sent) {
@@ -461,7 +461,7 @@ int ath10k_bmi_fast_download(struct ath10k *ar,
 	int ret;
 
 	ath10k_dbg(ar, ATH10K_DBG_BMI,
-		   "bmi fast download address 0x%x buffer 0x%pK length %d\n",
+		   "bmi fast download address 0x%x buffer 0x%p length %d\n",
 		   address, buffer, length);
 
 	ret = ath10k_bmi_lz_stream_start(ar, address);
diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index afae4a8027f8338ad9fed64880fa16fed09f32e4..4fc81ae17a8af4816919400cd77061c5aa7f6c3a 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -1388,7 +1388,7 @@ static int ath10k_ce_init_src_ring(struct ath10k *ar,
 	ath10k_ce_src_ring_highmark_set(ar, ctrl_addr, nentries);
 
 	ath10k_dbg(ar, ATH10K_DBG_BOOT,
-		   "boot init ce src ring id %d entries %d base_addr %pK\n",
+		   "boot init ce src ring id %d entries %d base_addr %p\n",
 		   ce_id, nentries, src_ring->base_addr_owner_space);
 
 	return 0;
@@ -1426,7 +1426,7 @@ static int ath10k_ce_init_dest_ring(struct ath10k *ar,
 	ath10k_ce_dest_ring_highmark_set(ar, ctrl_addr, nentries);
 
 	ath10k_dbg(ar, ATH10K_DBG_BOOT,
-		   "boot ce dest ring id %d entries %d base_addr %pK\n",
+		   "boot ce dest ring id %d entries %d base_addr %p\n",
 		   ce_id, nentries, dest_ring->base_addr_owner_space);
 
 	return 0;
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 6d336e39d6738bbe7973a25e073d03a07b9ae733..fe3a8f4a1cc1b774ce27112ef7dfe6adb0b4dc2f 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1200,7 +1200,7 @@ static int ath10k_download_fw(struct ath10k *ar)
 	}
 
 	ath10k_dbg(ar, ATH10K_DBG_BOOT,
-		   "boot uploading firmware image %pK len %d\n",
+		   "boot uploading firmware image %p len %d\n",
 		   data, data_len);
 
 	/* Check if device supports to download firmware via
@@ -1826,7 +1826,7 @@ static int ath10k_download_and_run_otp(struct ath10k *ar)
 
 	if (!ar->running_fw->fw_file.otp_data ||
 	    !ar->running_fw->fw_file.otp_len) {
-		ath10k_warn(ar, "Not running otp, calibration will be incorrect (otp-data %pK otp_len %zd)!\n",
+		ath10k_warn(ar, "Not running otp, calibration will be incorrect (otp-data %p otp_len %zd)!\n",
 			    ar->running_fw->fw_file.otp_data,
 			    ar->running_fw->fw_file.otp_len);
 		return 0;
diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
index a6e21ce90bad64d91afee2b4f46bfbf136547cba..2da08dfebd3e7b56b149a09b5372aa0bfb8538d1 100644
--- a/drivers/net/wireless/ath/ath10k/htc.c
+++ b/drivers/net/wireless/ath/ath10k/htc.c
@@ -34,7 +34,7 @@ static struct sk_buff *ath10k_htc_build_tx_ctrl_skb(void *ar)
 	skb_cb = ATH10K_SKB_CB(skb);
 	memset(skb_cb, 0, sizeof(*skb_cb));
 
-	ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: skb %pK\n", __func__, skb);
+	ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: skb %p\n", __func__, skb);
 	return skb;
 }
 
@@ -54,7 +54,7 @@ void ath10k_htc_notify_tx_completion(struct ath10k_htc_ep *ep,
 	struct ath10k *ar = ep->htc->ar;
 	struct ath10k_htc_hdr *hdr;
 
-	ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: ep %d skb %pK\n", __func__,
+	ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: ep %d skb %p\n", __func__,
 		   ep->eid, skb);
 
 	/* A corner case where the copy completion is reaching to host but still
@@ -515,7 +515,7 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb)
 		/* zero length packet with trailer data, just drop these */
 		goto out;
 
-	ath10k_dbg(ar, ATH10K_DBG_HTC, "htc rx completion ep %d skb %pK\n",
+	ath10k_dbg(ar, ATH10K_DBG_HTC, "htc rx completion ep %d skb %p\n",
 		   eid, skb);
 	ep->ep_ops.ep_rx_complete(ar, skb);
 
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 83eab7479f0699513c2a08297f7dec2f00599340..52981052e211a0e23271779f8589618e0b9c8de4 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -1373,7 +1373,7 @@ static void ath10k_process_rx(struct ath10k *ar, struct sk_buff *skb)
 	}
 
 	ath10k_dbg(ar, ATH10K_DBG_DATA,
-		   "rx skb %pK len %u peer %pM %s %s sn %u %s%s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n",
+		   "rx skb %p len %u peer %pM %s %s sn %u %s%s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n",
 		   skb,
 		   skb->len,
 		   ieee80211_get_SA(hdr),
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index c61b95a928dac12fb9e11164fb45a53831f8de11..8c7ffea0fa44b5d3c03f2fd7191fb757a4966ad6 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -875,7 +875,7 @@ static void ath10k_peer_map_cleanup(struct ath10k *ar, struct ath10k_peer *peer)
 	 */
 	for (i = 0; i < ARRAY_SIZE(ar->peer_map); i++) {
 		if (ar->peer_map[i] == peer) {
-			ath10k_warn(ar, "removing stale peer_map entry for %pM (ptr %pK idx %d)\n",
+			ath10k_warn(ar, "removing stale peer_map entry for %pM (ptr %p idx %d)\n",
 				    peer->addr, peer, i);
 			ar->peer_map[i] = NULL;
 		}
@@ -4063,7 +4063,7 @@ static int ath10k_mac_tx(struct ath10k *ar,
 
 	if (!noque_offchan && info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) {
 		if (!ath10k_mac_tx_frm_has_freq(ar)) {
-			ath10k_dbg(ar, ATH10K_DBG_MAC, "mac queued offchannel skb %pK len %d\n",
+			ath10k_dbg(ar, ATH10K_DBG_MAC, "mac queued offchannel skb %p len %d\n",
 				   skb, skb->len);
 
 			skb_queue_tail(&ar->offchan_tx_queue, skb);
@@ -4126,7 +4126,7 @@ void ath10k_offchan_tx_work(struct work_struct *work)
 
 		mutex_lock(&ar->conf_mutex);
 
-		ath10k_dbg(ar, ATH10K_DBG_MAC, "mac offchannel skb %pK len %d\n",
+		ath10k_dbg(ar, ATH10K_DBG_MAC, "mac offchannel skb %p len %d\n",
 			   skb, skb->len);
 
 		hdr = (struct ieee80211_hdr *)skb->data;
@@ -4181,7 +4181,7 @@ void ath10k_offchan_tx_work(struct work_struct *work)
 		time_left =
 		wait_for_completion_timeout(&ar->offchan_tx_completed, 3 * HZ);
 		if (time_left == 0)
-			ath10k_warn(ar, "timed out waiting for offchannel skb %pK, len: %d\n",
+			ath10k_warn(ar, "timed out waiting for offchannel skb %p, len: %d\n",
 				    skb, skb->len);
 
 		if (!peer && tmp_peer_created) {
@@ -7604,7 +7604,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
 		 * Existing station deletion.
 		 */
 		ath10k_dbg(ar, ATH10K_DBG_STA,
-			   "mac vdev %d peer delete %pM sta %pK (sta gone)\n",
+			   "mac vdev %d peer delete %pM sta %p (sta gone)\n",
 			   arvif->vdev_id, sta->addr, sta);
 
 		if (sta->tdls) {
@@ -7631,7 +7631,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
 				continue;
 
 			if (peer->sta == sta) {
-				ath10k_warn(ar, "found sta peer %pM (ptr %pK id %d) entry on vdev %i after it was supposedly removed\n",
+				ath10k_warn(ar, "found sta peer %pM (ptr %p id %d) entry on vdev %i after it was supposedly removed\n",
 					    sta->addr, peer, i, arvif->vdev_id);
 				peer->sta = NULL;
 
@@ -8811,7 +8811,7 @@ ath10k_mac_op_add_chanctx(struct ieee80211_hw *hw,
 	struct ath10k *ar = hw->priv;
 
 	ath10k_dbg(ar, ATH10K_DBG_MAC,
-		   "mac chanctx add freq %u width %d ptr %pK\n",
+		   "mac chanctx add freq %u width %d ptr %p\n",
 		   ctx->def.chan->center_freq, ctx->def.width, ctx);
 
 	mutex_lock(&ar->conf_mutex);
@@ -8835,7 +8835,7 @@ ath10k_mac_op_remove_chanctx(struct ieee80211_hw *hw,
 	struct ath10k *ar = hw->priv;
 
 	ath10k_dbg(ar, ATH10K_DBG_MAC,
-		   "mac chanctx remove freq %u width %d ptr %pK\n",
+		   "mac chanctx remove freq %u width %d ptr %p\n",
 		   ctx->def.chan->center_freq, ctx->def.width, ctx);
 
 	mutex_lock(&ar->conf_mutex);
@@ -8900,7 +8900,7 @@ ath10k_mac_op_change_chanctx(struct ieee80211_hw *hw,
 	mutex_lock(&ar->conf_mutex);
 
 	ath10k_dbg(ar, ATH10K_DBG_MAC,
-		   "mac chanctx change freq %u width %d ptr %pK changed %x\n",
+		   "mac chanctx change freq %u width %d ptr %p changed %x\n",
 		   ctx->def.chan->center_freq, ctx->def.width, ctx, changed);
 
 	/* This shouldn't really happen because channel switching should use
@@ -8959,7 +8959,7 @@ ath10k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
 	mutex_lock(&ar->conf_mutex);
 
 	ath10k_dbg(ar, ATH10K_DBG_MAC,
-		   "mac chanctx assign ptr %pK vdev_id %i\n",
+		   "mac chanctx assign ptr %p vdev_id %i\n",
 		   ctx, arvif->vdev_id);
 
 	if (WARN_ON(arvif->is_started)) {
@@ -9039,7 +9039,7 @@ ath10k_mac_op_unassign_vif_chanctx(struct ieee80211_hw *hw,
 	mutex_lock(&ar->conf_mutex);
 
 	ath10k_dbg(ar, ATH10K_DBG_MAC,
-		   "mac chanctx unassign ptr %pK vdev_id %i\n",
+		   "mac chanctx unassign ptr %p vdev_id %i\n",
 		   ctx, arvif->vdev_id);
 
 	WARN_ON(!arvif->is_started);
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index fb2c60ee433c3fc15dc7e1adf9e6d4e67862e901..20ec0a6d0f71c4fee3bf1a3d48b512ebcdfba856 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -3411,7 +3411,7 @@ static int ath10k_pci_claim(struct ath10k *ar)
 		goto err_region;
 	}
 
-	ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot pci_mem 0x%pK\n", ar_pci->mem);
+	ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot pci_mem 0x%p\n", ar_pci->mem);
 	return 0;
 
 err_region:
diff --git a/drivers/net/wireless/ath/ath10k/testmode.c b/drivers/net/wireless/ath/ath10k/testmode.c
index 7a9b9bbcdbfc5a290128ec55d3d3ce158a7b58c7..3fcefc55b74f2995be53f5d077e3a6a06aed900b 100644
--- a/drivers/net/wireless/ath/ath10k/testmode.c
+++ b/drivers/net/wireless/ath/ath10k/testmode.c
@@ -35,7 +35,7 @@ bool ath10k_tm_event_wmi(struct ath10k *ar, u32 cmd_id, struct sk_buff *skb)
 	int ret;
 
 	ath10k_dbg(ar, ATH10K_DBG_TESTMODE,
-		   "testmode event wmi cmd_id %d skb %pK skb->len %d\n",
+		   "testmode event wmi cmd_id %d skb %p skb->len %d\n",
 		   cmd_id, skb, skb->len);
 
 	ath10k_dbg_dump(ar, ATH10K_DBG_TESTMODE, NULL, "", skb->data, skb->len);
@@ -397,7 +397,7 @@ static int ath10k_tm_cmd_wmi(struct ath10k *ar, struct nlattr *tb[])
 	cmd_id = nla_get_u32(tb[ATH10K_TM_ATTR_WMI_CMDID]);
 
 	ath10k_dbg(ar, ATH10K_DBG_TESTMODE,
-		   "testmode cmd wmi cmd_id %d buf %pK buf_len %d\n",
+		   "testmode cmd wmi cmd_id %d buf %p buf_len %d\n",
 		   cmd_id, buf, buf_len);
 
 	ath10k_dbg_dump(ar, ATH10K_DBG_TESTMODE, NULL, "", buf, buf_len);
diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c
index da3bc35e41aa08da9c325a34d4ab82b64d6f80cc..493bfb410aff3d842c217dab3f43c5c921a4ac0e 100644
--- a/drivers/net/wireless/ath/ath10k/txrx.c
+++ b/drivers/net/wireless/ath/ath10k/txrx.c
@@ -35,7 +35,7 @@ static void ath10k_report_offchan_tx(struct ath10k *ar, struct sk_buff *skb)
 	complete(&ar->offchan_tx_completed);
 	ar->offchan_tx_skb = NULL; /* just for sanity */
 
-	ath10k_dbg(ar, ATH10K_DBG_HTT, "completed offchannel skb %pK\n", skb);
+	ath10k_dbg(ar, ATH10K_DBG_HTT, "completed offchannel skb %p\n", skb);
 out:
 	spin_unlock_bh(&ar->data_lock);
 }
diff --git a/drivers/net/wireless/ath/ath10k/usb.c b/drivers/net/wireless/ath/ath10k/usb.c
index 3b51b7f52130ee3d94c9b2791dccf47a46e52e95..1732a4f98418df948759535dd979eceec00c06eb 100644
--- a/drivers/net/wireless/ath/ath10k/usb.c
+++ b/drivers/net/wireless/ath/ath10k/usb.c
@@ -131,7 +131,7 @@ static void ath10k_usb_recv_complete(struct urb *urb)
 	int status = 0;
 
 	ath10k_dbg(ar, ATH10K_DBG_USB_BULK,
-		   "usb recv pipe %d stat %d len %d urb 0x%pK\n",
+		   "usb recv pipe %d stat %d len %d urb 0x%p\n",
 		   pipe->logical_pipe_num, urb->status, urb->actual_length,
 		   urb);
 
@@ -230,7 +230,7 @@ static void ath10k_usb_post_recv_transfers(struct ath10k *ar,
 				  ath10k_usb_recv_complete, urb_context);
 
 		ath10k_dbg(ar, ATH10K_DBG_USB_BULK,
-			   "usb bulk recv submit %d 0x%x ep 0x%2.2x len %d buf 0x%pK\n",
+			   "usb bulk recv submit %d 0x%x ep 0x%2.2x len %d buf 0x%p\n",
 			   recv_pipe->logical_pipe_num,
 			   recv_pipe->usb_pipe_handle, recv_pipe->ep_address,
 			   ATH10K_USB_RX_BUFFER_SIZE, urb_context->skb);
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 5e061f7525a6bdec402e3571810fd86774ec8588..df6a24f8f8d5b5a61957b44d705f811b2ff88a44 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2029,7 +2029,7 @@ ath10k_wmi_op_gen_mgmt_tx(struct ath10k *ar, struct sk_buff *msdu)
 	ether_addr_copy(cmd->hdr.peer_macaddr.addr, ieee80211_get_DA(hdr));
 	memcpy(cmd->buf, msdu->data, msdu->len);
 
-	ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi mgmt tx skb %pK len %d ftype %02x stype %02x\n",
+	ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi mgmt tx skb %p len %d ftype %02x stype %02x\n",
 		   msdu, skb->len, fc & IEEE80211_FCTL_FTYPE,
 		   fc & IEEE80211_FCTL_STYPE);
 	trace_ath10k_tx_hdr(ar, skb->data, skb->len);
@@ -2637,7 +2637,7 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
 		status->boottime_ns = ktime_get_boottime_ns();
 
 	ath10k_dbg(ar, ATH10K_DBG_MGMT,
-		   "event mgmt rx skb %pK len %d ftype %02x stype %02x\n",
+		   "event mgmt rx skb %p len %d ftype %02x stype %02x\n",
 		   skb, skb->len,
 		   fc & IEEE80211_FCTL_FTYPE, fc & IEEE80211_FCTL_STYPE);
 

-- 
2.49.0



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH net-next 2/7] wifi: ath11k: Don't use %pK through printk
  2025-04-14  8:26 [PATCH net-next 0/7] net: Don't use %pK through printk Thomas Weißschuh
  2025-04-14  8:26 ` [PATCH net-next 1/7] wifi: ath10k: " Thomas Weißschuh
@ 2025-04-14  8:26 ` Thomas Weißschuh
  2025-04-14 16:17   ` [Intel-wired-lan] " Loktionov, Aleksandr
  2025-04-14  8:26 ` [PATCH net-next 3/7] wifi: ath12k: " Thomas Weißschuh
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Thomas Weißschuh @ 2025-04-14  8:26 UTC (permalink / raw)
  To: Jeff Johnson, Loic Poulain, Brian Norris, Francesco Dolcini,
	Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Saeed Mahameed,
	Leon Romanovsky, Tariq Toukan
  Cc: ath10k, linux-kernel, ath11k, ath12k, wcn36xx, linux-wireless,
	intel-wired-lan, netdev, linux-rdma, 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 looks 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.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 drivers/net/wireless/ath/ath11k/testmode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/testmode.c b/drivers/net/wireless/ath/ath11k/testmode.c
index 9be1cd742339c95ffa74c09bee924f4eff15134a..a9751ea2a0b73009bfb600d51c3978200ce99114 100644
--- a/drivers/net/wireless/ath/ath11k/testmode.c
+++ b/drivers/net/wireless/ath/ath11k/testmode.c
@@ -107,7 +107,7 @@ static int ath11k_tm_process_event(struct ath11k_base *ab, u32 cmd_id,
 	u32 pdev_id;
 
 	ath11k_dbg(ab, ATH11K_DBG_TESTMODE,
-		   "event wmi cmd_id %d ftm event msg %pK datalen %d\n",
+		   "event wmi cmd_id %d ftm event msg %p datalen %d\n",
 		   cmd_id, ftm_msg, length);
 	ath11k_dbg_dump(ab, ATH11K_DBG_TESTMODE, NULL, "", ftm_msg, length);
 	pdev_id = DP_HW2SW_MACID(ftm_msg->seg_hdr.pdev_id);

-- 
2.49.0



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH net-next 3/7] wifi: ath12k: Don't use %pK through printk
  2025-04-14  8:26 [PATCH net-next 0/7] net: Don't use %pK through printk Thomas Weißschuh
  2025-04-14  8:26 ` [PATCH net-next 1/7] wifi: ath10k: " Thomas Weißschuh
  2025-04-14  8:26 ` [PATCH net-next 2/7] wifi: ath11k: " Thomas Weißschuh
@ 2025-04-14  8:26 ` Thomas Weißschuh
  2025-04-14 16:16   ` [Intel-wired-lan] " Loktionov, Aleksandr
  2025-04-14  8:26 ` [PATCH net-next 4/7] wifi: wcn36xx: " Thomas Weißschuh
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Thomas Weißschuh @ 2025-04-14  8:26 UTC (permalink / raw)
  To: Jeff Johnson, Loic Poulain, Brian Norris, Francesco Dolcini,
	Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Saeed Mahameed,
	Leon Romanovsky, Tariq Toukan
  Cc: ath10k, linux-kernel, ath11k, ath12k, wcn36xx, linux-wireless,
	intel-wired-lan, netdev, linux-rdma, 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 looks 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.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 drivers/net/wireless/ath/ath12k/testmode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/testmode.c b/drivers/net/wireless/ath/ath12k/testmode.c
index 18d56a976dc74c4f6eab87e358c14d4faea648e2..fb6af7ccf71f44ae4bd01cde53fba3527eed0d2d 100644
--- a/drivers/net/wireless/ath/ath12k/testmode.c
+++ b/drivers/net/wireless/ath/ath12k/testmode.c
@@ -97,7 +97,7 @@ void ath12k_tm_process_event(struct ath12k_base *ab, u32 cmd_id,
 	u8 const *buf_pos;
 
 	ath12k_dbg(ab, ATH12K_DBG_TESTMODE,
-		   "testmode event wmi cmd_id %d ftm event msg %pK datalen %d\n",
+		   "testmode event wmi cmd_id %d ftm event msg %p datalen %d\n",
 		   cmd_id, ftm_msg, length);
 	ath12k_dbg_dump(ab, ATH12K_DBG_TESTMODE, NULL, "", ftm_msg, length);
 	pdev_id = DP_HW2SW_MACID(le32_to_cpu(ftm_msg->seg_hdr.pdev_id));
@@ -227,7 +227,7 @@ static int ath12k_tm_cmd_process_ftm(struct ath12k *ar, struct nlattr *tb[])
 	buf_len = nla_len(tb[ATH_TM_ATTR_DATA]);
 	cmd_id = WMI_PDEV_UTF_CMDID;
 	ath12k_dbg(ar->ab, ATH12K_DBG_TESTMODE,
-		   "testmode cmd wmi cmd_id %d buf %pK buf_len %d\n",
+		   "testmode cmd wmi cmd_id %d buf %p buf_len %d\n",
 		   cmd_id, buf, buf_len);
 	ath12k_dbg_dump(ar->ab, ATH12K_DBG_TESTMODE, NULL, "", buf, buf_len);
 	bufpos = buf;

-- 
2.49.0



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH net-next 4/7] wifi: wcn36xx: Don't use %pK through printk
  2025-04-14  8:26 [PATCH net-next 0/7] net: Don't use %pK through printk Thomas Weißschuh
                   ` (2 preceding siblings ...)
  2025-04-14  8:26 ` [PATCH net-next 3/7] wifi: ath12k: " Thomas Weißschuh
@ 2025-04-14  8:26 ` Thomas Weißschuh
  2025-04-14 19:04   ` Loic Poulain
  2025-04-14  8:26 ` [PATCH net-next 5/7] wifi: mwifiex: " Thomas Weißschuh
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Thomas Weißschuh @ 2025-04-14  8:26 UTC (permalink / raw)
  To: Jeff Johnson, Loic Poulain, Brian Norris, Francesco Dolcini,
	Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Saeed Mahameed,
	Leon Romanovsky, Tariq Toukan
  Cc: ath10k, linux-kernel, ath11k, ath12k, wcn36xx, linux-wireless,
	intel-wired-lan, netdev, linux-rdma, 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 looks 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.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 drivers/net/wireless/ath/wcn36xx/testmode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/testmode.c b/drivers/net/wireless/ath/wcn36xx/testmode.c
index e5142c052985ddf629b93d7b9687e6ba63a48e8b..d7a2a483cbc486308032709a99bba9a52ed0ff59 100644
--- a/drivers/net/wireless/ath/wcn36xx/testmode.c
+++ b/drivers/net/wireless/ath/wcn36xx/testmode.c
@@ -56,7 +56,7 @@ static int wcn36xx_tm_cmd_ptt(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 	msg = buf;
 
 	wcn36xx_dbg(WCN36XX_DBG_TESTMODE,
-		    "testmode cmd wmi msg_id 0x%04X msg_len %d buf %pK buf_len %d\n",
+		    "testmode cmd wmi msg_id 0x%04X msg_len %d buf %p buf_len %d\n",
 		   msg->msg_id, msg->msg_body_length,
 		   buf, buf_len);
 

-- 
2.49.0



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH net-next 5/7] wifi: mwifiex: Don't use %pK through printk
  2025-04-14  8:26 [PATCH net-next 0/7] net: Don't use %pK through printk Thomas Weißschuh
                   ` (3 preceding siblings ...)
  2025-04-14  8:26 ` [PATCH net-next 4/7] wifi: wcn36xx: " Thomas Weißschuh
@ 2025-04-14  8:26 ` Thomas Weißschuh
  2025-04-14 16:15   ` [Intel-wired-lan] " Loktionov, Aleksandr
  2025-04-14  8:26 ` [PATCH net-next 6/7] ice: Don't use %pK through printk or tracepoints Thomas Weißschuh
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Thomas Weißschuh @ 2025-04-14  8:26 UTC (permalink / raw)
  To: Jeff Johnson, Loic Poulain, Brian Norris, Francesco Dolcini,
	Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Saeed Mahameed,
	Leon Romanovsky, Tariq Toukan
  Cc: ath10k, linux-kernel, ath11k, ath12k, wcn36xx, linux-wireless,
	intel-wired-lan, netdev, linux-rdma, 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 looks 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.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 drivers/net/wireless/marvell/mwifiex/pcie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index dd2a42e732f2398892915e1a3ac88b7d3fb4ed3f..a760de191fce7340040b1bc74efb35cf52ce8368 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -2971,7 +2971,7 @@ static int mwifiex_init_pcie(struct mwifiex_adapter *adapter)
 		goto err_iomap2;
 	}
 
-	pr_notice("PCI memory map Virt0: %pK PCI memory map Virt2: %pK\n",
+	pr_notice("PCI memory map Virt0: %p PCI memory map Virt2: %p\n",
 		  card->pci_mmap, card->pci_mmap1);
 
 	ret = mwifiex_pcie_alloc_buffers(adapter);

-- 
2.49.0



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH net-next 6/7] ice: Don't use %pK through printk or tracepoints
  2025-04-14  8:26 [PATCH net-next 0/7] net: Don't use %pK through printk Thomas Weißschuh
                   ` (4 preceding siblings ...)
  2025-04-14  8:26 ` [PATCH net-next 5/7] wifi: mwifiex: " Thomas Weißschuh
@ 2025-04-14  8:26 ` Thomas Weißschuh
  2025-04-14  9:59   ` Przemek Kitszel
  2025-04-14 16:18   ` [Intel-wired-lan] " Loktionov, Aleksandr
  2025-04-14  8:26 ` [PATCH net-next 7/7] net/mlx5: Don't use %pK through tracepoints Thomas Weißschuh
                   ` (3 subsequent siblings)
  9 siblings, 2 replies; 22+ messages in thread
From: Thomas Weißschuh @ 2025-04-14  8:26 UTC (permalink / raw)
  To: Jeff Johnson, Loic Poulain, Brian Norris, Francesco Dolcini,
	Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Saeed Mahameed,
	Leon Romanovsky, Tariq Toukan
  Cc: ath10k, linux-kernel, ath11k, ath12k, wcn36xx, linux-wireless,
	intel-wired-lan, netdev, linux-rdma, 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 looks 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.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 drivers/net/ethernet/intel/ice/ice_main.c  |  2 +-
 drivers/net/ethernet/intel/ice/ice_trace.h | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index d390157b59fe1873ddab78323cdc0bbaea6ad0c5..d27e8816a48fef5014148cae27e52c1801eaaada 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -9118,7 +9118,7 @@ static int ice_create_q_channels(struct ice_vsi *vsi)
 		list_add_tail(&ch->list, &vsi->ch_list);
 		vsi->tc_map_vsi[i] = ch->ch_vsi;
 		dev_dbg(ice_pf_to_dev(pf),
-			"successfully created channel: VSI %pK\n", ch->ch_vsi);
+			"successfully created channel: VSI %p\n", ch->ch_vsi);
 	}
 	return 0;
 
diff --git a/drivers/net/ethernet/intel/ice/ice_trace.h b/drivers/net/ethernet/intel/ice/ice_trace.h
index 07aab6e130cd553fa1fcaa2feac9d14f0433239a..4f35ef8d6b299b4acd6c85992c2c93b164a88372 100644
--- a/drivers/net/ethernet/intel/ice/ice_trace.h
+++ b/drivers/net/ethernet/intel/ice/ice_trace.h
@@ -130,7 +130,7 @@ DECLARE_EVENT_CLASS(ice_tx_template,
 				   __entry->buf = buf;
 				   __assign_str(devname);),
 
-		    TP_printk("netdev: %s ring: %pK desc: %pK buf %pK", __get_str(devname),
+		    TP_printk("netdev: %s ring: %p desc: %p buf %p", __get_str(devname),
 			      __entry->ring, __entry->desc, __entry->buf)
 );
 
@@ -158,7 +158,7 @@ DECLARE_EVENT_CLASS(ice_rx_template,
 				   __entry->desc = desc;
 				   __assign_str(devname);),
 
-		    TP_printk("netdev: %s ring: %pK desc: %pK", __get_str(devname),
+		    TP_printk("netdev: %s ring: %p desc: %p", __get_str(devname),
 			      __entry->ring, __entry->desc)
 );
 DEFINE_EVENT(ice_rx_template, ice_clean_rx_irq,
@@ -182,7 +182,7 @@ DECLARE_EVENT_CLASS(ice_rx_indicate_template,
 				   __entry->skb = skb;
 				   __assign_str(devname);),
 
-		    TP_printk("netdev: %s ring: %pK desc: %pK skb %pK", __get_str(devname),
+		    TP_printk("netdev: %s ring: %p desc: %p skb %p", __get_str(devname),
 			      __entry->ring, __entry->desc, __entry->skb)
 );
 
@@ -205,7 +205,7 @@ DECLARE_EVENT_CLASS(ice_xmit_template,
 				   __entry->skb = skb;
 				   __assign_str(devname);),
 
-		    TP_printk("netdev: %s skb: %pK ring: %pK", __get_str(devname),
+		    TP_printk("netdev: %s skb: %p ring: %p", __get_str(devname),
 			      __entry->skb, __entry->ring)
 );
 
@@ -228,7 +228,7 @@ DECLARE_EVENT_CLASS(ice_tx_tstamp_template,
 		    TP_fast_assign(__entry->skb = skb;
 				   __entry->idx = idx;),
 
-		    TP_printk("skb %pK idx %d",
+		    TP_printk("skb %p idx %d",
 			      __entry->skb, __entry->idx)
 );
 #define DEFINE_TX_TSTAMP_OP_EVENT(name) \

-- 
2.49.0



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH net-next 7/7] net/mlx5: Don't use %pK through tracepoints
  2025-04-14  8:26 [PATCH net-next 0/7] net: Don't use %pK through printk Thomas Weißschuh
                   ` (5 preceding siblings ...)
  2025-04-14  8:26 ` [PATCH net-next 6/7] ice: Don't use %pK through printk or tracepoints Thomas Weißschuh
@ 2025-04-14  8:26 ` Thomas Weißschuh
  2025-04-14 10:49   ` Tariq Toukan
  2025-04-14 16:17   ` [Intel-wired-lan] " Loktionov, Aleksandr
  2025-04-14 15:02 ` [PATCH net-next 0/7] net: Don't use %pK through printk Jeff Johnson
                   ` (2 subsequent siblings)
  9 siblings, 2 replies; 22+ messages in thread
From: Thomas Weißschuh @ 2025-04-14  8:26 UTC (permalink / raw)
  To: Jeff Johnson, Loic Poulain, Brian Norris, Francesco Dolcini,
	Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Saeed Mahameed,
	Leon Romanovsky, Tariq Toukan
  Cc: ath10k, linux-kernel, ath11k, ath12k, wcn36xx, linux-wireless,
	intel-wired-lan, netdev, linux-rdma, 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 tracepoints. They can still unintentionally leak raw pointers or
acquire sleeping looks 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.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 drivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h
index 0537de86f9817dc80bd897688c539135b1ad37ac..9b0f44253f332aa602a84a1f6d7532a500dd4f55 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h
@@ -28,7 +28,7 @@ DECLARE_EVENT_CLASS(mlx5_sf_dev_template,
 				   __entry->hw_fn_id = sfdev->fn_id;
 				   __entry->sfnum = sfdev->sfnum;
 		    ),
-		    TP_printk("(%s) sfdev=%pK aux_id=%d hw_id=0x%x sfnum=%u\n",
+		    TP_printk("(%s) sfdev=%p aux_id=%d hw_id=0x%x sfnum=%u\n",
 			      __get_str(devname), __entry->sfdev,
 			      __entry->aux_id, __entry->hw_fn_id,
 			      __entry->sfnum)

-- 
2.49.0



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 6/7] ice: Don't use %pK through printk or tracepoints
  2025-04-14  8:26 ` [PATCH net-next 6/7] ice: Don't use %pK through printk or tracepoints Thomas Weißschuh
@ 2025-04-14  9:59   ` Przemek Kitszel
  2025-04-14 16:18   ` [Intel-wired-lan] " Loktionov, Aleksandr
  1 sibling, 0 replies; 22+ messages in thread
From: Przemek Kitszel @ 2025-04-14  9:59 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Jeff Johnson, Loic Poulain, Brian Norris, Francesco Dolcini,
	Tony Nguyen, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, ath10k, linux-kernel, ath11k, ath12k,
	wcn36xx, intel-wired-lan, netdev

On 4/14/25 10:26, 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 looks 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.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
thank you!
Acked-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 7/7] net/mlx5: Don't use %pK through tracepoints
  2025-04-14  8:26 ` [PATCH net-next 7/7] net/mlx5: Don't use %pK through tracepoints Thomas Weißschuh
@ 2025-04-14 10:49   ` Tariq Toukan
  2025-04-14 16:17   ` [Intel-wired-lan] " Loktionov, Aleksandr
  1 sibling, 0 replies; 22+ messages in thread
From: Tariq Toukan @ 2025-04-14 10:49 UTC (permalink / raw)
  To: Thomas Weißschuh, Jeff Johnson, Loic Poulain, Brian Norris,
	Francesco Dolcini, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Saeed Mahameed, Leon Romanovsky, Tariq Toukan
  Cc: ath10k, linux-kernel, ath11k, ath12k, wcn36xx, linux-wireless,
	intel-wired-lan, netdev, linux-rdma



On 14/04/2025 11:26, 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 tracepoints. They can still unintentionally leak raw pointers or
> acquire sleeping looks 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.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
>   drivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Tariq Toukan <tariqt@nvidia.com>



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 0/7] net: Don't use %pK through printk
  2025-04-14  8:26 [PATCH net-next 0/7] net: Don't use %pK through printk Thomas Weißschuh
                   ` (6 preceding siblings ...)
  2025-04-14  8:26 ` [PATCH net-next 7/7] net/mlx5: Don't use %pK through tracepoints Thomas Weißschuh
@ 2025-04-14 15:02 ` Jeff Johnson
  2025-04-15  6:42   ` Thomas Weißschuh
  2025-04-14 16:17 ` [Intel-wired-lan] " Loktionov, Aleksandr
  2025-04-14 18:44 ` Brian Norris
  9 siblings, 1 reply; 22+ messages in thread
From: Jeff Johnson @ 2025-04-14 15:02 UTC (permalink / raw)
  To: Thomas Weißschuh, Jeff Johnson, Loic Poulain, Brian Norris,
	Francesco Dolcini, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Saeed Mahameed, Leon Romanovsky, Tariq Toukan
  Cc: ath10k, linux-kernel, ath11k, ath12k, wcn36xx, linux-wireless,
	intel-wired-lan, netdev, linux-rdma

On 4/14/2025 1:26 AM, Thomas Weißschuh wrote:
>       wifi: ath10k: Don't use %pK through printk
>       wifi: ath11k: Don't use %pK through printk
>       wifi: ath12k: Don't use %pK through printk
>       wifi: wcn36xx: Don't use %pK through printk

the first four should go through ath-next and not net-next

>       wifi: mwifiex: Don't use %pK through printk

this should go through wireless-next

/jeff


^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [Intel-wired-lan] [PATCH net-next 5/7] wifi: mwifiex: Don't use %pK through printk
  2025-04-14  8:26 ` [PATCH net-next 5/7] wifi: mwifiex: " Thomas Weißschuh
@ 2025-04-14 16:15   ` Loktionov, Aleksandr
  0 siblings, 0 replies; 22+ messages in thread
From: Loktionov, Aleksandr @ 2025-04-14 16:15 UTC (permalink / raw)
  To: Thomas Weißschuh, Jeff Johnson, Loic Poulain, Brian Norris,
	Francesco Dolcini, Nguyen, Anthony L, Kitszel, Przemyslaw,
	Andrew Lunn, David S. Miller, Dumazet, Eric, Jakub Kicinski,
	Paolo Abeni, Saeed Mahameed, Leon Romanovsky, Tariq Toukan
  Cc: ath10k@lists.infradead.org, linux-kernel@vger.kernel.org,
	ath11k@lists.infradead.org, ath12k@lists.infradead.org,
	wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Thomas Weißschuh
> Sent: Monday, April 14, 2025 10:26 AM
> To: Jeff Johnson <jjohnson@kernel.org>; Loic Poulain
> <loic.poulain@linaro.org>; Brian Norris <briannorris@chromium.org>;
> Francesco Dolcini <francesco@dolcini.it>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>;
> David S. Miller <davem@davemloft.net>; Dumazet, Eric
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Saeed Mahameed <saeedm@nvidia.com>; Leon
> Romanovsky <leon@kernel.org>; Tariq Toukan <tariqt@nvidia.com>
> Cc: ath10k@lists.infradead.org; linux-kernel@vger.kernel.org;
> ath11k@lists.infradead.org; ath12k@lists.infradead.org;
> wcn36xx@lists.infradead.org; linux-wireless@vger.kernel.org; intel-wired-
> lan@lists.osuosl.org; netdev@vger.kernel.org; linux-rdma@vger.kernel.org;
> Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> Subject: [Intel-wired-lan] [PATCH net-next 5/7] wifi: mwifiex: Don't use %pK
> through printk
> 
> 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 looks 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.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
>  drivers/net/wireless/marvell/mwifiex/pcie.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c
> b/drivers/net/wireless/marvell/mwifiex/pcie.c
> index
> dd2a42e732f2398892915e1a3ac88b7d3fb4ed3f..a760de191fce7340040b1
> bc74efb35cf52ce8368 100644
> --- a/drivers/net/wireless/marvell/mwifiex/pcie.c
> +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
> @@ -2971,7 +2971,7 @@ static int mwifiex_init_pcie(struct mwifiex_adapter
> *adapter)
>  		goto err_iomap2;
>  	}
> 
> -	pr_notice("PCI memory map Virt0: %pK PCI memory map Virt2:
> %pK\n",
> +	pr_notice("PCI memory map Virt0: %p PCI memory map Virt2: %p\n",
>  		  card->pci_mmap, card->pci_mmap1);
> 
>  	ret = mwifiex_pcie_alloc_buffers(adapter);
> 
> --
> 2.49.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [Intel-wired-lan] [PATCH net-next 3/7] wifi: ath12k: Don't use %pK through printk
  2025-04-14  8:26 ` [PATCH net-next 3/7] wifi: ath12k: " Thomas Weißschuh
@ 2025-04-14 16:16   ` Loktionov, Aleksandr
  0 siblings, 0 replies; 22+ messages in thread
From: Loktionov, Aleksandr @ 2025-04-14 16:16 UTC (permalink / raw)
  To: Thomas Weißschuh, Jeff Johnson, Loic Poulain, Brian Norris,
	Francesco Dolcini, Nguyen, Anthony L, Kitszel, Przemyslaw,
	Andrew Lunn, David S. Miller, Dumazet, Eric, Jakub Kicinski,
	Paolo Abeni, Saeed Mahameed, Leon Romanovsky, Tariq Toukan
  Cc: ath10k@lists.infradead.org, linux-kernel@vger.kernel.org,
	ath11k@lists.infradead.org, ath12k@lists.infradead.org,
	wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Thomas Weißschuh
> Sent: Monday, April 14, 2025 10:26 AM
> To: Jeff Johnson <jjohnson@kernel.org>; Loic Poulain
> <loic.poulain@linaro.org>; Brian Norris <briannorris@chromium.org>;
> Francesco Dolcini <francesco@dolcini.it>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>;
> David S. Miller <davem@davemloft.net>; Dumazet, Eric
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Saeed Mahameed <saeedm@nvidia.com>; Leon
> Romanovsky <leon@kernel.org>; Tariq Toukan <tariqt@nvidia.com>
> Cc: ath10k@lists.infradead.org; linux-kernel@vger.kernel.org;
> ath11k@lists.infradead.org; ath12k@lists.infradead.org;
> wcn36xx@lists.infradead.org; linux-wireless@vger.kernel.org; intel-wired-
> lan@lists.osuosl.org; netdev@vger.kernel.org; linux-rdma@vger.kernel.org;
> Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> Subject: [Intel-wired-lan] [PATCH net-next 3/7] wifi: ath12k: Don't use %pK
> through printk
> 
> 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 looks 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.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
>  drivers/net/wireless/ath/ath12k/testmode.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath12k/testmode.c
> b/drivers/net/wireless/ath/ath12k/testmode.c
> index
> 18d56a976dc74c4f6eab87e358c14d4faea648e2..fb6af7ccf71f44ae4bd01cd
> e53fba3527eed0d2d 100644
> --- a/drivers/net/wireless/ath/ath12k/testmode.c
> +++ b/drivers/net/wireless/ath/ath12k/testmode.c
> @@ -97,7 +97,7 @@ void ath12k_tm_process_event(struct ath12k_base
> *ab, u32 cmd_id,
>  	u8 const *buf_pos;
> 
>  	ath12k_dbg(ab, ATH12K_DBG_TESTMODE,
> -		   "testmode event wmi cmd_id %d ftm event msg %pK
> datalen %d\n",
> +		   "testmode event wmi cmd_id %d ftm event msg %p datalen
> %d\n",
>  		   cmd_id, ftm_msg, length);
>  	ath12k_dbg_dump(ab, ATH12K_DBG_TESTMODE, NULL, "", ftm_msg,
> length);
>  	pdev_id = DP_HW2SW_MACID(le32_to_cpu(ftm_msg-
> >seg_hdr.pdev_id));
> @@ -227,7 +227,7 @@ static int ath12k_tm_cmd_process_ftm(struct ath12k
> *ar, struct nlattr *tb[])
>  	buf_len = nla_len(tb[ATH_TM_ATTR_DATA]);
>  	cmd_id = WMI_PDEV_UTF_CMDID;
>  	ath12k_dbg(ar->ab, ATH12K_DBG_TESTMODE,
> -		   "testmode cmd wmi cmd_id %d buf %pK buf_len %d\n",
> +		   "testmode cmd wmi cmd_id %d buf %p buf_len %d\n",
>  		   cmd_id, buf, buf_len);
>  	ath12k_dbg_dump(ar->ab, ATH12K_DBG_TESTMODE, NULL, "", buf,
> buf_len);
>  	bufpos = buf;
> 
> --
> 2.49.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [Intel-wired-lan] [PATCH net-next 1/7] wifi: ath10k: Don't use %pK through printk
  2025-04-14  8:26 ` [PATCH net-next 1/7] wifi: ath10k: " Thomas Weißschuh
@ 2025-04-14 16:16   ` Loktionov, Aleksandr
  0 siblings, 0 replies; 22+ messages in thread
From: Loktionov, Aleksandr @ 2025-04-14 16:16 UTC (permalink / raw)
  To: Thomas Weißschuh, Jeff Johnson, Loic Poulain, Brian Norris,
	Francesco Dolcini, Nguyen, Anthony L, Kitszel, Przemyslaw,
	Andrew Lunn, David S. Miller, Dumazet, Eric, Jakub Kicinski,
	Paolo Abeni, Saeed Mahameed, Leon Romanovsky, Tariq Toukan
  Cc: ath10k@lists.infradead.org, linux-kernel@vger.kernel.org,
	ath11k@lists.infradead.org, ath12k@lists.infradead.org,
	wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Thomas Weißschuh
> Sent: Monday, April 14, 2025 10:26 AM
> To: Jeff Johnson <jjohnson@kernel.org>; Loic Poulain
> <loic.poulain@linaro.org>; Brian Norris <briannorris@chromium.org>;
> Francesco Dolcini <francesco@dolcini.it>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>;
> David S. Miller <davem@davemloft.net>; Dumazet, Eric
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Saeed Mahameed <saeedm@nvidia.com>; Leon
> Romanovsky <leon@kernel.org>; Tariq Toukan <tariqt@nvidia.com>
> Cc: ath10k@lists.infradead.org; linux-kernel@vger.kernel.org;
> ath11k@lists.infradead.org; ath12k@lists.infradead.org;
> wcn36xx@lists.infradead.org; linux-wireless@vger.kernel.org; intel-wired-
> lan@lists.osuosl.org; netdev@vger.kernel.org; linux-rdma@vger.kernel.org;
> Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> Subject: [Intel-wired-lan] [PATCH net-next 1/7] wifi: ath10k: Don't use %pK
> through printk
> 
> 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 looks 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.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
>  drivers/net/wireless/ath/ath10k/ahb.c      |  2 +-
>  drivers/net/wireless/ath/ath10k/bmi.c      |  6 +++---
>  drivers/net/wireless/ath/ath10k/ce.c       |  4 ++--
>  drivers/net/wireless/ath/ath10k/core.c     |  4 ++--
>  drivers/net/wireless/ath/ath10k/htc.c      |  6 +++---
>  drivers/net/wireless/ath/ath10k/htt_rx.c   |  2 +-
>  drivers/net/wireless/ath/ath10k/mac.c      | 22 +++++++++++-----------
>  drivers/net/wireless/ath/ath10k/pci.c      |  2 +-
>  drivers/net/wireless/ath/ath10k/testmode.c |  4 ++--
>  drivers/net/wireless/ath/ath10k/txrx.c     |  2 +-
>  drivers/net/wireless/ath/ath10k/usb.c      |  4 ++--
>  drivers/net/wireless/ath/ath10k/wmi.c      |  4 ++--
>  12 files changed, 31 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath10k/ahb.c
> b/drivers/net/wireless/ath/ath10k/ahb.c
> index
> db9f9ebcb62d20e5cdcf9e7b08f5ea23e0dc3d22..eb8b35b6224dbf2540013
> a4a066646ecc9a3db75 100644
> --- a/drivers/net/wireless/ath/ath10k/ahb.c
> +++ b/drivers/net/wireless/ath/ath10k/ahb.c
> @@ -497,7 +497,7 @@ static int ath10k_ahb_resource_init(struct ath10k
> *ar)
> 
>  	ath10k_dbg(ar, ATH10K_DBG_BOOT, "irq: %d\n", ar_ahb->irq);
> 
> -	ath10k_dbg(ar, ATH10K_DBG_BOOT, "mem: 0x%pK mem_len: %lu gcc
> mem: 0x%pK tcsr_mem: 0x%pK\n",
> +	ath10k_dbg(ar, ATH10K_DBG_BOOT, "mem: 0x%p mem_len: %lu gcc
> mem: 0x%p
> +tcsr_mem: 0x%p\n",
>  		   ar_ahb->mem, ar_ahb->mem_len,
>  		   ar_ahb->gcc_mem, ar_ahb->tcsr_mem);
>  	return 0;
> diff --git a/drivers/net/wireless/ath/ath10k/bmi.c
> b/drivers/net/wireless/ath/ath10k/bmi.c
> index
> 9a4f8e815412cba207f3a788013d362a36a02ac3..48efdc71d54dc699e1d43
> d01507a7a30c9c495b4 100644
> --- a/drivers/net/wireless/ath/ath10k/bmi.c
> +++ b/drivers/net/wireless/ath/ath10k/bmi.c
> @@ -349,7 +349,7 @@ static int ath10k_bmi_lz_data_large(struct ath10k
> *ar, const void *buffer, u32 l
>  	int ret;
>  	size_t buf_len;
> 
> -	ath10k_dbg(ar, ATH10K_DBG_BMI, "large bmi lz data buffer 0x%pK
> length %d\n",
> +	ath10k_dbg(ar, ATH10K_DBG_BMI, "large bmi lz data buffer 0x%p
> length
> +%d\n",
>  		   buffer, length);
> 
>  	if (ar->bmi.done_sent) {
> @@ -395,7 +395,7 @@ int ath10k_bmi_lz_data(struct ath10k *ar, const void
> *buffer, u32 length)
>  	u32 txlen;
>  	int ret;
> 
> -	ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi lz data buffer 0x%pK length
> %d\n",
> +	ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi lz data buffer 0x%p length
> %d\n",
>  		   buffer, length);
> 
>  	if (ar->bmi.done_sent) {
> @@ -461,7 +461,7 @@ int ath10k_bmi_fast_download(struct ath10k *ar,
>  	int ret;
> 
>  	ath10k_dbg(ar, ATH10K_DBG_BMI,
> -		   "bmi fast download address 0x%x buffer 0x%pK length
> %d\n",
> +		   "bmi fast download address 0x%x buffer 0x%p length %d\n",
>  		   address, buffer, length);
> 
>  	ret = ath10k_bmi_lz_stream_start(ar, address); diff --git
> a/drivers/net/wireless/ath/ath10k/ce.c
> b/drivers/net/wireless/ath/ath10k/ce.c
> index
> afae4a8027f8338ad9fed64880fa16fed09f32e4..4fc81ae17a8af4816919400
> cd77061c5aa7f6c3a 100644
> --- a/drivers/net/wireless/ath/ath10k/ce.c
> +++ b/drivers/net/wireless/ath/ath10k/ce.c
> @@ -1388,7 +1388,7 @@ static int ath10k_ce_init_src_ring(struct ath10k
> *ar,
>  	ath10k_ce_src_ring_highmark_set(ar, ctrl_addr, nentries);
> 
>  	ath10k_dbg(ar, ATH10K_DBG_BOOT,
> -		   "boot init ce src ring id %d entries %d base_addr %pK\n",
> +		   "boot init ce src ring id %d entries %d base_addr %p\n",
>  		   ce_id, nentries, src_ring->base_addr_owner_space);
> 
>  	return 0;
> @@ -1426,7 +1426,7 @@ static int ath10k_ce_init_dest_ring(struct ath10k
> *ar,
>  	ath10k_ce_dest_ring_highmark_set(ar, ctrl_addr, nentries);
> 
>  	ath10k_dbg(ar, ATH10K_DBG_BOOT,
> -		   "boot ce dest ring id %d entries %d base_addr %pK\n",
> +		   "boot ce dest ring id %d entries %d base_addr %p\n",
>  		   ce_id, nentries, dest_ring->base_addr_owner_space);
> 
>  	return 0;
> diff --git a/drivers/net/wireless/ath/ath10k/core.c
> b/drivers/net/wireless/ath/ath10k/core.c
> index
> 6d336e39d6738bbe7973a25e073d03a07b9ae733..fe3a8f4a1cc1b774ce27
> 112ef7dfe6adb0b4dc2f 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -1200,7 +1200,7 @@ static int ath10k_download_fw(struct ath10k *ar)
>  	}
> 
>  	ath10k_dbg(ar, ATH10K_DBG_BOOT,
> -		   "boot uploading firmware image %pK len %d\n",
> +		   "boot uploading firmware image %p len %d\n",
>  		   data, data_len);
> 
>  	/* Check if device supports to download firmware via @@ -1826,7
> +1826,7 @@ static int ath10k_download_and_run_otp(struct ath10k *ar)
> 
>  	if (!ar->running_fw->fw_file.otp_data ||
>  	    !ar->running_fw->fw_file.otp_len) {
> -		ath10k_warn(ar, "Not running otp, calibration will be incorrect
> (otp-data %pK otp_len %zd)!\n",
> +		ath10k_warn(ar, "Not running otp, calibration will be incorrect
> +(otp-data %p otp_len %zd)!\n",
>  			    ar->running_fw->fw_file.otp_data,
>  			    ar->running_fw->fw_file.otp_len);
>  		return 0;
> diff --git a/drivers/net/wireless/ath/ath10k/htc.c
> b/drivers/net/wireless/ath/ath10k/htc.c
> index
> a6e21ce90bad64d91afee2b4f46bfbf136547cba..2da08dfebd3e7b56b149a0
> 9b5372aa0bfb8538d1 100644
> --- a/drivers/net/wireless/ath/ath10k/htc.c
> +++ b/drivers/net/wireless/ath/ath10k/htc.c
> @@ -34,7 +34,7 @@ static struct sk_buff *ath10k_htc_build_tx_ctrl_skb(void
> *ar)
>  	skb_cb = ATH10K_SKB_CB(skb);
>  	memset(skb_cb, 0, sizeof(*skb_cb));
> 
> -	ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: skb %pK\n", __func__, skb);
> +	ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: skb %p\n", __func__, skb);
>  	return skb;
>  }
> 
> @@ -54,7 +54,7 @@ void ath10k_htc_notify_tx_completion(struct
> ath10k_htc_ep *ep,
>  	struct ath10k *ar = ep->htc->ar;
>  	struct ath10k_htc_hdr *hdr;
> 
> -	ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: ep %d skb %pK\n", __func__,
> +	ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: ep %d skb %p\n", __func__,
>  		   ep->eid, skb);
> 
>  	/* A corner case where the copy completion is reaching to host but still
> @@ -515,7 +515,7 @@ void ath10k_htc_rx_completion_handler(struct
> ath10k *ar, struct sk_buff *skb)
>  		/* zero length packet with trailer data, just drop these */
>  		goto out;
> 
> -	ath10k_dbg(ar, ATH10K_DBG_HTC, "htc rx completion ep %d skb
> %pK\n",
> +	ath10k_dbg(ar, ATH10K_DBG_HTC, "htc rx completion ep %d skb
> %p\n",
>  		   eid, skb);
>  	ep->ep_ops.ep_rx_complete(ar, skb);
> 
> diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c
> b/drivers/net/wireless/ath/ath10k/htt_rx.c
> index
> 83eab7479f0699513c2a08297f7dec2f00599340..52981052e211a0e23271
> 779f8589618e0b9c8de4 100644
> --- a/drivers/net/wireless/ath/ath10k/htt_rx.c
> +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
> @@ -1373,7 +1373,7 @@ static void ath10k_process_rx(struct ath10k *ar,
> struct sk_buff *skb)
>  	}
> 
>  	ath10k_dbg(ar, ATH10K_DBG_DATA,
> -		   "rx skb %pK len %u peer %pM %s %s sn %u %s%s%s%s%s%s
> %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i
> amsdu-more %i\n",
> +		   "rx skb %p len %u peer %pM %s %s sn %u %s%s%s%s%s%s
> %srate_idx %u
> +vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more
> +%i\n",
>  		   skb,
>  		   skb->len,
>  		   ieee80211_get_SA(hdr),
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c
> b/drivers/net/wireless/ath/ath10k/mac.c
> index
> c61b95a928dac12fb9e11164fb45a53831f8de11..8c7ffea0fa44b5d3c03f2fd
> 7191fb757a4966ad6 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -875,7 +875,7 @@ static void ath10k_peer_map_cleanup(struct ath10k
> *ar, struct ath10k_peer *peer)
>  	 */
>  	for (i = 0; i < ARRAY_SIZE(ar->peer_map); i++) {
>  		if (ar->peer_map[i] == peer) {
> -			ath10k_warn(ar, "removing stale peer_map entry for
> %pM (ptr %pK idx %d)\n",
> +			ath10k_warn(ar, "removing stale peer_map entry for
> %pM (ptr %p idx
> +%d)\n",
>  				    peer->addr, peer, i);
>  			ar->peer_map[i] = NULL;
>  		}
> @@ -4063,7 +4063,7 @@ static int ath10k_mac_tx(struct ath10k *ar,
> 
>  	if (!noque_offchan && info->flags &
> IEEE80211_TX_CTL_TX_OFFCHAN) {
>  		if (!ath10k_mac_tx_frm_has_freq(ar)) {
> -			ath10k_dbg(ar, ATH10K_DBG_MAC, "mac queued
> offchannel skb %pK len %d\n",
> +			ath10k_dbg(ar, ATH10K_DBG_MAC, "mac queued
> offchannel skb %p len
> +%d\n",
>  				   skb, skb->len);
> 
>  			skb_queue_tail(&ar->offchan_tx_queue, skb); @@ -
> 4126,7 +4126,7 @@ void ath10k_offchan_tx_work(struct work_struct
> *work)
> 
>  		mutex_lock(&ar->conf_mutex);
> 
> -		ath10k_dbg(ar, ATH10K_DBG_MAC, "mac offchannel skb %pK
> len %d\n",
> +		ath10k_dbg(ar, ATH10K_DBG_MAC, "mac offchannel skb %p
> len %d\n",
>  			   skb, skb->len);
> 
>  		hdr = (struct ieee80211_hdr *)skb->data; @@ -4181,7
> +4181,7 @@ void ath10k_offchan_tx_work(struct work_struct *work)
>  		time_left =
>  		wait_for_completion_timeout(&ar->offchan_tx_completed, 3
> * HZ);
>  		if (time_left == 0)
> -			ath10k_warn(ar, "timed out waiting for offchannel skb
> %pK, len: %d\n",
> +			ath10k_warn(ar, "timed out waiting for offchannel skb
> %p, len:
> +%d\n",
>  				    skb, skb->len);
> 
>  		if (!peer && tmp_peer_created) {
> @@ -7604,7 +7604,7 @@ static int ath10k_sta_state(struct ieee80211_hw
> *hw,
>  		 * Existing station deletion.
>  		 */
>  		ath10k_dbg(ar, ATH10K_DBG_STA,
> -			   "mac vdev %d peer delete %pM sta %pK (sta
> gone)\n",
> +			   "mac vdev %d peer delete %pM sta %p (sta
> gone)\n",
>  			   arvif->vdev_id, sta->addr, sta);
> 
>  		if (sta->tdls) {
> @@ -7631,7 +7631,7 @@ static int ath10k_sta_state(struct ieee80211_hw
> *hw,
>  				continue;
> 
>  			if (peer->sta == sta) {
> -				ath10k_warn(ar, "found sta peer %pM (ptr
> %pK id %d) entry on vdev %i after it was supposedly removed\n",
> +				ath10k_warn(ar, "found sta peer %pM (ptr
> %p id %d) entry on vdev %i
> +after it was supposedly removed\n",
>  					    sta->addr, peer, i, arvif->vdev_id);
>  				peer->sta = NULL;
> 
> @@ -8811,7 +8811,7 @@ ath10k_mac_op_add_chanctx(struct
> ieee80211_hw *hw,
>  	struct ath10k *ar = hw->priv;
> 
>  	ath10k_dbg(ar, ATH10K_DBG_MAC,
> -		   "mac chanctx add freq %u width %d ptr %pK\n",
> +		   "mac chanctx add freq %u width %d ptr %p\n",
>  		   ctx->def.chan->center_freq, ctx->def.width, ctx);
> 
>  	mutex_lock(&ar->conf_mutex);
> @@ -8835,7 +8835,7 @@ ath10k_mac_op_remove_chanctx(struct
> ieee80211_hw *hw,
>  	struct ath10k *ar = hw->priv;
> 
>  	ath10k_dbg(ar, ATH10K_DBG_MAC,
> -		   "mac chanctx remove freq %u width %d ptr %pK\n",
> +		   "mac chanctx remove freq %u width %d ptr %p\n",
>  		   ctx->def.chan->center_freq, ctx->def.width, ctx);
> 
>  	mutex_lock(&ar->conf_mutex);
> @@ -8900,7 +8900,7 @@ ath10k_mac_op_change_chanctx(struct
> ieee80211_hw *hw,
>  	mutex_lock(&ar->conf_mutex);
> 
>  	ath10k_dbg(ar, ATH10K_DBG_MAC,
> -		   "mac chanctx change freq %u width %d ptr %pK changed
> %x\n",
> +		   "mac chanctx change freq %u width %d ptr %p changed
> %x\n",
>  		   ctx->def.chan->center_freq, ctx->def.width, ctx, changed);
> 
>  	/* This shouldn't really happen because channel switching should use
> @@ -8959,7 +8959,7 @@ ath10k_mac_op_assign_vif_chanctx(struct
> ieee80211_hw *hw,
>  	mutex_lock(&ar->conf_mutex);
> 
>  	ath10k_dbg(ar, ATH10K_DBG_MAC,
> -		   "mac chanctx assign ptr %pK vdev_id %i\n",
> +		   "mac chanctx assign ptr %p vdev_id %i\n",
>  		   ctx, arvif->vdev_id);
> 
>  	if (WARN_ON(arvif->is_started)) {
> @@ -9039,7 +9039,7 @@ ath10k_mac_op_unassign_vif_chanctx(struct
> ieee80211_hw *hw,
>  	mutex_lock(&ar->conf_mutex);
> 
>  	ath10k_dbg(ar, ATH10K_DBG_MAC,
> -		   "mac chanctx unassign ptr %pK vdev_id %i\n",
> +		   "mac chanctx unassign ptr %p vdev_id %i\n",
>  		   ctx, arvif->vdev_id);
> 
>  	WARN_ON(!arvif->is_started);
> diff --git a/drivers/net/wireless/ath/ath10k/pci.c
> b/drivers/net/wireless/ath/ath10k/pci.c
> index
> fb2c60ee433c3fc15dc7e1adf9e6d4e67862e901..20ec0a6d0f71c4fee3bf1a3
> d48b512ebcdfba856 100644
> --- a/drivers/net/wireless/ath/ath10k/pci.c
> +++ b/drivers/net/wireless/ath/ath10k/pci.c
> @@ -3411,7 +3411,7 @@ static int ath10k_pci_claim(struct ath10k *ar)
>  		goto err_region;
>  	}
> 
> -	ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot pci_mem 0x%pK\n",
> ar_pci->mem);
> +	ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot pci_mem 0x%p\n", ar_pci-
> >mem);
>  	return 0;
> 
>  err_region:
> diff --git a/drivers/net/wireless/ath/ath10k/testmode.c
> b/drivers/net/wireless/ath/ath10k/testmode.c
> index
> 7a9b9bbcdbfc5a290128ec55d3d3ce158a7b58c7..3fcefc55b74f2995be53f5
> d077e3a6a06aed900b 100644
> --- a/drivers/net/wireless/ath/ath10k/testmode.c
> +++ b/drivers/net/wireless/ath/ath10k/testmode.c
> @@ -35,7 +35,7 @@ bool ath10k_tm_event_wmi(struct ath10k *ar, u32
> cmd_id, struct sk_buff *skb)
>  	int ret;
> 
>  	ath10k_dbg(ar, ATH10K_DBG_TESTMODE,
> -		   "testmode event wmi cmd_id %d skb %pK skb->len %d\n",
> +		   "testmode event wmi cmd_id %d skb %p skb->len %d\n",
>  		   cmd_id, skb, skb->len);
> 
>  	ath10k_dbg_dump(ar, ATH10K_DBG_TESTMODE, NULL, "", skb-
> >data, skb->len); @@ -397,7 +397,7 @@ static int
> ath10k_tm_cmd_wmi(struct ath10k *ar, struct nlattr *tb[])
>  	cmd_id = nla_get_u32(tb[ATH10K_TM_ATTR_WMI_CMDID]);
> 
>  	ath10k_dbg(ar, ATH10K_DBG_TESTMODE,
> -		   "testmode cmd wmi cmd_id %d buf %pK buf_len %d\n",
> +		   "testmode cmd wmi cmd_id %d buf %p buf_len %d\n",
>  		   cmd_id, buf, buf_len);
> 
>  	ath10k_dbg_dump(ar, ATH10K_DBG_TESTMODE, NULL, "", buf,
> buf_len); diff --git a/drivers/net/wireless/ath/ath10k/txrx.c
> b/drivers/net/wireless/ath/ath10k/txrx.c
> index
> da3bc35e41aa08da9c325a34d4ab82b64d6f80cc..493bfb410aff3d842c217
> dab3f43c5c921a4ac0e 100644
> --- a/drivers/net/wireless/ath/ath10k/txrx.c
> +++ b/drivers/net/wireless/ath/ath10k/txrx.c
> @@ -35,7 +35,7 @@ static void ath10k_report_offchan_tx(struct ath10k *ar,
> struct sk_buff *skb)
>  	complete(&ar->offchan_tx_completed);
>  	ar->offchan_tx_skb = NULL; /* just for sanity */
> 
> -	ath10k_dbg(ar, ATH10K_DBG_HTT, "completed offchannel skb
> %pK\n", skb);
> +	ath10k_dbg(ar, ATH10K_DBG_HTT, "completed offchannel skb %p\n",
> skb);
>  out:
>  	spin_unlock_bh(&ar->data_lock);
>  }
> diff --git a/drivers/net/wireless/ath/ath10k/usb.c
> b/drivers/net/wireless/ath/ath10k/usb.c
> index
> 3b51b7f52130ee3d94c9b2791dccf47a46e52e95..1732a4f98418df948759
> 535dd979eceec00c06eb 100644
> --- a/drivers/net/wireless/ath/ath10k/usb.c
> +++ b/drivers/net/wireless/ath/ath10k/usb.c
> @@ -131,7 +131,7 @@ static void ath10k_usb_recv_complete(struct urb
> *urb)
>  	int status = 0;
> 
>  	ath10k_dbg(ar, ATH10K_DBG_USB_BULK,
> -		   "usb recv pipe %d stat %d len %d urb 0x%pK\n",
> +		   "usb recv pipe %d stat %d len %d urb 0x%p\n",
>  		   pipe->logical_pipe_num, urb->status, urb->actual_length,
>  		   urb);
> 
> @@ -230,7 +230,7 @@ static void ath10k_usb_post_recv_transfers(struct
> ath10k *ar,
>  				  ath10k_usb_recv_complete, urb_context);
> 
>  		ath10k_dbg(ar, ATH10K_DBG_USB_BULK,
> -			   "usb bulk recv submit %d 0x%x ep 0x%2.2x len %d
> buf 0x%pK\n",
> +			   "usb bulk recv submit %d 0x%x ep 0x%2.2x len %d
> buf 0x%p\n",
>  			   recv_pipe->logical_pipe_num,
>  			   recv_pipe->usb_pipe_handle, recv_pipe-
> >ep_address,
>  			   ATH10K_USB_RX_BUFFER_SIZE, urb_context->skb);
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.c
> b/drivers/net/wireless/ath/ath10k/wmi.c
> index
> 5e061f7525a6bdec402e3571810fd86774ec8588..df6a24f8f8d5b5a61957b
> 44d705f811b2ff88a44 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -2029,7 +2029,7 @@ ath10k_wmi_op_gen_mgmt_tx(struct ath10k *ar,
> struct sk_buff *msdu)
>  	ether_addr_copy(cmd->hdr.peer_macaddr.addr,
> ieee80211_get_DA(hdr));
>  	memcpy(cmd->buf, msdu->data, msdu->len);
> 
> -	ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi mgmt tx skb %pK len %d
> ftype %02x stype %02x\n",
> +	ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi mgmt tx skb %p len %d
> ftype %02x
> +stype %02x\n",
>  		   msdu, skb->len, fc & IEEE80211_FCTL_FTYPE,
>  		   fc & IEEE80211_FCTL_STYPE);
>  	trace_ath10k_tx_hdr(ar, skb->data, skb->len); @@ -2637,7 +2637,7
> @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
>  		status->boottime_ns = ktime_get_boottime_ns();
> 
>  	ath10k_dbg(ar, ATH10K_DBG_MGMT,
> -		   "event mgmt rx skb %pK len %d ftype %02x stype %02x\n",
> +		   "event mgmt rx skb %p len %d ftype %02x stype %02x\n",
>  		   skb, skb->len,
>  		   fc & IEEE80211_FCTL_FTYPE, fc & IEEE80211_FCTL_STYPE);
> 
> 
> --
> 2.49.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [Intel-wired-lan] [PATCH net-next 0/7] net: Don't use %pK through printk
  2025-04-14  8:26 [PATCH net-next 0/7] net: Don't use %pK through printk Thomas Weißschuh
                   ` (7 preceding siblings ...)
  2025-04-14 15:02 ` [PATCH net-next 0/7] net: Don't use %pK through printk Jeff Johnson
@ 2025-04-14 16:17 ` Loktionov, Aleksandr
  2025-04-14 18:44 ` Brian Norris
  9 siblings, 0 replies; 22+ messages in thread
From: Loktionov, Aleksandr @ 2025-04-14 16:17 UTC (permalink / raw)
  To: Thomas Weißschuh, Jeff Johnson, Loic Poulain, Brian Norris,
	Francesco Dolcini, Nguyen, Anthony L, Kitszel, Przemyslaw,
	Andrew Lunn, David S. Miller, Dumazet, Eric, Jakub Kicinski,
	Paolo Abeni, Saeed Mahameed, Leon Romanovsky, Tariq Toukan
  Cc: ath10k@lists.infradead.org, linux-kernel@vger.kernel.org,
	ath11k@lists.infradead.org, ath12k@lists.infradead.org,
	wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Thomas Weißschuh
> Sent: Monday, April 14, 2025 10:26 AM
> To: Jeff Johnson <jjohnson@kernel.org>; Loic Poulain
> <loic.poulain@linaro.org>; Brian Norris <briannorris@chromium.org>;
> Francesco Dolcini <francesco@dolcini.it>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>;
> David S. Miller <davem@davemloft.net>; Dumazet, Eric
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Saeed Mahameed <saeedm@nvidia.com>; Leon
> Romanovsky <leon@kernel.org>; Tariq Toukan <tariqt@nvidia.com>
> Cc: ath10k@lists.infradead.org; linux-kernel@vger.kernel.org;
> ath11k@lists.infradead.org; ath12k@lists.infradead.org;
> wcn36xx@lists.infradead.org; linux-wireless@vger.kernel.org; intel-wired-
> lan@lists.osuosl.org; netdev@vger.kernel.org; linux-rdma@vger.kernel.org;
> Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> Subject: [Intel-wired-lan] [PATCH net-next 0/7] net: Don't use %pK through
> printk
> 
> 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 looks 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.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> Thomas Weißschuh (7):
>       wifi: ath10k: Don't use %pK through printk
>       wifi: ath11k: Don't use %pK through printk
>       wifi: ath12k: Don't use %pK through printk
>       wifi: wcn36xx: Don't use %pK through printk
>       wifi: mwifiex: Don't use %pK through printk
>       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 +++++-----
>  .../mlx5/core/sf/dev/diag/dev_tracepoint.h         |  2 +-
>  drivers/net/wireless/ath/ath10k/ahb.c              |  2 +-
>  drivers/net/wireless/ath/ath10k/bmi.c              |  6 +++---
>  drivers/net/wireless/ath/ath10k/ce.c               |  4 ++--
>  drivers/net/wireless/ath/ath10k/core.c             |  4 ++--
>  drivers/net/wireless/ath/ath10k/htc.c              |  6 +++---
>  drivers/net/wireless/ath/ath10k/htt_rx.c           |  2 +-
>  drivers/net/wireless/ath/ath10k/mac.c              | 22 +++++++++++-----------
>  drivers/net/wireless/ath/ath10k/pci.c              |  2 +-
>  drivers/net/wireless/ath/ath10k/testmode.c         |  4 ++--
>  drivers/net/wireless/ath/ath10k/txrx.c             |  2 +-
>  drivers/net/wireless/ath/ath10k/usb.c              |  4 ++--
>  drivers/net/wireless/ath/ath10k/wmi.c              |  4 ++--
>  drivers/net/wireless/ath/ath11k/testmode.c         |  2 +-
>  drivers/net/wireless/ath/ath12k/testmode.c         |  4 ++--
>  drivers/net/wireless/ath/wcn36xx/testmode.c        |  2 +-
>  drivers/net/wireless/marvell/mwifiex/pcie.c        |  2 +-
>  19 files changed, 43 insertions(+), 43 deletions(-)
> ---
> base-commit: 8ffd015db85fea3e15a77027fda6c02ced4d2444
> change-id: 20250404-restricted-pointers-net-a8cddd03e5d1
> 
> Best regards,
> --
> Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [Intel-wired-lan] [PATCH net-next 2/7] wifi: ath11k: Don't use %pK through printk
  2025-04-14  8:26 ` [PATCH net-next 2/7] wifi: ath11k: " Thomas Weißschuh
@ 2025-04-14 16:17   ` Loktionov, Aleksandr
  0 siblings, 0 replies; 22+ messages in thread
From: Loktionov, Aleksandr @ 2025-04-14 16:17 UTC (permalink / raw)
  To: Thomas Weißschuh, Jeff Johnson, Loic Poulain, Brian Norris,
	Francesco Dolcini, Nguyen, Anthony L, Kitszel, Przemyslaw,
	Andrew Lunn, David S. Miller, Dumazet, Eric, Jakub Kicinski,
	Paolo Abeni, Saeed Mahameed, Leon Romanovsky, Tariq Toukan
  Cc: ath10k@lists.infradead.org, linux-kernel@vger.kernel.org,
	ath11k@lists.infradead.org, ath12k@lists.infradead.org,
	wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Thomas Weißschuh
> Sent: Monday, April 14, 2025 10:26 AM
> To: Jeff Johnson <jjohnson@kernel.org>; Loic Poulain
> <loic.poulain@linaro.org>; Brian Norris <briannorris@chromium.org>;
> Francesco Dolcini <francesco@dolcini.it>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>;
> David S. Miller <davem@davemloft.net>; Dumazet, Eric
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Saeed Mahameed <saeedm@nvidia.com>; Leon
> Romanovsky <leon@kernel.org>; Tariq Toukan <tariqt@nvidia.com>
> Cc: ath10k@lists.infradead.org; linux-kernel@vger.kernel.org;
> ath11k@lists.infradead.org; ath12k@lists.infradead.org;
> wcn36xx@lists.infradead.org; linux-wireless@vger.kernel.org; intel-wired-
> lan@lists.osuosl.org; netdev@vger.kernel.org; linux-rdma@vger.kernel.org;
> Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> Subject: [Intel-wired-lan] [PATCH net-next 2/7] wifi: ath11k: Don't use %pK
> through printk
> 
> 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 looks 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.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
>  drivers/net/wireless/ath/ath11k/testmode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/testmode.c
> b/drivers/net/wireless/ath/ath11k/testmode.c
> index
> 9be1cd742339c95ffa74c09bee924f4eff15134a..a9751ea2a0b73009bfb600
> d51c3978200ce99114 100644
> --- a/drivers/net/wireless/ath/ath11k/testmode.c
> +++ b/drivers/net/wireless/ath/ath11k/testmode.c
> @@ -107,7 +107,7 @@ static int ath11k_tm_process_event(struct
> ath11k_base *ab, u32 cmd_id,
>  	u32 pdev_id;
> 
>  	ath11k_dbg(ab, ATH11K_DBG_TESTMODE,
> -		   "event wmi cmd_id %d ftm event msg %pK datalen %d\n",
> +		   "event wmi cmd_id %d ftm event msg %p datalen %d\n",
>  		   cmd_id, ftm_msg, length);
>  	ath11k_dbg_dump(ab, ATH11K_DBG_TESTMODE, NULL, "", ftm_msg,
> length);
>  	pdev_id = DP_HW2SW_MACID(ftm_msg->seg_hdr.pdev_id);
> 
> --
> 2.49.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [Intel-wired-lan] [PATCH net-next 7/7] net/mlx5: Don't use %pK through tracepoints
  2025-04-14  8:26 ` [PATCH net-next 7/7] net/mlx5: Don't use %pK through tracepoints Thomas Weißschuh
  2025-04-14 10:49   ` Tariq Toukan
@ 2025-04-14 16:17   ` Loktionov, Aleksandr
  1 sibling, 0 replies; 22+ messages in thread
From: Loktionov, Aleksandr @ 2025-04-14 16:17 UTC (permalink / raw)
  To: Thomas Weißschuh, Jeff Johnson, Loic Poulain, Brian Norris,
	Francesco Dolcini, Nguyen, Anthony L, Kitszel, Przemyslaw,
	Andrew Lunn, David S. Miller, Dumazet, Eric, Jakub Kicinski,
	Paolo Abeni, Saeed Mahameed, Leon Romanovsky, Tariq Toukan
  Cc: ath10k@lists.infradead.org, linux-kernel@vger.kernel.org,
	ath11k@lists.infradead.org, ath12k@lists.infradead.org,
	wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Thomas Weißschuh
> Sent: Monday, April 14, 2025 10:26 AM
> To: Jeff Johnson <jjohnson@kernel.org>; Loic Poulain
> <loic.poulain@linaro.org>; Brian Norris <briannorris@chromium.org>;
> Francesco Dolcini <francesco@dolcini.it>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>;
> David S. Miller <davem@davemloft.net>; Dumazet, Eric
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Saeed Mahameed <saeedm@nvidia.com>; Leon
> Romanovsky <leon@kernel.org>; Tariq Toukan <tariqt@nvidia.com>
> Cc: ath10k@lists.infradead.org; linux-kernel@vger.kernel.org;
> ath11k@lists.infradead.org; ath12k@lists.infradead.org;
> wcn36xx@lists.infradead.org; linux-wireless@vger.kernel.org; intel-wired-
> lan@lists.osuosl.org; netdev@vger.kernel.org; linux-rdma@vger.kernel.org;
> Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> Subject: [Intel-wired-lan] [PATCH net-next 7/7] net/mlx5: Don't use %pK
> through 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 tracepoints. They can still unintentionally leak raw pointers or acquire
> sleeping looks 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.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h | 2
> +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h
> b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h
> index
> 0537de86f9817dc80bd897688c539135b1ad37ac..9b0f44253f332aa602a8
> 4a1f6d7532a500dd4f55 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/diag/dev_tracepoint
> +++ .h
> @@ -28,7 +28,7 @@ DECLARE_EVENT_CLASS(mlx5_sf_dev_template,
>  				   __entry->hw_fn_id = sfdev->fn_id;
>  				   __entry->sfnum = sfdev->sfnum;
>  		    ),
> -		    TP_printk("(%s) sfdev=%pK aux_id=%d hw_id=0x%x
> sfnum=%u\n",
> +		    TP_printk("(%s) sfdev=%p aux_id=%d hw_id=0x%x
> sfnum=%u\n",
>  			      __get_str(devname), __entry->sfdev,
>  			      __entry->aux_id, __entry->hw_fn_id,
>  			      __entry->sfnum)
> 
> --
> 2.49.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [Intel-wired-lan] [PATCH net-next 6/7] ice: Don't use %pK through printk or tracepoints
  2025-04-14  8:26 ` [PATCH net-next 6/7] ice: Don't use %pK through printk or tracepoints Thomas Weißschuh
  2025-04-14  9:59   ` Przemek Kitszel
@ 2025-04-14 16:18   ` Loktionov, Aleksandr
  1 sibling, 0 replies; 22+ messages in thread
From: Loktionov, Aleksandr @ 2025-04-14 16:18 UTC (permalink / raw)
  To: Thomas Weißschuh, Jeff Johnson, Loic Poulain, Brian Norris,
	Francesco Dolcini, Nguyen, Anthony L, Kitszel, Przemyslaw,
	Andrew Lunn, David S. Miller, Dumazet, Eric, Jakub Kicinski,
	Paolo Abeni, Saeed Mahameed, Leon Romanovsky, Tariq Toukan
  Cc: ath10k@lists.infradead.org, linux-kernel@vger.kernel.org,
	ath11k@lists.infradead.org, ath12k@lists.infradead.org,
	wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Thomas Weißschuh
> Sent: Monday, April 14, 2025 10:26 AM
> To: Jeff Johnson <jjohnson@kernel.org>; Loic Poulain
> <loic.poulain@linaro.org>; Brian Norris <briannorris@chromium.org>;
> Francesco Dolcini <francesco@dolcini.it>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>;
> David S. Miller <davem@davemloft.net>; Dumazet, Eric
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Saeed Mahameed <saeedm@nvidia.com>; Leon
> Romanovsky <leon@kernel.org>; Tariq Toukan <tariqt@nvidia.com>
> Cc: ath10k@lists.infradead.org; linux-kernel@vger.kernel.org;
> ath11k@lists.infradead.org; ath12k@lists.infradead.org;
> wcn36xx@lists.infradead.org; linux-wireless@vger.kernel.org; intel-wired-
> lan@lists.osuosl.org; netdev@vger.kernel.org; linux-rdma@vger.kernel.org;
> Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> Subject: [Intel-wired-lan] [PATCH net-next 6/7] ice: 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 looks 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.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_main.c  |  2 +-
> drivers/net/ethernet/intel/ice/ice_trace.h | 10 +++++-----
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c
> b/drivers/net/ethernet/intel/ice/ice_main.c
> index
> d390157b59fe1873ddab78323cdc0bbaea6ad0c5..d27e8816a48fef5014148
> cae27e52c1801eaaada 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -9118,7 +9118,7 @@ static int ice_create_q_channels(struct ice_vsi *vsi)
>  		list_add_tail(&ch->list, &vsi->ch_list);
>  		vsi->tc_map_vsi[i] = ch->ch_vsi;
>  		dev_dbg(ice_pf_to_dev(pf),
> -			"successfully created channel: VSI %pK\n", ch-
> >ch_vsi);
> +			"successfully created channel: VSI %p\n", ch->ch_vsi);
>  	}
>  	return 0;
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_trace.h
> b/drivers/net/ethernet/intel/ice/ice_trace.h
> index
> 07aab6e130cd553fa1fcaa2feac9d14f0433239a..4f35ef8d6b299b4acd6c859
> 92c2c93b164a88372 100644
> --- a/drivers/net/ethernet/intel/ice/ice_trace.h
> +++ b/drivers/net/ethernet/intel/ice/ice_trace.h
> @@ -130,7 +130,7 @@ DECLARE_EVENT_CLASS(ice_tx_template,
>  				   __entry->buf = buf;
>  				   __assign_str(devname);),
> 
> -		    TP_printk("netdev: %s ring: %pK desc: %pK buf %pK",
> __get_str(devname),
> +		    TP_printk("netdev: %s ring: %p desc: %p buf %p",
> +__get_str(devname),
>  			      __entry->ring, __entry->desc, __entry->buf)  );
> 
> @@ -158,7 +158,7 @@ DECLARE_EVENT_CLASS(ice_rx_template,
>  				   __entry->desc = desc;
>  				   __assign_str(devname);),
> 
> -		    TP_printk("netdev: %s ring: %pK desc: %pK",
> __get_str(devname),
> +		    TP_printk("netdev: %s ring: %p desc: %p",
> __get_str(devname),
>  			      __entry->ring, __entry->desc)
>  );
>  DEFINE_EVENT(ice_rx_template, ice_clean_rx_irq, @@ -182,7 +182,7 @@
> DECLARE_EVENT_CLASS(ice_rx_indicate_template,
>  				   __entry->skb = skb;
>  				   __assign_str(devname);),
> 
> -		    TP_printk("netdev: %s ring: %pK desc: %pK skb %pK",
> __get_str(devname),
> +		    TP_printk("netdev: %s ring: %p desc: %p skb %p",
> +__get_str(devname),
>  			      __entry->ring, __entry->desc, __entry->skb)  );
> 
> @@ -205,7 +205,7 @@ DECLARE_EVENT_CLASS(ice_xmit_template,
>  				   __entry->skb = skb;
>  				   __assign_str(devname);),
> 
> -		    TP_printk("netdev: %s skb: %pK ring: %pK",
> __get_str(devname),
> +		    TP_printk("netdev: %s skb: %p ring: %p",
> __get_str(devname),
>  			      __entry->skb, __entry->ring)
>  );
> 
> @@ -228,7 +228,7 @@ DECLARE_EVENT_CLASS(ice_tx_tstamp_template,
>  		    TP_fast_assign(__entry->skb = skb;
>  				   __entry->idx = idx;),
> 
> -		    TP_printk("skb %pK idx %d",
> +		    TP_printk("skb %p idx %d",
>  			      __entry->skb, __entry->idx)
>  );
>  #define DEFINE_TX_TSTAMP_OP_EVENT(name) \
> 
> --
> 2.49.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 0/7] net: Don't use %pK through printk
  2025-04-14  8:26 [PATCH net-next 0/7] net: Don't use %pK through printk Thomas Weißschuh
                   ` (8 preceding siblings ...)
  2025-04-14 16:17 ` [Intel-wired-lan] " Loktionov, Aleksandr
@ 2025-04-14 18:44 ` Brian Norris
  2025-04-15  6:59   ` Thomas Weißschuh
  9 siblings, 1 reply; 22+ messages in thread
From: Brian Norris @ 2025-04-14 18:44 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Jeff Johnson, Loic Poulain, Francesco Dolcini, Tony Nguyen,
	Przemek Kitszel, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Saeed Mahameed, Leon Romanovsky,
	Tariq Toukan, ath10k, linux-kernel, ath11k, ath12k, wcn36xx,
	linux-wireless, intel-wired-lan, netdev, linux-rdma

On Mon, Apr 14, 2025 at 10:26:01AM +0200, Thomas Weißschuh wrote:
> Furthermore, restricted pointers ("%pK") were never meant to be used
> through printk().

Is this really true? Documentation/admin-guide/sysctl/kernel.rst still
has a section on kptr_restrict which talks about dmesg, CAP_SYSLOG, and
%pK, which sounds like it's intended. But I'm not highly familiar with
this space, so maybe I'm misreading something.

(I do see that commit a48849e2358e ("printk: clarify the documentation
for plain pointer printing") updated
Documentation/core-api/printk-formats.rst.)

In any case, even if the advice has changed, it seems (again, to an
outsider) a bit much to say it was "never" meant to be used through
printk().

Brian


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 4/7] wifi: wcn36xx: Don't use %pK through printk
  2025-04-14  8:26 ` [PATCH net-next 4/7] wifi: wcn36xx: " Thomas Weißschuh
@ 2025-04-14 19:04   ` Loic Poulain
  0 siblings, 0 replies; 22+ messages in thread
From: Loic Poulain @ 2025-04-14 19:04 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Jeff Johnson, Loic Poulain, Brian Norris, Francesco Dolcini,
	Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Saeed Mahameed,
	Leon Romanovsky, Tariq Toukan, ath10k, linux-kernel, ath11k,
	ath12k, wcn36xx, linux-wireless, intel-wired-lan, netdev,
	linux-rdma

On Mon, Apr 14, 2025 at 10:27 AM Thomas Weißschuh
<thomas.weissschuh@linutronix.de> 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 looks 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.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Acked-by:  Loic Poulain <loic.poulain@oss.qualcomm.com>

> ---
>  drivers/net/wireless/ath/wcn36xx/testmode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/testmode.c b/drivers/net/wireless/ath/wcn36xx/testmode.c
> index e5142c052985ddf629b93d7b9687e6ba63a48e8b..d7a2a483cbc486308032709a99bba9a52ed0ff59 100644
> --- a/drivers/net/wireless/ath/wcn36xx/testmode.c
> +++ b/drivers/net/wireless/ath/wcn36xx/testmode.c
> @@ -56,7 +56,7 @@ static int wcn36xx_tm_cmd_ptt(struct wcn36xx *wcn, struct ieee80211_vif *vif,
>         msg = buf;
>
>         wcn36xx_dbg(WCN36XX_DBG_TESTMODE,
> -                   "testmode cmd wmi msg_id 0x%04X msg_len %d buf %pK buf_len %d\n",
> +                   "testmode cmd wmi msg_id 0x%04X msg_len %d buf %p buf_len %d\n",
>                    msg->msg_id, msg->msg_body_length,
>                    buf, buf_len);
>
>
> --
> 2.49.0
>
>


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 0/7] net: Don't use %pK through printk
  2025-04-14 15:02 ` [PATCH net-next 0/7] net: Don't use %pK through printk Jeff Johnson
@ 2025-04-15  6:42   ` Thomas Weißschuh
  0 siblings, 0 replies; 22+ messages in thread
From: Thomas Weißschuh @ 2025-04-15  6:42 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: Jeff Johnson, Loic Poulain, Brian Norris, Francesco Dolcini,
	Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Saeed Mahameed,
	Leon Romanovsky, Tariq Toukan, ath10k, linux-kernel, ath11k,
	ath12k, wcn36xx, linux-wireless, intel-wired-lan, netdev,
	linux-rdma

On Mon, Apr 14, 2025 at 08:02:39AM -0700, Jeff Johnson wrote:
> On 4/14/2025 1:26 AM, Thomas Weißschuh wrote:
> >       wifi: ath10k: Don't use %pK through printk
> >       wifi: ath11k: Don't use %pK through printk
> >       wifi: ath12k: Don't use %pK through printk
> >       wifi: wcn36xx: Don't use %pK through printk
> 
> the first four should go through ath-next and not net-next
> 
> >       wifi: mwifiex: Don't use %pK through printk
> 
> this should go through wireless-next

Ack, thanks. I'll resend it there when the discussions here are done.


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 0/7] net: Don't use %pK through printk
  2025-04-14 18:44 ` Brian Norris
@ 2025-04-15  6:59   ` Thomas Weißschuh
  0 siblings, 0 replies; 22+ messages in thread
From: Thomas Weißschuh @ 2025-04-15  6:59 UTC (permalink / raw)
  To: Brian Norris
  Cc: Jeff Johnson, Loic Poulain, Francesco Dolcini, Tony Nguyen,
	Przemek Kitszel, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Saeed Mahameed, Leon Romanovsky,
	Tariq Toukan, ath10k, linux-kernel, ath11k, ath12k, wcn36xx,
	linux-wireless, intel-wired-lan, netdev, linux-rdma

On Mon, Apr 14, 2025 at 11:44:24AM -0700, Brian Norris wrote:
> On Mon, Apr 14, 2025 at 10:26:01AM +0200, Thomas Weißschuh wrote:
> > Furthermore, restricted pointers ("%pK") were never meant to be used
> > through printk().
> 
> Is this really true? Documentation/admin-guide/sysctl/kernel.rst still
> has a section on kptr_restrict which talks about dmesg, CAP_SYSLOG, and
> %pK, which sounds like it's intended. But I'm not highly familiar with
> this space, so maybe I'm misreading something.

The wording about dmesg, etc was added in
commit 312b4e226951 ("vsprintf: check real user/group id for %pK").

Its commit message also notes:

    This is a only temporary solution to the issue.  The correct solution is
    to do the permission check at open() time on files, and to replace %pK
    with a function which checks the open() time permission.  %pK uses in
    printk should be removed since no sane permission check can be done, and
    instead protected by using dmesg_restrict.

Doing this is my goal. One of the later steps is to replace %pK completely.
Probably with a function similar to kallsyms_show_value().

> (I do see that commit a48849e2358e ("printk: clarify the documentation
> for plain pointer printing") updated
> Documentation/core-api/printk-formats.rst.)
> 
> In any case, even if the advice has changed, it seems (again, to an
> outsider) a bit much to say it was "never" meant to be used through
> printk().

IMO "never" is correct. Using %pK through printk() was only ever a bandaid to
get at least some of the security benefits of hashed pointers.


Thomas


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2025-04-15  7:15 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-14  8:26 [PATCH net-next 0/7] net: Don't use %pK through printk Thomas Weißschuh
2025-04-14  8:26 ` [PATCH net-next 1/7] wifi: ath10k: " Thomas Weißschuh
2025-04-14 16:16   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-04-14  8:26 ` [PATCH net-next 2/7] wifi: ath11k: " Thomas Weißschuh
2025-04-14 16:17   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-04-14  8:26 ` [PATCH net-next 3/7] wifi: ath12k: " Thomas Weißschuh
2025-04-14 16:16   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-04-14  8:26 ` [PATCH net-next 4/7] wifi: wcn36xx: " Thomas Weißschuh
2025-04-14 19:04   ` Loic Poulain
2025-04-14  8:26 ` [PATCH net-next 5/7] wifi: mwifiex: " Thomas Weißschuh
2025-04-14 16:15   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-04-14  8:26 ` [PATCH net-next 6/7] ice: Don't use %pK through printk or tracepoints Thomas Weißschuh
2025-04-14  9:59   ` Przemek Kitszel
2025-04-14 16:18   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-04-14  8:26 ` [PATCH net-next 7/7] net/mlx5: Don't use %pK through tracepoints Thomas Weißschuh
2025-04-14 10:49   ` Tariq Toukan
2025-04-14 16:17   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-04-14 15:02 ` [PATCH net-next 0/7] net: Don't use %pK through printk Jeff Johnson
2025-04-15  6:42   ` Thomas Weißschuh
2025-04-14 16:17 ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-04-14 18:44 ` Brian Norris
2025-04-15  6:59   ` 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).