Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: TJ Adams <tadamsjr@google.com>
Cc: Niklas Cassel <cassel@kernel.org>, Hannes Reinecke <hare@suse.de>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	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: Wed, 8 Jul 2026 10:38:43 +0900	[thread overview]
Message-ID: <a21d5f7d-df57-49c6-ba94-f210c674a24a@kernel.org> (raw)
In-Reply-To: <CAL54JgdpKG6VJ6GLjjs5prB7tH7mF-SCVdH-AHgCzBj2uCynfg@mail.gmail.com>

On 7/8/26 02:01, TJ Adams wrote:
> On Mon, Jul 6, 2026 at 11:02 PM Damien Le Moal <dlemoal@kernel.org> wrote:
>>
>> 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 ?
> 
> Hey Damien,
> 
> I don't think this should have the same fixes tag as patch 2, because without
> commit 91842ed844a0 ("ata: libata-core: Set capacity to zero for a security
> locked drive") the problem still exists.
> 
> The quirk gets set not because of the capacity being zero but because the locked
> drive returns -EACCES.
> 
> I think Fixes: 05027adccc09 ("libata: remiplement ata_hpa_resize()"), might be
> better for this patch.

Most likely not. This dates back to 2007 and security was not supported until
2017 (commit 818831c8b22f7). Let me dig a little more. But at the very least, I
will add a Cc: stable tag to the patch.

> If you agree, I can send a v3 or if it's easier, feel free to amend the commit
> message yourself.

No need to resend. I will add whatever tag is needed.
Thanks.

> 
> Best Regards,
> TJ Adams
> 


-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2026-07-08  1:38 UTC|newest]

Thread overview: 12+ 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
2026-07-07 17:01             ` TJ Adams
2026-07-08  1:38               ` Damien Le Moal [this message]
2026-07-06 21:00         ` [PATCH v2 2/2] ata: libata-core: Allow capacity transition to zero " TJ Adams
2026-07-08  4:53         ` [PATCH v2 0/2] Fixes for security " Damien Le Moal

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=a21d5f7d-df57-49c6-ba94-f210c674a24a@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