From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84E9B606A320 for ; Tue, 1 Dec 2026 22:10:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=C7t8sAMd; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Pno0sBeg Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5ADBD81E8A; Tue, 1 Dec 2026 22:10:45 +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 ESMTP id ficrnLpwOc0t; Tue, 1 Dec 2026 22:10:44 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp1.osuosl.org 5F95681EB4 Authentication-Results: smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796163044; b=qQhGdoaGgXJI1IMunL5HKVBtLVGi4JEuIG90Y+UKPFNSF11IYbPfeDhppvLgY8tWKnEH iYQjfar9n20LUT7X1f3CimaLa65HrA40JKdyfkoOWttW2NSbi6bdeCFtIk/62xf07IZCk eTjwIrDTQPkH+4wxH0rP7NdPGrVMzwDjmTfrQ+xNf9CCvmHHFp7LuVnowszpdwKaDjQK2 xbGGidQoZm+zE/B/5OveqkpfkqQ13TvGYxgDMytSkfTIy5o4rDj4nBi/feIP0etfFMtHc 4umHCo+cnJaZsMx7jNLQDVt1ZwiyR0k8MPUhDZzCbNx3lxfDuuRTgTL3hjDdzbxPQUA== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796163044; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received: Received:DKIM-Signature:Message-ID:From:Subject:To:Cc:In-Reply-To: References:Content-Type:Content-Transfer-Encoding:Date:X-BeenThere: X-Mailman-Version:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Reply-To:Errors-To; bh=1q6+TkrtJ10tZEDCjQjYZZT/dAV5QSlTtKhUNX9NoAA=; b=r8TpuZrsxNL34ZCP05RBre52AkhQberQHthSIJLsyW2CdLD8aEB/oUD3MARpAx9Z6NWv ya918Jr4UaYe08s0IBba/DxVzduNXCMd4OR6yqH/0bgagEr5gcpBGTy73BAGl20RaqWI6 O9f8RtEXHhObXq3ufRxHwjTMo7bmppNMCk2UU+2SMkODOcxapkTgBbtWsP7rnr8ow0jMD jrSZgSY7dufWkIAvZWRuIseX+9vP5vmrMFpjoxuVP3OQmeihEkBpaP0FD/v8RgK/pvzUa GqJpHtHwO7aDsgIFrXLF6xSgJLLzO7pla3vHWuJZLWQbglXhFIoulehC1YAuFKkr9iQ== ARC-Authentication-Results: i=1; smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 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-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1796163044; bh=1q6+TkrtJ10tZEDCjQjYZZT/dAV5QSlTtKhUNX9NoAA=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Reply-To:From; b=C7t8sAMd6NG73ZPSc+JKSw6xH/z5tQfsOSZCY6VNjPfGppYlsyGpfSlwrKDOBOOLl kHGyx2C7MM5eQY+hhQf9+SSDP9bA78evY/G3gnS8PIQSqQxLaYnY0yluOLarbvtPEK 19tJ0RkKuCaC6PAVDeOMeflonZxYv4+QH6sfP6GelPQs536KpLxU8df6lyzHFyv7q6 HBce0oThk0ugOVKObNelUe2ucdZY5Ylq0wlZ1bluBQg75R88DMzzOk+FqdYVs3wIXP /yhGLPgooZk7+DNJwkFv9lBnljjBeYpi2SKqi6SBNZb5dre4NGhPs3T4dV1lT8D4rH uKXaGYOjf4Rqw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 5F95681EB4; Tue, 1 Dec 2026 22:10:44 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists1.osuosl.org (Postfix) with ESMTP id A78932E4 for ; Tue, 1 Dec 2026 22:10:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 8D2ED4018D for ; Tue, 1 Dec 2026 22:10:42 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id k4jNnxBV1Rz5 for ; Tue, 1 Dec 2026 22:10:41 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp2.osuosl.org 8B7724008A Authentication-Results: smtp2.osuosl.org; arc=none smtp.remote-ip="2600:3c0a:e001:78e:0:1991:8:25" Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=sashiko-bot@kernel.org; receiver= Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Pno0sBeg Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by smtp2.osuosl.org (Postfix) with ESMTPS id 8B7724008A for ; Tue, 1 Dec 2026 22:10:40 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 201A040A7C; Tue, 1 Dec 2026 22:10:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAEDC1F00897; Tue, 1 Dec 2026 22:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796163040; bh=1q6+TkrtJ10tZEDCjQjYZZT/dAV5QSlTtKhUNX9NoAA=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Pno0sBegVIZOJYe3M9fkw3gCBjQRyhoD4+eNag5E7h9XDutkvrw03mDQ1/Z1uURa4 9OP54w5GPAvfSmmcZX7EN6W9U+zGiBZ32e5CqvGFSJdNLGetITO4dk71PrSBHxpEw4 6kr6mmK4T0pyhQiwtOaq5PpTyITP3/lJS2yLdREHe7zMQyP1i1e69Vaa+XuzKZ+mox w98TwxdfTujzEOKxexI8L5Ldvan5x69KhUYf7866337TRnuY+MxUP0f7OEhRQtmNhd W0kKTvjuwWXsEpgIletFv87v53X694OOU4Mpq0tNTG3Kx0+3TJEYtdtKFtWY+G8/Q4 0onh24HTMGJuw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net-next 3/3] ice: support the enable_rdma devlink param in runtime cmode To: "Stefan Metzmacher" Cc: intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org In-Reply-To: <04b80a45d0b1544b0b32e9ee72223f09005fa51c.1796076486.git.metze@samba.org> References: <04b80a45d0b1544b0b32e9ee72223f09005fa51c.1796076486.git.metze@samba.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 22:10:39 +0000 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-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] ice: race between ice_devlink_enable_rdma_set() and concurrent plug or reset It also noticed 1 related pre-existing issue this patch does not introduce: - [High] ice: NULL pointer dereference in ice_devlink_enable_iw_validate() [1] -- commit 5131a328af0137c04875bae323e3ebe30dcdfd51 Author: Stefan Metzmacher ice: support the enable_rdma devlink param in runtime cmode This commit adds runtime configuration mode support for the enable_rdma devlink parameter so the RDMA auxiliary device can be plugged or unplugged without reloading the PF netdev. > diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/n= et/ethernet/intel/ice/devlink/devlink.c > index 5a69f0f8a7bc4..8d816631df69f 100644 > --- a/drivers/net/ethernet/intel/ice/devlink/devlink.c > +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c [ ... ] > @@ -1626,6 +1629,62 @@ ice_devlink_msix_min_pf_validate(struct devlink *d= evlink, u32 id, [ ... ] > +static int ice_devlink_enable_rdma_set(struct devlink *devlink, u32 id, > + struct devlink_param_gset_ctx *ctx, > + struct netlink_ext_ack *extack) > +{ > + struct ice_pf *pf =3D devlink_priv(devlink); > + bool disable =3D !ctx->val.vbool; > + int ret; > + > + if (!disable && !ice_is_rdma_ena(pf)) { > + NL_SET_ERR_MSG_MOD(extack, > + "RDMA is disabled in driverinit cmode, enable it there and reload= "); > + return -EOPNOTSUPP; > + } > + > + if (test_bit(ICE_FLAG_RDMA_RUNTIME_DIS, pf->flags) =3D=3D disable) > + return 0; > + > + if (disable) { > + set_bit(ICE_FLAG_RDMA_RUNTIME_DIS, pf->flags); > + ice_unplug_aux_dev(pf); > + return 0; > + } > + > + if (!pf->cdev_info || !pf->cdev_info->rdma_protocol) { > + NL_SET_ERR_MSG_MOD(extack, > + "Neither enable_roce nor enable_iwarp is set"); > + return -EOPNOTSUPP; > + } > + > + clear_bit(ICE_FLAG_RDMA_RUNTIME_DIS, pf->flags); > + ret =3D ice_plug_aux_dev(pf); > + if (ret) > + set_bit(ICE_FLAG_RDMA_RUNTIME_DIS, pf->flags); > + > + return ret; > +} [Severity: Medium] Can ice_devlink_enable_rdma_set() race with ice_plug_aux_dev() or a PF reset running on pf->serv_task? ice_devlink_enable_rdma_set() runs under devl_lock(devlink), while ice_service_task() and PF reset/rebuild call ice_plug_aux_dev() and ice_unplug_aux_dev() without holding devl_lock(devlink), and pf->adev_mutex only covers the cdev->adev assignment: CPU0 CPU1 (pf->serv_task) ice_plug_aux_dev() test_bit(ICE_FLAG_RDMA_RUNTIME_D= IS, ...) -> 0 ... ice_devlink_enable_rdma_set() set_bit(ICE_FLAG_RDMA_RUNTIME_DIS, ...) ice_unplug_aux_dev() test_and_clear_bit( ICE_FLAG_AUX_DEV_CREATED, ...) -> 0 (returns early) auxiliary_device_add(adev) set_bit(ICE_FLAG_AUX_DEV_CREATED, ...) <-- aux dev stays plugged The auxiliary device remains registered while ICE_FLAG_RDMA_RUNTIME_DIS is set and ice_devlink_enable_rdma_get() reports false. In addition, if ice_devlink_enable_rdma_set() enables RDMA while a PF reset is in progress between ice_prepare_for_reset() and ice_rebuild(), it plugs the auxiliary device mid-reset and ice_rebuild() -> ice_rdma_finalize_setup() then calls ice_plug_aux_dev() a second time. > @@ -1654,8 +1713,11 @@ static const struct devlink_param ice_dvl_rdma_par= ams[] =3D { > ice_devlink_enable_iw_get, > ice_devlink_enable_iw_set, > ice_devlink_enable_iw_validate), > - DEVLINK_PARAM_GENERIC(ENABLE_RDMA, BIT(DEVLINK_PARAM_CMODE_DRIVERINIT), > - NULL, NULL, ice_devlink_enable_rdma_validate), > + DEVLINK_PARAM_GENERIC(ENABLE_RDMA, BIT(DEVLINK_PARAM_CMODE_DRIVERINIT) | > + BIT(DEVLINK_PARAM_CMODE_RUNTIME), > + ice_devlink_enable_rdma_get, > + ice_devlink_enable_rdma_set, > + ice_devlink_enable_rdma_validate), > }; [Severity: High] This problem wasn't introduced by this patch, but can ice_devlink_enable_iw_validate() [1] trigger a NULL pointer dereference on pf->cdev_info when enable_rdma is false in driverinit cmode? When enable_rdma is disabled in driverinit cmode and the PF is reloaded, ice_deinit_rdma() frees and clears pf->cdev_info, ice_set_pf_caps() still sets ICE_FLAG_RDMA_ENA, and ice_init_rdma() returns early because ice_is_rdma_ena() is false. Unlike ice_devlink_enable_rdma_set() and ice_devlink_enable_roce_validate(), ice_devlink_enable_iw_validate() only checks ICE_FLAG_RDMA_ENA before dereferencing pf->cdev_info: drivers/net/ethernet/intel/ice/devlink/devlink.c:ice_devlink_enable_iw_vali= date() { struct ice_pf *pf =3D devlink_priv(devlink); if (!test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) return -EOPNOTSUPP; if (pf->cdev_info->rdma_protocol & IIDC_RDMA_PROTOCOL_ROCEV2) { ... } Setting enable_iwarp in that state dereferences a NULL pf->cdev_info. [1] https://sashiko.dev/#/bug/linux-aab1240e-86ed-43b4-be4c-d5891c480f23 --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796076486.gi= t.metze@samba.org?part=3D3