From: Xu Yilun <yilun.xu@linux.intel.com>
To: Sebastian Alba Vives <sebasjosue84@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-fpga@vger.kernel.org,
conor.dooley@microchip.com, mdf@kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v6 1/3] fpga: dfl: add bounds check in dfh_get_param_size()
Date: Mon, 18 May 2026 22:42:00 +0800 [thread overview]
Message-ID: <agslOI8ngOTuDFuS@yilunxu-OptiPlex-7050> (raw)
In-Reply-To: <20260512130710.933089-2-sebasjosue84@gmail.com>
On Tue, May 12, 2026 at 07:07:08AM -0600, Sebastian Alba Vives wrote:
> dfh_get_param_size() can return a parameter size larger than the feature
> region because the loop bounds check is evaluated before incrementing
> size. If the EOP (End of Parameters) bit is set in the same iteration,
> the inflated size is returned without re-validation against max.
>
> This can cause create_feature_instance() to call memcpy_fromio() with a
> size exceeding the ioremap'd region when a malicious FPGA device provides
> crafted DFHv1 parameter headers.
>
> Add a bounds check after the size increment to ensure the accumulated
> size never exceeds the feature boundary.
>
> Fixes: a80a4b2b2e4f ("fpga: dfl: add support for DFHv1")
No such commit. Please run checkpatch before posting.
next prev parent reply other threads:[~2026-05-18 15:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 13:07 [PATCH v6 0/3] fpga: bounds checks and input validation fixes Sebastian Alba Vives
2026-05-12 13:07 ` [PATCH v6 1/3] fpga: dfl: add bounds check in dfh_get_param_size() Sebastian Alba Vives
2026-05-18 14:42 ` Xu Yilun [this message]
2026-05-12 13:07 ` [PATCH v6 2/3] fpga: dfl-afu: validate DMA mapping length in afu_dma_map_region() Sebastian Alba Vives
2026-05-12 13:07 ` [PATCH v6 3/3] fpga: microchip-spi: fix zero header_size OOB read in mpf_ops_parse_header() Sebastian Alba Vives
2026-05-18 14:44 ` Xu Yilun
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=agslOI8ngOTuDFuS@yilunxu-OptiPlex-7050 \
--to=yilun.xu@linux.intel.com \
--cc=conor.dooley@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=sebasjosue84@gmail.com \
--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®