Skip to content

Fix several unbounded stack usage

Peter Xu qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 48 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8qdict: fix unbounded stack for qdict_array_entriesqobject/qdict.c+9 -613 replies
2/8block: fix unbounded stack for dump_qdictblock/qapi.c+4 -18 replies
3/8usb: fix unbounded stack for ohci_td_pkthw/usb/hcd-ohci.c+4 -32 replies
4/8usb: fix unbounded stack for xhci_dma_write_u32shw/usb/hcd-xhci.c+8 -411 replies
5/8usb: fix unbounded stack for inotify_watchfnhw/usb/dev-mtp.c+4 -35 replies
6/8usb: fix unbounded stack for usb_mtp_add_strhw/usb/dev-mtp.c+5 -12 replies
7/8migration: fix unbounded stack for source_return_path_threadmigration/migration.c+4 -34 replies
8/8hw/i386: fix unbounded stack for load_multiboothw/i386/multiboot.c+9 -13 replies

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by.

PatchJuan Quintela
1/8
2/8
3/8
4/8
5/8
6/8
7/8R-b
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/8] Fix several unbounded stack usage

Suggested by Paolo.

Ths patchset fixes several of the warnings generated by "-Wstack-usage=100000". There are about 20-30 unbound stack cases during my build, and this patch is only fixing several of them, those which are obvious and easy. For the rest, most of them need some knowledge on specific area (e.g., USB, net, block) to have a better assessment on the limitiation values, and are not covered in this patchset.

One thing to mention about patch 4: I still cannot figure out why the function xhci_dma_write_u32s() cannot be inlined in short time... However, the current fix can at least keep the code behavior not changed while making it stack bounded. Please let me know if anyone knows.

Thanks.
Peter

CC Markus Armbruster <[email protected]>
CC Kevin Wolf <[email protected]>
CC "Michael S. Tsirkin" <[email protected]>
CC Paolo Bonzini <[email protected]>
CC Richard Henderson <[email protected]>
CC Eduardo Habkost <[email protected]>
CC Gerd Hoffmann <[email protected]>
CC Juan Quintela <[email protected]>
CC Amit Shah <[email protected]>
CC Luiz Capitulino <[email protected]>

Peter Xu (8):
qdict: fix unbounded stack for qdict_array_entries
block: fix unbounded stack for dump_qdict
usb: fix unbounded stack for ohci_td_pkt
usb: fix unbounded stack for xhci_dma_write_u32s
usb: fix unbounded stack for inotify_watchfn
usb: fix unbounded stack for usb_mtp_add_str
migration: fix unbounded stack for source_return_path_thread hw/i386: fix unbounded stack for load_multiboot

 block/qapi.c          |  5 ++++-
 hw/i386/multiboot.c   | 10 +++++++++-
 hw/usb/dev-mtp.c      | 13 +++++++++----
 hw/usb/hcd-ohci.c     |  7 ++++---
 hw/usb/hcd-xhci.c     | 12 ++++++++----
 migration/migration.c |  7 ++++---
 qobject/qdict.c       | 15 +++++++++------
 7 files changed, 47 insertions(+), 22 deletions(-)
Signature · 1 line
2.4.3