qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-5.2 v2 0/4] hw/net/can/ctucan: fix Coverity and other issues
@ 2020-11-10 17:06 Peter Maydell
  2020-11-10 17:06 ` [PATCH for-5.2 v2 1/4] hw/net/can/ctucan: Don't allow guest to write off end of tx_buffer Peter Maydell
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Peter Maydell @ 2020-11-10 17:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jason Wang, Vikram Garhwal, Pavel Pisa

This patchset fixes a couple of issues spotted by Coverity:
 * incorrect address checks meant the guest could write off the
   end of the tx_buffer arrays
 * we had an unused value in ctucan_send_ready_buffers()
and also some I noticed while reading the code:
 * we don't adjust the device's non-portable use of bitfields
   on bigendian hosts
 * we should use stl_le_p() rather than casting uint_t* to
   uint32_t*

Tested with "make check" only.

Changes v1->v2: don't assert() the can't-happen case in patch 1,
to allow for future adjustment of #defines that correspond to
h/w synthesis parameters.

thanks
 -- PMM

Peter Maydell (4):
  hw/net/can/ctucan: Don't allow guest to write off end of tx_buffer
  hw/net/can/ctucan: Avoid unused value in ctucan_send_ready_buffers()
  hw/net/can/ctucan_core: Handle big-endian hosts
  hw/net/can/ctucan_core: Use stl_le_p to write to tx_buffers

 hw/net/can/ctucan_core.h |  3 +--
 hw/net/can/ctucan_core.c | 23 +++++++----------------
 2 files changed, 8 insertions(+), 18 deletions(-)

-- 
2.20.1



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

end of thread, other threads:[~2020-11-10 22:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-10 17:06 [PATCH for-5.2 v2 0/4] hw/net/can/ctucan: fix Coverity and other issues Peter Maydell
2020-11-10 17:06 ` [PATCH for-5.2 v2 1/4] hw/net/can/ctucan: Don't allow guest to write off end of tx_buffer Peter Maydell
2020-11-10 18:01   ` Pavel Pisa
2020-11-10 18:24     ` Peter Maydell
2020-11-10 19:30       ` Pavel Pisa
2020-11-10 21:18         ` Peter Maydell
2020-11-10 22:02           ` Pavel Pisa
2020-11-10 17:06 ` [PATCH for-5.2 v2 2/4] hw/net/can/ctucan: Avoid unused value in ctucan_send_ready_buffers() Peter Maydell
2020-11-10 19:36   ` Pavel Pisa
2020-11-10 21:05     ` Peter Maydell
2020-11-10 17:06 ` [PATCH for-5.2 v2 3/4] hw/net/can/ctucan_core: Handle big-endian hosts Peter Maydell
2020-11-10 19:37   ` Pavel Pisa
2020-11-10 17:06 ` [PATCH for-5.2 v2 4/4] hw/net/can/ctucan_core: Use stl_le_p to write to tx_buffers Peter Maydell
2020-11-10 18:03   ` Pavel Pisa

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).