From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adBdn-0002Gm-Rl for qemu-devel@nongnu.org; Tue, 08 Mar 2016 02:01:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adBdm-00068S-VN for qemu-devel@nongnu.org; Tue, 08 Mar 2016 02:01:11 -0500 From: Peter Xu Date: Tue, 8 Mar 2016 15:00:38 +0800 Message-Id: <1457420446-25276-1-git-send-email-peterx@redhat.com> Subject: [Qemu-devel] [PATCH 0/8] Fix several unbounded stack usage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Juan Quintela , Markus Armbruster , peterx@redhat.com, Luiz Capitulino , Gerd Hoffmann , Amit Shah , pbonzini@redhat.com, Richard Henderson 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 CC: Kevin Wolf CC: "Michael S. Tsirkin" CC: Paolo Bonzini CC: Richard Henderson CC: Eduardo Habkost CC: Gerd Hoffmann CC: Juan Quintela CC: Amit Shah CC: Luiz Capitulino CC: qemu-block@nongnu.org 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(-) -- 2.4.3