From patchwork Thu Apr 17 13:19:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 882864 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C4CD78F29; Thu, 17 Apr 2025 13:20:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744896032; cv=none; b=u7iwanA15ehoTNPbPB8Z0vlQ5Ub9A4b8yaF12TR8g37+eqWIohfShWnm1EKV/GoSEqckbC7zT0+SbneX1xDMRHNhWatDW7UzJvq+p4R/wwNRc9qTlydOL+v5lmSD85tM6lxtaQcWEDcZP3J/07Ze9I5YjS3Agh/aUMdujck3hvU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744896032; c=relaxed/simple; bh=X5Y35mvwqshumnbWy5zJTMWXjcz2vOyLWTqdehB/Nrs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FywrBTOWrQgLlG7L293RL8l6vb/g6jjrcRl3WQEe+YibBfrwDaeskbQ+N9r0dsEroNJs12amAhgRFmktTIoh2hXlD58xEbZAKtTiAxyPTd0icAIkQfwaZ4pwWTzfoCglGf3GQXS+4dyUqFcDNw3P98xf504WqTo7QGlt8yjqSrI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=15to/CiA; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=zcyOTsKb; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="15to/CiA"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zcyOTsKb" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1744896029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kJJ7JoeqPD8SV51uCgbiKuG2ADyhnksMTo06xAM1E7E=; b=15to/CiAcPRTDPtiTb1KIgtbB6l/+0HxEK4ZoVrWGAEZXRU3Q+fw4/S/kqhTl0RFClo5GE GCHBe7rJg0npIOR7px/FBwS2Ae+iqiaG7KXbHuZyIE0s7gF2y2tru0qPeOFQgEl0VZAVVE C7fm6LE81SD0YzHteerbH2qtEcSzzhb4xTSKdufm2/pt7kvVaAyX/jV5dwFCJDl/LbGYzs oaTrt2DNh9Up+S+U2PeW1qqkmJgDzC8IqQXWSANodHb1YzoHwKt+hjvTTZMKg6W/Sc62dj yEBstVJJECcqbpauSNLg6Mh90GI6sszQYRhrye+nAsoyQwa0ahdc1QopJumrhw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1744896029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kJJ7JoeqPD8SV51uCgbiKuG2ADyhnksMTo06xAM1E7E=; b=zcyOTsKbebJX0FHRfWeXm9vjjGLKwgpV9CEOYOlGTlhDi2CRBSzsWsLUMKw1RCz9F77Zlv rdPZCpII8fOTHaCg== Date: Thu, 17 Apr 2025 15:19:07 +0200 Subject: [PATCH ath-next 1/4] wifi: ath10k: Don't use %pK through printk Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250417-restricted-pointers-ath-v1-1-4e9a04dbe362@linutronix.de> References: <20250417-restricted-pointers-ath-v1-0-4e9a04dbe362@linutronix.de> In-Reply-To: <20250417-restricted-pointers-ath-v1-0-4e9a04dbe362@linutronix.de> To: Jeff Johnson , Loic Poulain , ath10k@lists.infradead.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org, wcn36xx@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, Aleksandr Loktionov , =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1744896028; l=16621; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=X5Y35mvwqshumnbWy5zJTMWXjcz2vOyLWTqdehB/Nrs=; b=S5l9ey03nN6YcVEvkqaCou2vaFy0xqNakuFhJlm7F0Op0EvsK5m8lYss8ZMIn5F2K/ygw3Cef F1PrsnxnhxfBpTfab6GhEL76kFdKbG/7d4NXF9lw2jyT5A2GI9d8jr/ X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= 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 Reviewed-by: Aleksandr Loktionov --- 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); From patchwork Thu Apr 17 13:19:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 882278 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAA7823FC55; Thu, 17 Apr 2025 13:20:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744896033; cv=none; b=awrjG2r/OngGkOYx3ViK4eMgVfP869d/KkcCk7qtUmnk7wAjTkgZy5l8Wv4M+zIidoMZ4Bp6jgubb4eXal//f8J8PN2RupeJtCA7qpR+ub8QTsHXgK47s14K6JvZdoFTcIy8vYbQO1cl65aCmJ43K2JVDyaULxHcKvujlzvRAM4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744896033; c=relaxed/simple; bh=StrFXkjU61OZ/Br21albUB1TSXKwVdbD6fzzr0lF8cg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YB+TU2O2FTslAYOM4hi44FezkcanaIcubMHZrnKjD/NeR0k8sTJoAmDmGx3LIX2bxkbjctw7pokstJCUMp9lEmal7hWmJMiegU1Ez4PphxQyWnCuWsvU9MZJu0iiwYXFuhcPaloRNwrWhZwHW2mg9JRnyqasT7BF5xJ1Ndk1tqg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=yuZ3hdlS; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=DJ9y5yUd; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="yuZ3hdlS"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="DJ9y5yUd" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1744896029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M1GeXntpnPWyXUESrbciRq82BQz1QlJ7YZ0gk/CUbVc=; b=yuZ3hdlS0nUrlUULOiIVbfJkKVbyppqvbHlS2FV4PHE0yPJR7/k9NSZX7NTQosz3hCIxnI 80m0fcciH2e8yPHCegiCEWDbu4M0DCNHPj1NKb7YFrGysEz2yIq7xihzImhzVL6plVFJB2 ADcSIASXby4bV0PP8c8FGM7O//J8rfv8WNurYJ6TG+Y42N8JZjtQFFqsr3M9OFdhnPPrx+ oqXdE4WxuEdkmzFhz2lIHhaPXqTqWJhP++jqkQu9trCPVcsWbc5lG4N4GIFpxc9Kd235nV DpUFGdZrJHEtt1ab68b6AO+cqf8UrOI1gL8Djk9Zdj3ha67kHDpp0Yc/yuUIKQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1744896029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M1GeXntpnPWyXUESrbciRq82BQz1QlJ7YZ0gk/CUbVc=; b=DJ9y5yUdNyJvZAr2C+gTNyK6ZzcIz6wYME/IU6h3n1ld9N+CixdHwFfw0mZCow+IKHwlnQ NIAIjsnaIIi1ZXBw== Date: Thu, 17 Apr 2025 15:19:08 +0200 Subject: [PATCH ath-next 2/4] wifi: ath11k: Don't use %pK through printk Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250417-restricted-pointers-ath-v1-2-4e9a04dbe362@linutronix.de> References: <20250417-restricted-pointers-ath-v1-0-4e9a04dbe362@linutronix.de> In-Reply-To: <20250417-restricted-pointers-ath-v1-0-4e9a04dbe362@linutronix.de> To: Jeff Johnson , Loic Poulain , ath10k@lists.infradead.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org, wcn36xx@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, Aleksandr Loktionov , =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1744896028; l=1593; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=StrFXkjU61OZ/Br21albUB1TSXKwVdbD6fzzr0lF8cg=; b=qNfUCGEcsX+Nn3t6KcR00t00ASyLvVOQ9TKgoODq6Fiscv21IPuHnZP3h1CZZ+fhT6EfqPdXD zojyXNUtyhTBdeQzn4UWhWmDHqDB0JcpZvueCEpIxa0eDWTZKPlTF2u X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= 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 Reviewed-by: Aleksandr Loktionov --- 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); From patchwork Thu Apr 17 13:19:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 882863 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD2BB241122; Thu, 17 Apr 2025 13:20:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744896033; cv=none; b=KA0Zpu9fjDkC+hgGhgEmfnFF2kYLLNwPiva1B96k5SD2/F+HhEdVdaqki3cxGELJWntWopYCajoK77CuH5Vqgl8OT5dLai17TwgLRmrhTp8RUml5XsivBO2MlXLCHv6MYPMuw66/X+oipH4+sQgkITWjYCD8xowpC4W/8pMrrWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744896033; c=relaxed/simple; bh=TTY0OdEts5CMGR4SkSsgwcX6nSC4Z23DkwaOHjZ9iIM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MLYw1cCgIGLk1UtAnRUw7H0OqRjqbJ5qxzmKHFwthfLxUdAzyEmiY2MPwtBVPSCAZAo8Fh1npijn+1Umw4Xs+GrmyQ16o8npgoKmEMgYH5AnLCaGT7rKda72F8Fnvqg0cP0csljD2xiBpM2P8WCBxvl5WEdFA719UAtpjAmO+N8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=YW4dexUM; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=XWjWBKcp; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YW4dexUM"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="XWjWBKcp" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1744896030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qpuwoWN6mbA9oZ2QFKD0MvRa4oPxeEBdptFek4pK4S8=; b=YW4dexUMujxhI9RsX4x7e2elK1th4IpqxAipylBDIV8u2vFkCMVaIfxqtpk8zJw4WPsavJ ziKnj1Sbwm3E1hTnPoKpj6QKTdUltTha+HxCoX3crpuzS9JR7W7Qctl6JCQcu/iAPFVaXO eoOYsLpRVZ2hHJKzoyVj1lEiibuynlJWF2AtBMMjSiC4e5uEPGbnyHn+Kte2ItStvnQm/2 9wWY9buEPv0qsuiPXKPy7+MaFBx/z/QuSHjRUAz+gpVt5so8GU8DNun3Jzool9P82lww/R FCfRLs0Hqj1Ai9bt8qMiWkVn1zC9TzBh/k7d5O3VIfQu3Y0mrp7Gt2RGP/uD+w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1744896030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qpuwoWN6mbA9oZ2QFKD0MvRa4oPxeEBdptFek4pK4S8=; b=XWjWBKcpMSPa61yH7fgPD2/6e0pH02J06KeHixSvn25XVLO2gDia2o71gDihTb2qbHsnug pKfiNxqb8/2EUwBA== Date: Thu, 17 Apr 2025 15:19:09 +0200 Subject: [PATCH ath-next 3/4] wifi: ath12k: Don't use %pK through printk Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250417-restricted-pointers-ath-v1-3-4e9a04dbe362@linutronix.de> References: <20250417-restricted-pointers-ath-v1-0-4e9a04dbe362@linutronix.de> In-Reply-To: <20250417-restricted-pointers-ath-v1-0-4e9a04dbe362@linutronix.de> To: Jeff Johnson , Loic Poulain , ath10k@lists.infradead.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org, wcn36xx@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, Aleksandr Loktionov , =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1744896028; l=2078; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=TTY0OdEts5CMGR4SkSsgwcX6nSC4Z23DkwaOHjZ9iIM=; b=6r1KIK7Old+1LXqWuk2M0JkIPIqBlAOJFQOpKm+FhYnzMqaj1nT3xp1900DFyDmWDfN8V3Ldn RvGlN9nendpBnJSC4wnuynbmYXclbpbLGsH4bQB3ZUZqyPxMHr1BgZn X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= 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 Reviewed-by: Aleksandr Loktionov --- 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; From patchwork Thu Apr 17 13:19:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 882277 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 362F624500E; Thu, 17 Apr 2025 13:20:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744896033; cv=none; b=WSb5Et+z3BhWyt23MYt0bdhI6ttk/sgPpXG3lMIOl/6AGIhWbmY7WR2bKL0u+Zt97eNASrpmlOYVEHKw1P8I3Ld38mgjR63kOB0c+PEBj95+ftGpDuauwLgzBCejWicygyVKDGUIsOe9BpTOT9cVa5wGqKT1VmsCkP55XR+ixEU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744896033; c=relaxed/simple; bh=OPNAC8Z0G8ITTpc1DdLDRC3Y4E82qIDfQhRitc5zvvE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UPzrcV8yQxMkzpq+C8eBuqrgnNDrHmgcXxsenytED5s7fH9rOLODeibwitJUJFFiPtNyMdIPwNlYv2kGIE/3XPju/WDvCxDj3yScd9Ejj35se2JzwyVh5BnQld/8U8lgXPZ2WEVAZu5tV735DtuM9JOb9XxOSlC7gLNoEO6YJ/8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=TNMKyZYk; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qmZ5eJ2J; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="TNMKyZYk"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qmZ5eJ2J" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1744896030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wl2sntL2foeXMHL68yZgS6j+JHjIlWFLQNY02bMKsA0=; b=TNMKyZYkQFCGx2hlGy222xN+FSM05lqYzc9pkB40Pkfm4GK62M6Pw+SyfP5vbk5GiGUH0Z QfyCYye3jK5B6KULY93cm/HodU8W2ttU0DpwNQIIQLEX7P8mo9o6/dLtlf+f3bRozAm9yE KRsyDn649Yds6WaoxiLfb8/N0RAhqooUkSq1L1XEUypxXDi+f8qCY/aI9hkl+f09KwqRgv Oh5oC2IBwb7oHqGyGvuhrSXLWdqxCEwt6425X3Al8gOJwuXC+DwDjL8hpFk2seSnYF8wp2 CSFqc2pbJafDIno01pJJCH8DUCg0SdZhG+k3C/fHx8uPRpAB7gHorUdIJpNdFA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1744896030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wl2sntL2foeXMHL68yZgS6j+JHjIlWFLQNY02bMKsA0=; b=qmZ5eJ2JxK+q0AnKD+06vInxzCTLBW0rJFJbzJHcfKRjvWEPBo9Ljeo8tW5yud7+SCR3Mb 73wS1UuLpExbkpAA== Date: Thu, 17 Apr 2025 15:19:10 +0200 Subject: [PATCH ath-next 4/4] wifi: wcn36xx: Don't use %pK through printk Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250417-restricted-pointers-ath-v1-4-4e9a04dbe362@linutronix.de> References: <20250417-restricted-pointers-ath-v1-0-4e9a04dbe362@linutronix.de> In-Reply-To: <20250417-restricted-pointers-ath-v1-0-4e9a04dbe362@linutronix.de> To: Jeff Johnson , Loic Poulain , ath10k@lists.infradead.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org, wcn36xx@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, Aleksandr Loktionov , =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1744896028; l=1588; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=OPNAC8Z0G8ITTpc1DdLDRC3Y4E82qIDfQhRitc5zvvE=; b=T9JbjQdhxZNU/5ra4J11M4K9RgxRQecAuFkyV/yXCB395zBURy5tiBfy5Y2S/5H8Fwnlxqbzh N3oXHE6uPafAuOx65sdfN4UN5MCYPBHgzjjQ0yXzQcuzxd341OlPjft X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= 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 Acked-by: Loic Poulain Reviewed-by: Aleksandr Loktionov --- 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);