From: Damien Le Moal <dlemoal@kernel.org>
To: TJ Adams <tadamsjr@google.com>, Niklas Cassel <cassel@kernel.org>,
Hannes Reinecke <hare@suse.de>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
Igor Pylypiv <ipylypiv@google.com>,
Salomon Dushimirimana <salomondush@google.com>
Subject: Re: [PATCH v2 1/2] ata: libata-core: Skip HPA resize for locked drives
Date: Tue, 7 Jul 2026 15:02:24 +0900 [thread overview]
Message-ID: <3fbfd30e-1555-4ce2-9cb5-72807c1a8b23@kernel.org> (raw)
In-Reply-To: <20260706210054.1336654-2-tadamsjr@google.com>
On 7/7/26 06:00, TJ Adams wrote:
> Skip HPA resize in ata_hpa_resize() if the drive is security locked.
> If the drive is locked, the command to read the native max address
> fails with -EACCES, which currently causes the sticky quirk
> ATA_QUIRK_BROKEN_HPA to be set on the device.
>
> Setting this sticky quirk causes subsequent revalidations (after the
> drive is unlocked) to bypass HPA checks, preventing the unlocked drive
> from exposing its full native capacity without a reboot or device removal.
>
> Signed-off-by: Terrence Adams <tadamsjr@google.com>
Doesn't this need the same fixes tag as patch 2 ?
> ---
> drivers/ata/libata-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index bdc88cf74709..3c06a15952f8 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -1338,7 +1338,7 @@ static int ata_hpa_resize(struct ata_device *dev)
> /* do we need to do it? */
> if ((dev->class != ATA_DEV_ATA && dev->class != ATA_DEV_ZAC) ||
> !ata_id_has_lba(dev->id) || !ata_id_hpa_enabled(dev->id) ||
> - (dev->quirks & ATA_QUIRK_BROKEN_HPA))
> + (dev->quirks & ATA_QUIRK_BROKEN_HPA) || ata_id_is_locked(dev->id))
> return 0;
>
> /* read native max address */
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2026-07-07 6:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 18:28 [PATCH] ata: libata-core: Allow capacity transition to zero for locked drives TJ Adams
2026-06-22 18:40 ` sashiko-bot
2026-06-24 14:20 ` Niklas Cassel
2026-07-01 23:16 ` TJ Adams
2026-07-02 15:43 ` Niklas Cassel
2026-07-06 21:00 ` [PATCH v2 0/2] Fixes for security " TJ Adams
2026-07-06 21:00 ` [PATCH v2 1/2] ata: libata-core: Skip HPA resize for " TJ Adams
2026-07-07 6:02 ` Damien Le Moal [this message]
2026-07-06 21:00 ` [PATCH v2 2/2] ata: libata-core: Allow capacity transition to zero " TJ Adams
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=3fbfd30e-1555-4ce2-9cb5-72807c1a8b23@kernel.org \
--to=dlemoal@kernel.org \
--cc=cassel@kernel.org \
--cc=hare@suse.de \
--cc=ipylypiv@google.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=salomondush@google.com \
--cc=tadamsjr@google.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