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 63A8352CCF0; Wed, 30 Sep 2026 18:39:37 +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=1790793578; cv=none; b=SFLsQZdUsJyzaF1u8HDGLe3Y677XNcNyBFmxUDW159bowrv8nFoo2D7muPZq+k12imbxjEUqXgwr+7Yej4LhbMPYMgY32J2gcJnPPSYhVKekwDUG69o5nde+p3EC1p+M2D/pWVDPz5iMWCBGugxn2lUk4nfMF0M6JDY44Dl9zhc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790793578; c=relaxed/simple; bh=qJwLM5AfS0OJm6Dw7dJPpMGMUvFQtUU+i8uVRHfl4jM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cv5qvWQAw9y7y+tYqHW2y/m8jhfq0I3bnL5C1Cr4jBrRfSid1O+WFC2ZCUEe3kwZZHPxj99xdH3+XCHrrsVx2aP5sryqxHMx6+CilCQyEcM+eorYwgLdS6XpOAwpHGS6U6vN6L2hLM9H21VAxjPIOlu2IU6/kY+P8ykYB2O1N7A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CLNW+TUi; 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="CLNW+TUi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDEE11F000FF; Wed, 30 Sep 2026 18:39:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790793577; bh=jTHnIEQYtmG9Lcm7IdrJmcDfFSQ035oaBPmjGf79NsU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CLNW+TUiW1FCtJRz6HWN2f8xu6X3LrHF4AwHMNEpVCPoVGNLGmyO8z6e+gO7OsCzM 6C6MCSuPzFWCrA5VBl7SSTwJkzlxn5AO+FgDa9rxVE6+yamXqUyquxPZxzIUqR5LbY 1ZHKxFaGqU/vnehIzdwZvLqM0mkHhBlf4Y8mEkIg= 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.18 303/395] s390/cio: Fix NULL pointer dereference in ccw_device_get_util_str() Date: Wed, 30 Sep 2026 17:29:25 +0200 Message-ID: <20260930152347.228993660@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152340.591469096@linuxfoundation.org> References: <20260930152340.591469096@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.18-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 @@ -517,6 +517,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)