qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] hw/misc/bcm2835_property: Fix set-palette, OTP-access properties
@ 2024-07-23 13:10 Peter Maydell
  2024-07-23 13:10 ` [PATCH 1/4] hw/misc/bcm2835_property: Fix handling of FRAMEBUFFER_SET_PALETTE Peter Maydell
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Peter Maydell @ 2024-07-23 13:10 UTC (permalink / raw)
  To: qemu-arm, qemu-devel; +Cc: Philippe Mathieu-Daudé, qemu-stable

Coverity pointed out a problem in the bcm2835_property handling of
the OTP access properties, where a mixup between uint32_t and int
meant that the guest could hand us a very large unsigned value
that we would end up treating as a negative number. In the course
of fixing that I noticed that we also don't handle the set-palette
property correctly. This series:
 * fixes set-palette (enforcing the range restrictions on the
   inputs from the guest and getting the loop termination condition
   correct)
 * uses uint32_t rather than int for the loop variable in the
   OTP access properties to avoid the overflow problem
 * cleans up the code by making various variables have only the
   scope they need rather than being declared once at the top of
   this 400 line function

Only patches 1 and 2 are strictly bugfixes (and cc'd to stable); patches
3 and 4 are small and safe but don't really need to be backported.

thanks
-- PMM

Peter Maydell (4):
  hw/misc/bcm2835_property: Fix handling of FRAMEBUFFER_SET_PALETTE
  hw/misc/bcm2835_property: Avoid overflow in OTP access properties
  hw/misc/bcm2835_property: Restrict scope of start_num, number, otp_row
  hw/misc/bcm2835_property: Reduce scope of variables in mbox push
    function

 hw/misc/bcm2835_property.c | 91 +++++++++++++++++++++-----------------
 1 file changed, 50 insertions(+), 41 deletions(-)

-- 
2.34.1



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

end of thread, other threads:[~2024-08-02  7:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-23 13:10 [PATCH 0/4] hw/misc/bcm2835_property: Fix set-palette, OTP-access properties Peter Maydell
2024-07-23 13:10 ` [PATCH 1/4] hw/misc/bcm2835_property: Fix handling of FRAMEBUFFER_SET_PALETTE Peter Maydell
2024-07-25 11:49   ` Philippe Mathieu-Daudé
2024-07-23 13:10 ` [PATCH 2/4] hw/misc/bcm2835_property: Avoid overflow in OTP access properties Peter Maydell
2024-07-24  7:06   ` Philippe Mathieu-Daudé
2024-07-24 12:31     ` Peter Maydell
2024-07-25  6:57       ` Philippe Mathieu-Daudé
2024-08-02  7:02   ` Michael Tokarev
2024-08-02  7:13     ` Michael Tokarev
2024-07-23 13:10 ` [PATCH 3/4] hw/misc/bcm2835_property: Restrict scope of start_num, number, otp_row Peter Maydell
2024-07-23 13:36   ` Philippe Mathieu-Daudé
2024-07-23 13:10 ` [PATCH 4/4] hw/misc/bcm2835_property: Reduce scope of variables in mbox push function Peter Maydell
2024-07-23 13:35   ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).