mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC] drm/pvr: define oversized freelist reconstruction handling
@ 2026-07-22  4:09 Pengpeng Hou
  2026-08-03 14:54 ` Alessio Belle
  0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-07-22  4:09 UTC (permalink / raw)
  To: Frank Binns, Matt Coster
  Cc: Sarah Walker, Donald Robson, Boris Brezillon, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel, linux-kernel, Pengpeng Hou

pvr_free_list_process_reconstruct_req() receives a reconstruction count
from firmware and uses it to iterate the request ID array and populate the
response ID array. Both arrays have
ROGUE_FWIF_MAX_FREELISTS_TO_RECONSTRUCT entries, but the count is not
checked against that limit.

An oversized count would therefore make the loop and memcpy() access past
the fixed protocol objects. The bounds issue is clear, but I could not find
an ABI-defined completion for a malformed whole request.

In particular, clamping does not appear justified. It changes the response
count and silently omits IDs that firmware claims to have supplied. Dropping
the request may leave firmware waiting for the reconstruction update, while
echoing the original count cannot be represented safely in the fixed
response.

For comparison, the older Imagination host implementation also assumes a
valid count, processes that many entries and echoes the count in the update:

https://android.googlesource.com/kernel/mediatek/+/android-mtk-3.18/drivers/staging/imgtec/rogue/rgxta3d.c#710

The current ABI provides a per-freelist reconstruction-failed flag, but no
whole-request error value for an invalid count.

What is the intended recovery when firmware supplies a count above the
protocol maximum? Should the driver treat it as a firmware-fatal condition,
complete a bounded subset, or use another firmware-defined response? Once
that contract is clear, I can prepare a narrow patch without inventing new
firmware semantics.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-03 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-22  4:09 [RFC] drm/pvr: define oversized freelist reconstruction handling Pengpeng Hou
2026-08-03 14:54 ` Alessio Belle

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®