From: Vernon Yang <yanglincheng@kylinos.cn> stable inclusion from stable-v6.17.8 commit 6618243bcc3f60825f761a41ed65fef9fe97eb25 category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/11501 CVE: CVE-2025-68309 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=... -------------------------------- [ Upstream commit 0a27bdb14b028fed30a10cec2f945c38cb5ca4fa ] The kzalloc(GFP_KERNEL) may return NULL, so all accesses to aer_info->xxx will result in kernel panic. Fix it. Signed-off-by: Vernon Yang <yanglincheng@kylinos.cn> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20250904182527.67371-1-vernon2gm@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org> Conflicts: drivers/pci/pcie/aer.c [Ziming Du: context conflicts] Signed-off-by: Ziming Du <duziming2@huawei.com> --- drivers/pci/pcie/aer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 67d36680d834..fae1b96fdaab 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -373,6 +373,10 @@ void pci_aer_init(struct pci_dev *dev) return; dev->aer_stats = kzalloc(sizeof(struct aer_stats), GFP_KERNEL); + if (!dev->aer_stats) { + dev->aer_cap = 0; + return; + } /* * We save/restore PCI_ERR_UNCOR_MASK, PCI_ERR_UNCOR_SEVER, -- 2.43.0