mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Alex Deucher <alexdeucher@gmail.com>,
	Noah Weinberger <NoahWeinberger2003@proton.me>
Cc: "alexander.deucher@amd.com" <alexander.deucher@amd.com>,
	"christian.koenig@amd.com" <christian.koenig@amd.com>,
	"Xinhui.Pan@amd.com" <Xinhui.Pan@amd.com>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"simona@ffwll.com" <simona@ffwll.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/amdgpu/atom: do not dereference NULL vbios string pointer
Date: Thu, 12 Nov 2026 10:25:50 +0100	[thread overview]
Message-ID: <131ad9de-a475-4848-978d-08cc98c26013@kernel.org> (raw)
In-Reply-To: <CADnq5_Mp0dxiK1cJOgkCcHap_0y4GhwnW0E52PR7gkySnkMk3g@mail.gmail.com>

On 11/11/2026 17:57, Alex Deucher wrote:
> On Mon, Nov 9, 2026 at 4:41 AM Noah Weinberger
> <NoahWeinberger2003@proton.me> wrote:
>>
>> Hello,
>>
>> In atom_get_vbios_pn(), when the part-number string is empty and
>> atom_find_str_in_rom() cannot find the ATOMBIOS anchor, the fallback
>> computes NULL + sizeof(BIOS_ATOM_PREFIX) - 1, i.e. (unsigned char *)8:
>>
>>     vbios_str = atom_find_str_in_rom(ctx, BIOS_ATOM_PREFIX, 3, 1024, 64);
>>     if (vbios_str == NULL)
>>             vbios_str += sizeof(BIOS_ATOM_PREFIX) - 1;
>>
>> The subsequent range check is false for a near-NULL pointer, so the
>> value survives and *vbios_str dereferences address 8 - a NULL-page oops
>> during probe with a malformed VBIOS that passes the magic checks. The
>> recent hardening of the neighboring date/version/build helpers closed
>> their OOB reads; this fallback path was left intact.
>>
>> Simply leave the part number empty when the anchor is not found.
>>
>> Affected version/commit: mainline fa4ad798f6f681031775266044ba1b0cf3c670bd (v7.4-rc1, 2026-11-07), drivers/gpu/drm/amd/amdgpu/atom.c:1491-1503 (atom_get_vbios_pn).
>> Pointer-arithmetic-on-NULL is pre-existing; this window's hardening series made it the sole fallback outcome.
>>
>> This was found during an assisted (AI-supported) static source review of
>> mainline fa4ad798f6f681031775266044ba1b0cf3c670bd (v7.4-rc1, 2026-11-07); every code path cited below was re-verified by the
>> reporter against that tree. The patch below has NOT been compiled and has
>> NOT been runtime tested, and no reproducer was produced - the triggering
>> conditions are described above instead. Please treat this as a report for
>> verification rather than a battle-tested fix.
>>
>> Reported-by: Noah Weinberger <noahweinberger2003@proton.me>
> 
> Missing your Signed-off-by.

That is not a patch, but a report. It wasn't tested, wasn't even
verified and is possible that it is LLM slop like the rest.

Best regards,
Krzysztof

      reply	other threads:[~2026-11-12  9:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08 22:31 Noah Weinberger
2026-11-11 16:57 ` Alex Deucher
2026-11-12  9:25   ` Krzysztof Kozlowski [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=131ad9de-a475-4848-978d-08cc98c26013@kernel.org \
    --to=krzk@kernel.org \
    --cc=NoahWeinberger2003@proton.me \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=simona@ffwll.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®