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 92DA83876D5; Thu, 30 Jul 2026 16:09:29 +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=1785427770; cv=none; b=aAwKm0dTjovU9olONO1NzoEKMWY4AOd/1Szw7lHDjceauQe3oh4XE3FZVxltZPFLb7FxIEacjUnkXrXhZjxQfFl5bbBFTdAINQARIrgGF7AhkBoqfi50lZUy48XRk3EABfLg7tp8tu87+N4X3G2WBdXW6C83JBYVYhLt3Zt+QrI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785427770; c=relaxed/simple; bh=9nelUImQuNilb5nnqs6Ej3DLjuh41tbAeNSLM83hDjM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IPUFovi6Uc6e5F2Ueeg1py6gJR4V2SsQRVPtXB97QTToaMIVdYhgYou3xNZfeN3pcDiBwDoKklr6bitglyji++YpLDUDHXmylMR7rdKvoYD6Jr28ZucvCJKNcPHIGJiZ4DUq/JnE9AzLSPppRUqiSZbJrsDvyEgYPWaaUCLV59Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jvd78vs0; 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="jvd78vs0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EED3B1F000E9; Thu, 30 Jul 2026 16:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785427769; bh=i3XIJMiqiSZoFDK8pg2UplSl7hvWaozFM3Jr078wMg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jvd78vs01DJrsNSc20sPucbgiQKrGmICbcFT79rT4yLo4V7OrZ+a6pcajrHjE4mu6 Hqdw889BBLnvWm073wPA/DS+XQCcfBsFZMJYRjAkQUrbx23fCqoASkSyq4iN3Pa1UA e4uuguE0KZOM5Ls+WfzRT0GQOMsTcke+fLfVTRbU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Andy Shevchenko , Jiangshan Yi Subject: [PATCH 6.6 288/484] serial: 8250_mid: Fix NULL function pointer dereference on DNV/ICX-D/SNR platforms Date: Thu, 30 Jul 2026 16:13:05 +0200 Message-ID: <20260730141429.753775943@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141423.392222816@linuxfoundation.org> References: <20260730141423.392222816@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiangshan Yi commit 7fb13fd7e9a59a37cd911efff83abe19e3ee029d upstream. Commit b1b4efea05a5 ("serial: 8250_mid: Disable DMA for selected platforms") replaced the dnv_board setup and exit callbacks with PTR_IF(false, ...), which evaluates to NULL. However, the three call sites in mid8250_probe() and mid8250_remove() unconditionally dereference these function pointers without NULL checks, causing a NULL pointer dereference (kernel oops) on any Denverton (DNV), Ice Lake Xeon D (ICX-D/CDF), or Snowridge (SNR) platform. Fix this by adding the missing NULL checks before calling the setup and exit callbacks. Fixes: b1b4efea05a5 ("serial: 8250_mid: Disable DMA for selected platforms") Cc: stable Reviewed-by: Andy Shevchenko Signed-off-by: Jiangshan Yi Link: https://patch.msgid.link/20260715073546.1875083-1-yijiangshan@kylinos.cn Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_mid.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) --- a/drivers/tty/serial/8250/8250_mid.c +++ b/drivers/tty/serial/8250/8250_mid.c @@ -318,9 +318,11 @@ static int mid8250_probe(struct pci_dev if (!uart.port.membase) return -ENOMEM; - ret = mid->board->setup(mid, &uart.port); - if (ret) - return ret; + if (mid->board->setup) { + ret = mid->board->setup(mid, &uart.port); + if (ret) + return ret; + } ret = mid8250_dma_setup(mid, &uart); if (ret) @@ -336,7 +338,8 @@ static int mid8250_probe(struct pci_dev return 0; err: - mid->board->exit(mid); + if (mid->board->exit) + mid->board->exit(mid); return ret; } @@ -346,7 +349,8 @@ static void mid8250_remove(struct pci_de serial8250_unregister_port(mid->line); - mid->board->exit(mid); + if (mid->board->exit) + mid->board->exit(mid); } static const struct mid8250_board pnw_board = {