From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F0E06C83F1A for ; Fri, 18 Jul 2025 13:23:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A7F3D40AD7; Fri, 18 Jul 2025 13:23:53 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id u6Z3vvAT_qES; Fri, 18 Jul 2025 13:23:53 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 1632E40B0A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1752845033; bh=IAwhNldOM1bvK5hnh10NqLPXigCuykAfwJ7ocfh53GA=; h=From:Date:References:In-Reply-To:To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=3xRukuARiUehoZD0AjI2ng16gW2yLxWTfVmpi2eweFxUu9U01ZvA+3UM/bT3Znmp8 Vgt5zA2RAcYpr/2kbgSqI+M/N8gtwyypQ+pkvCsakBFoAoaY23ctjer8ddYbHEap6d QK4sHDJ2289EpSSIlE4yJff/lqoz0t9Gh8gFtCGC/p5XpIqJU8yJh6zy7GFmtcJpyB 7iaXOhlEwlniMJk/3Xfi4h6z3Mgi1gGLUNzKosRfGAYJUp6ngHjuP6tzYEmp/2dEEC 3SB1Z9+u7jyu/4m9sG48izTFG4oAmYC8aQ6W0X6YT1NBC6LyJdkIw8q4hcqQFEx2As cYsphfSJtZMMg== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 1632E40B0A; Fri, 18 Jul 2025 13:23:53 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists1.osuosl.org (Postfix) with UTF8SMTP id 91929DA for ; Fri, 18 Jul 2025 13:23:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with UTF8SMTP id 8333284397 for ; Fri, 18 Jul 2025 13:23:51 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with UTF8SMTP id a7p79PyCRzq7 for ; Fri, 18 Jul 2025 13:23:51 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a0a:51c0:0:12e:550::1; helo=galois.linutronix.de; envelope-from=t-8ch@linutronix.de; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org C2F4C8438D DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org C2F4C8438D Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by smtp1.osuosl.org (Postfix) with UTF8SMTPS id C2F4C8438D for ; Fri, 18 Jul 2025 13:23:50 +0000 (UTC) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Fri, 18 Jul 2025 15:23:42 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20250718-restricted-pointers-net-v4-1-4baa64e40658@linutronix.de> References: <20250718-restricted-pointers-net-v4-0-4baa64e40658@linutronix.de> In-Reply-To: <20250718-restricted-pointers-net-v4-0-4baa64e40658@linutronix.de> To: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Saeed Mahameed , Leon Romanovsky , Tariq Toukan , Mark Bloch Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Aleksandr Loktionov , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Simon Horman X-Developer-Signature: v=1; a=ed25519-sha256; t=1752845027; l=3634; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=J4r5ps9WvNju5FTso8sqRG8ARuQDhy2vAqkZIvQH0II=; b=/djpugt6ObYd3ahyk9FKj2dg6XMy3D+TtNZRiJjFFVepc7D8kJ3G8YCpOyVK2IVLQ1qoPZyGP rzVgheMQdohCMc6wA+QVf/w+HlpQHlUBFTjNNkY8rLjKUtx9vHM/9wF X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752845028; 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=IAwhNldOM1bvK5hnh10NqLPXigCuykAfwJ7ocfh53GA=; b=y5ZlKfcbysZ0JkZuKyGUA35K6MDj0Sa/qm6gwWPCkGVBOdAj0jPhD6igbw4uX+Qg5fp6+Z E1JidEuTPzw/xfMU78CLNfmZVobTgtGgbcjnbEyBZ1kKuW3S4x1Wcl8l1+TQZUjZCo3fc8 EOBhCE3xPoUOhbSnGvSBBU3qXPf0eIiNe1ChRxHoKw15V4GQTw4maSEvQRBAQRCLfVQHDd EIimQZnMSi4mswwBYEGg7DlPTJTD9H0s3F/0kSEFzPqO07UNWrR7j6tnqWEWiIx1hAhvXH WYs1dDC2ibaVh/QIm9wsMnqHRkimJhqCmQH0vaDhNcnIt/K2Zs5PVy+MdsEZKw== X-Mailman-Original-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752845028; 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=IAwhNldOM1bvK5hnh10NqLPXigCuykAfwJ7ocfh53GA=; b=mrs9BQfY10hLqFVIa/TLU0WP76TY6UxJlI02b3raDUfcT1JecaUtSLJxvFhgl+AprN3vx7 rjmx8BkwJCM59VCQ== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=linutronix.de X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=y5ZlKfcb; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=mrs9BQfY Subject: [Intel-wired-lan] [PATCH net-next v4 1/2] ice: Don't use %pK through printk or tracepoints X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" In the past %pK was preferable to %p as it would not leak raw pointer values into the kernel log. Since commit ad67b74d2469 ("printk: hash addresses printed with %p") the regular %p has been improved to avoid this issue. Furthermore, restricted pointers ("%pK") were never meant to be used through printk(). They can still unintentionally leak raw pointers or acquire sleeping locks in atomic contexts. Switch to the regular pointer formatting which is safer and easier to reason about. There are still a few users of %pK left, but these use it through seq_file, for which its usage is safe. Signed-off-by: Thomas Weißschuh Acked-by: Przemek Kitszel Reviewed-by: Aleksandr Loktionov Reviewed-by: Simon Horman --- 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 af68869693edf6004e70caa4e952794439d800ab..76d67b39a0c1af02293ef2df06a6735b46c6679f 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -9153,7 +9153,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.50.1