qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] hw/timer/renesas_tmr: Fix use of uninitialized data
@ 2021-02-19 22:32 Peter Maydell
  2021-02-19 22:32 ` [PATCH 1/2] hw/timer/renesas_tmr: Prefix constants for CSS values with CSS_ Peter Maydell
  2021-02-19 22:32 ` [PATCH 2/2] hw/timer/renesas_tmr: Fix use of uninitialized data in read_tcnt() Peter Maydell
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Maydell @ 2021-02-19 22:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Magnus Damm, Yoshinori Sato

This patchseries fixes a use-of-uninitialized-data spotted by Coverity
(CID 1429976).

Patch 1 just tweaks some constant names for values of the TCCR.CSS
register field, since patch 2 needs to add some more defines
for the other possible values of the field.

Patch 2 is the bugfix proper; the use-uninitialized happens if the
guest programs TCCR.CSS to values which are either prohibited in
the h/w datasheet, or valid but corresponding to behaviour not
currently implemented by QEMU. (Yes, I could have added LOG_UNIMP
and/or LOG_GUEST_ERROR when the TCCR is written by the guest; it
didn't really seem worth the effort to me.)

thanks
-- PMM

Peter Maydell (2):
  hw/timer/renesas_tmr: Prefix constants for CSS values with CSS_
  hw/timer/renesas_tmr: Fix use of uninitialized data in read_tcnt()

 hw/timer/renesas_tmr.c | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

-- 
2.20.1



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

end of thread, other threads:[~2021-02-19 23:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-19 22:32 [PATCH 0/2] hw/timer/renesas_tmr: Fix use of uninitialized data Peter Maydell
2021-02-19 22:32 ` [PATCH 1/2] hw/timer/renesas_tmr: Prefix constants for CSS values with CSS_ Peter Maydell
2021-02-19 23:10   ` Philippe Mathieu-Daudé
2021-02-19 22:32 ` [PATCH 2/2] hw/timer/renesas_tmr: Fix use of uninitialized data in read_tcnt() Peter Maydell
2021-02-19 23:13   ` 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).