From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795907493; b=icPHfY9baH1eRAQIthmyIVEMwJZ7KLco0hcFujYLVjh6ZBLaC6UCxbMN7KwdbCfp4jej spobpWqcYmJzYVhDsW4nXhoUr7wHe2OhEPx12qTbeC5lwXzH0g79zzUZZ0dKDayACRbhM E3IBF2zQlohrPlp39RxGXD4m0YUhEiBetYrPblyBYgtvr4P8HAEwZajeu+N6eKfEi7n8e g2pYPVmfak58PxcOA9n/Kj/xOtFxu70LSBSP3IHfofcJXVPSl1dSG8kMjE3kK+hloa+oH 5aeIzaw+0cyAce+AOe/OHCyvQFusTJ6Ep4dieJ9T7Xkhmpbr9WpmSadhGp1DX0+lygw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795907493; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=vfkrKqw2T/PCKgC6hPrX5YzxUzYVmiE25navC470BAI=; b=DqLjwCYFtfTFgHrJGBXa2hT4iFkDP236FOPuLAevs9qPyVoW/u0VYCFWDAefI30ZzWbM B2lMkVIuKi2CcK20MLGU41Ijb6Y38JyJR20/G3l0sK67X5vKbK4uDi64uDrTVhksb7rmx RSrMtiPMIKIHrLPESLmtd4dc0C8xb+T5W2jtCcbAwQyp90OBo90e9CuMbBF29gwUm6h4K y3xr5v1ximGRS033jqfc7gIYI8pbXtbCXCigFvTERgOV6D2R7sD5ce1SiNQ2F2BrdtCyE O6NPSn+MX/UAr7tHgLlQzqF504nkZ5LuGoTdas22FE6NlDYs/NLSx6vxANIUbrscLoA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=BQRAhde2; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52AE4606A31C for ; Sat, 28 Nov 2026 23:11:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=BQRAhde2 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3D231F000C1; Sat, 28 Nov 2026 23:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795907492; bh=vfkrKqw2T/PCKgC6hPrX5YzxUzYVmiE25navC470BAI=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=BQRAhde2uTQtWFTx4bylASzNNCO82fdWUHH8lBlfU+tqFqCswWOBGQEHATVCrWf4n ZCLNXGmaA9dW3SGIMyzm+4Z2xC3IdzSYv3ZU7WQFC4IIyJgk0JqAWqgzKwXXhg4o4q wsehqeThSVWu7wfG09u/uSECXQvve3uPVLlIvtdCfVWctOlYX+9AYE4HbMZEWPAzS2 n5DLZu6KebbEKKgGy4ThMhx5p7/hubiTCUTmKH2g9c5urJNylTa4GOyrkfgWBcPBdc LEY729ZPvBX4u8sIy2Z2WnQRDc8cLWUrxfNuQPkcZigc7b4xYrS93P9EILZ6Xq5UQh Fgq9Wa08F9Ycw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] scsi: be2iscsi: fix NULL pointer dereference in beiscsi_alloc_mem() error path Reply-To: sashiko-reviews@lists.linux.dev To: "TAKANO Mitsuhiro" Cc: linux-scsi@vger.kernel.org In-Reply-To: <20261128-b4-scsi-be2iscsi-null-mem-array-v1-1-82c66b29ab81@gmail.com> References: <20261128-b4-scsi-be2iscsi-null-mem-array-v1-1-82c66b29ab81@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 28 Nov 2026 23:11:32 +0000 X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] scsi: be2iscsi: missing Fixes trailer for beiscsi_alloc_mem() error path fix -- commit f497efcc4ca2b2970e263b27d42a6e4480250ecf Author: TAKANO Mitsuhiro > scsi: be2iscsi: fix NULL pointer dereference in beiscsi_alloc_mem() error= path > > In beiscsi_alloc_mem(), both jumps to free_mem occur while the current > mem_descr->mem_array is still NULL and the j DMA fragments allocated for > the current descriptor are stored in mem_arr_orig[0..j-1]. The error path > dereferences mem_descr->mem_array[j - 1] directly, causing a NULL pointer > dereference whenever j > 0, and also skips freeing init_mem[0].mem_array > when unwinding earlier descriptors. > > Free the j fragments from mem_arr_orig first, then unwind and free all > previously completed descriptors from i - 1 down to 0. > > Signed-off-by: TAKANO Mitsuhiro [Severity: Low] This fixes a NULL pointer dereference and memory leak in beiscsi_alloc_mem() that have been present since the driver was added. Should this include: Fixes: 6733b39a1301 ("[SCSI] be2iscsi: add 10Gbps iSCSI - BladeEngine 2 d= river") --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261128-b4-scsi-be= 2iscsi-null-mem-array-v1-1-82c66b29ab81@gmail.com?part=3D1