[PATCH OLK-6.6] PCI/AER: Fix NULL pointer access by aer_info
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
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://atomgit.com/openeuler/kernel/merge_requests/20440 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/ZZD... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://atomgit.com/openeuler/kernel/merge_requests/20440 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/ZZD...
participants (2)
-
patchwork bot -
Ziming Du