mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre Gondois <pierre.gondois@arm.com>
To: Kuppuswamy Sathyanarayanan
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	Lukas Wunner <lukas@wunner.de>
Cc: linux-kernel@vger.kernel.org,
	Ashok Raj <ashok.raj@oss.qualcomm.com>,
	James Morse <james.morse@arm.com>,
	Mark Brown <broonie@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>, Tony Luck <tony.luck@intel.com>,
	Hanjun Guo <guohanjun@huawei.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Shuai Xue <xueshuai@linux.alibaba.com>,
	Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
	Oliver O'Halloran <oohall@gmail.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>,
	Pawel Chmielewski <pawel.chmielewski@intel.com>,
	Yazen Ghannam <yazen.ghannam@amd.com>,
	Qiuxu Zhuo <qiuxu.zhuo@intel.com>,
	Avadhut Naik <avadhut.naik@amd.com>,
	Radu Rendec <radu@rendec.net>,
	Jonathan Cameron <jic23@kernel.org>,
	Dave Jiang <dave.jiang@intel.com>,
	Kai-Heng Feng <kaihengf@nvidia.com>,
	"Fabio M. De Francesco" <fabio.m.de.francesco@linux.intel.com>,
	Breno Leitao <leitao@debian.org>,
	Terry Bowman <terry.bowman@amd.com>,
	linux-acpi@vger.kernel.org, linux-edac@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org,
	acpica-devel@lists.linux.dev
Subject: Re: [PATCH v1 19/19] PCI/ERR: Avoid NULL bridge pointer
Date: Wed, 18 Nov 2026 16:11:48 +0100	[thread overview]
Message-ID: <ba5f649c-f338-40d1-9e85-b666590835ca@arm.com> (raw)
In-Reply-To: <28da8229-99f9-47c7-b2d6-d301ae34253f@linux.intel.com>

Hello Lukas, Kuppuswamy,

On 11/17/26 19:57, Kuppuswamy Sathyanarayanan wrote:
>
> On 11/17/26 03:50, Lukas Wunner wrote:
>> On Tue, Nov 17, 2026 at 12:10:29PM +0100, Pierre Gondois wrote:
>>> Return PCI_ERS_RESULT_DISCONNECT when no upstream bridge is available,
>>> avoiding a NULL pointer dereference in pci_walk_bridge().
>> How can that happen?  If it can happen (which I doubt), why isn't this
>> patch tagged for stable?
> One way I can see is a device without a PCIe capability on a root bus.
> pci_pcie_type() returns 0, which is PCI_EXP_TYPE_ENDPOINT, and
> pci_upstream_bridge() returns NULL. Native AER never gets there. Only
> firmware-first can, through aer_recover_work_func(), and only if
> firmware reports a PCIe error section for such a device. If that is
> the case, skipping recovery for !pci_is_pcie(pdev) in
> aer_recover_work_func() seems a better fit than a check in
> pcie_do_recovery().
>
>> Why is it at the end of this series?  Does the series somehow make it
>> possible that there's no upstream bridge?  Which patch does that?
>> If the preceding patches are not the cause of a potential NULL
>> pointer deref, why isn't this patch submitted separately from the series?

To test this serie, I generated and injected synthetic CPER records.
The PCI device referenced in some synthetic CPER records did not
actually exist. In such case, the kernel crashes due to a NULL
pointer deferencement.

This use case is indeed slightly unsusual and unlikely to happen
in the real world. The patch was still included in the serie.

Please let me know if the patch should be either dropped or better
documented.

      reply	other threads:[~2026-11-18 15:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 11:10 [PATCH v1 00/19] ACPI: APEI: Share CPER reporting between GHES and extlog Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 01/19] x86/APEI: Extract common CPER memory error reporting helper Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 02/19] x86/APEI: Report Memory Error Section 2 through MCE Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 03/19] ras: Bound CPER FRU strings in trace events Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 04/19] ACPI: APEI: Use empty FRU values if valid bit is absent Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 05/19] PCI/AER: Embed aer_capability_regs copy in struct aer_recover_entry Pierre Gondois
2026-11-17 11:44   ` Lukas Wunner
2026-11-18 15:10     ` Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 06/19] ACPI: APEI: Remove aer allocation in ghes_handle_aer() Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 07/19] ACPI: extlog: Provide HEST generic data to extlog_print_pcie() Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 08/19] ACPI: extlog: Align extlog_print_pcie() and ghes_handle_aer() Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 09/19] ACPI: extlog: Report errors independently of RAS consumers Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 10/19] ACPI: extlog: Simplify fatal record printing Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 11/19] RAS: Remove unused ras_userspace_consumers() Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 12/19] ACPI: extlog: Extract CPER reporting from acpi_extlog Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 13/19] ACPI: APEI: Share helpers with the common CPER reporter Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 14/19] ACPI: APEI: Return status from cxl_cper_post_event() Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 15/19] ACPI: APEI: Extend common CPER reporting for GHES section types Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 16/19] ACPI: extlog: Report error severity using GHES bindings in MCE Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 17/19] ACPI: APEI: Share the extlog PCIe handler with GHES Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 18/19] ACPI: APEI: Route GHES section reporting through extlog Pierre Gondois
2026-11-17 11:10 ` [PATCH v1 19/19] PCI/ERR: Avoid NULL bridge pointer Pierre Gondois
2026-11-17 11:50   ` Lukas Wunner
2026-11-17 18:57     ` Kuppuswamy Sathyanarayanan
2026-11-18 15:11       ` Pierre Gondois [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba5f649c-f338-40d1-9e85-b666590835ca@arm.com \
    --to=pierre.gondois@arm.com \
    --cc=acpica-devel@lists.linux.dev \
    --cc=ashok.raj@oss.qualcomm.com \
    --cc=avadhut.naik@amd.com \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=broonie@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=dave.jiang@intel.com \
    --cc=fabio.m.de.francesco@linux.intel.com \
    --cc=guohanjun@huawei.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=jic23@kernel.org \
    --cc=kaihengf@nvidia.com \
    --cc=leitao@debian.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lukas@wunner.de \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=mahesh@linux.ibm.com \
    --cc=mchehab@kernel.org \
    --cc=mingo@redhat.com \
    --cc=oohall@gmail.com \
    --cc=pawel.chmielewski@intel.com \
    --cc=qiuxu.zhuo@intel.com \
    --cc=radu@rendec.net \
    --cc=rafael@kernel.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=terry.bowman@amd.com \
    --cc=tglx@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=xueshuai@linux.alibaba.com \
    --cc=yazen.ghannam@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®