From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 9F1B3515961; Wed, 30 Sep 2026 16:45:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790786746; cv=none; b=SXhg2ICExGYlCqmM3+9kQGvzq3/d2UM1vQ7l6SB0RUrQ9+N16BbBkE4r5TEwWr1ySsju/H9vtZZLyKxSU1X33QT8CsbAds1dtQf0BO5wmdIUZQdfhoZH9mObR0saBqHMkzzNH+VCyqjggHMQIpbNbDsBwPYiX++XZhZWi+VRuJA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790786746; c=relaxed/simple; bh=vMzsPa6WiNHcywuJYyM3iXVikvnxPuDCx0ns8xrX9tc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DQ8gQcpHAzLuGQazKUW2wCDtnRbsi0ZYjPAluZEG3Pn2G+NE1zNwM9/PYQ15P4SnZmMqQVUrmTzIg2IU4xSAOa/GuLetVa0uRWXqR6arcT2W1E8zy4A4nTo5PkA93kzK9UUGH+RbHJbP3Ec0gzuztXQ6k7FzlV70lMEa4Lv4Tgc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=x+rX5+Dy; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="x+rX5+Dy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7A8D1F000FF; Wed, 30 Sep 2026 16:45:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790786744; bh=IWceYZ1d+gdoegJg7VZ28rBExYaGNZy4pe9naQ4aJVE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=x+rX5+DyR8LfZ4jZsB02Ptpc6IvdPNThXYA59rWK4/lLBRka3OxjBr1p+/ywz4anN 0nueDhKh2OI07ixe01DiG9Qg5NG4OrnVpdmx8/6SX/MR2p19FNVUrJwxH6bjpXn8KG Lyep812rC63me18ISlJGJY+p1odhPejHpb+TM6H8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vineeth Vijayan , Peter Oberparleiter , Heiko Carstens Subject: [PATCH 6.1 968/982] s390/cio: Fix NULL pointer dereference in ccw_device_get_util_str() Date: Wed, 30 Sep 2026 17:28:24 +0200 Message-ID: <20260930152437.534805453@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152416.775402466@linuxfoundation.org> References: <20260930152416.775402466@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vineeth Vijayan commit 5b76268dac968612f7283d59b539036de955b7d9 upstream. The channel path registry entry associated with a CHPID may be removed while the subchannel's PMCW still references that CHPID. In this case, chpid_to_chp() can return NULL, leading to a NULL pointer dereference. Add the missing NULL check before dereferencing the returned pointer. Fixes: 199652309a4d ("s390/cio: add helper to query utility strings per given ccw device") Cc: stable@vger.kernel.org Signed-off-by: Vineeth Vijayan Reviewed-by: Peter Oberparleiter Signed-off-by: Heiko Carstens Signed-off-by: Greg Kroah-Hartman --- drivers/s390/cio/device_ops.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/s390/cio/device_ops.c +++ b/drivers/s390/cio/device_ops.c @@ -509,6 +509,8 @@ u8 *ccw_device_get_util_str(struct ccw_d chp_id_init(&chpid); chpid.id = sch->schib.pmcw.chpid[chp_idx]; chp = chpid_to_chp(chpid); + if (!chp) + return NULL; util_str = kmalloc(sizeof(chp->desc_fmt3.util_str), GFP_KERNEL); if (!util_str)