mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: dlemoal@kernel.org, linux-ide@vger.kernel.org, shao.mingyin@zte.com.cn
Cc: hansg@kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2 0/2] ata: reject invalid DT port numbers in AHCI drivers
Date: Tue, 10 Nov 2026 21:08:04 +0100	[thread overview]
Message-ID: <179434128433.329300.16375323684839027136.b4-ty@kernel.org> (raw)
In-Reply-To: <20261110230327212pqd9rWq5IWa4wD-Ckj5C3@zte.com.cn>

On Tue, 10 Nov 2026 23:03:27 +0800, shao.mingyin@zte.com.cn wrote:
> Both the shared AHCI platform support and the DWC glue use the "reg"
> property of their port child nodes as a port number without checking
> that it addresses one of the controller's ports.
> 
> Patch 1 is in the shared platform code.  ahci_platform_get_firmware()
> uses "reg" as an index into hpriv->saved_port_cap[] while filling the
> firmware-specific port capabilities, so a "reg" value at or above
> hpriv->nports writes past that array.  Patch 2 is in the DWC glue.
> ahci_dwc_init_dmacr() walks the same child nodes a second time and uses
> "reg" both as an index into dpriv->dmacr[] and to compute the port MMIO
> base, with the same out-of-range consequence.
> 
> [...]

Applied to libata/linux.git (for-7.5), thanks!

[1/2] ata: libahci_platform: reject invalid port numbers
      https://git.kernel.org/libata/linux/c/b10c7a1c
[2/2] ata: ahci_dwc: reject invalid DT port numbers
      https://git.kernel.org/libata/linux/c/0f7d0044

Kind regards,
Niklas


      parent reply	other threads:[~2026-11-10 20:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 15:03 shao.mingyin
2026-11-10 15:03 ` [PATCH v2 1/2] ata: libahci_platform: reject invalid port numbers shao.mingyin
2026-11-10 15:03 ` [PATCH v2 2/2] ata: ahci_dwc: reject invalid DT " shao.mingyin
2026-11-10 20:08 ` Niklas Cassel [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=179434128433.329300.16375323684839027136.b4-ty@kernel.org \
    --to=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=hansg@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shao.mingyin@zte.com.cn \
    --cc=stable@vger.kernel.org \
    /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®