mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Samuel Moelius <sam.moelius@trailofbits.com>
Cc: linux-kernel@vger.kernel.org (open list:LIBRARY CODE),
	Kees Cook <kees@kernel.org>,
	Luis R. Rodriguez <mcgrof@kernel.org>,
	Scott Branden <scott.branden@broadcom.com>
Subject: Re: [PATCH] lib/test_firmware: allocate the configured into_buf size
Date: Fri, 5 Jun 2026 18:44:54 -0700	[thread overview]
Message-ID: <20260605184454.badf4e5002f7bdd54cc8d3fe@linux-foundation.org> (raw)
In-Reply-To: <20260605003038.2005840-1-sam.moelius@trailofbits.com>

On Fri,  5 Jun 2026 00:30:37 +0000 Samuel Moelius <sam.moelius@trailofbits.com> wrote:

> The batched into_buf test path allocates TEST_FIRMWARE_BUF_SIZE bytes
> unconditionally, but then passes test_fw_config->buf_size to
> request_firmware_into_buf() or request_partial_firmware_into_buf().
> 
> Userspace can set config_buf_size above TEST_FIRMWARE_BUF_SIZE before
> triggering a batched request. If the firmware file is large enough, the
> firmware loader writes past the end of the 1 KiB test buffer.
> 
> Allocate the buffer with the same size that the test passes to the firmware
> API so config_buf_size remains the actual buffer size under test.

Cool, thanks.

> Assisted-by: Codex:gpt-5.5-cyber-preview

Sashiko evidently looked further:
	https://sashiko.dev/#/patchset/20260605003038.2005840-1-sam.moelius@trailofbits.com

And appears to have found other bugs in test_firmware.c.  Let me cc a
few people who have previously worked on this.


      reply	other threads:[~2026-06-06  1:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-05  0:30 Samuel Moelius
2026-06-06  1:44 ` Andrew Morton [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=20260605184454.badf4e5002f7bdd54cc8d3fe@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=sam.moelius@trailofbits.com \
    --cc=scott.branden@broadcom.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®