From patchwork Wed May 5 21:10:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12241039 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29CCEC433ED for ; Wed, 5 May 2021 21:13:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6793F610A7 for ; Wed, 5 May 2021 21:13:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6793F610A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leOpU-0001g5-CT for qemu-devel@archiver.kernel.org; Wed, 05 May 2021 17:13:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leOnL-00086y-3V for qemu-devel@nongnu.org; Wed, 05 May 2021 17:10:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52954) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leOnG-0003y6-SX for qemu-devel@nongnu.org; Wed, 05 May 2021 17:10:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620249053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V1eoWZpIvlvfdoZhmliQ/BG4aKpCe40O/MgPuON3DVs=; b=BoQsRO0/jUIWy5DWT8C9uWHpSQWuerhMukaU2naB5Wbl8Cj5y9ANRU6KvHGxr0Z4bzxZUZ SdXx/B4jWTOWestByOG/RfObqDZS1f4u93ExNQIGUd4YhkB9zasAhn4vFkBuhUqVCYvvVh ZwVRewqJflP01z89xHEPR5Y09P+AE4c= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-273-E3Q9JkI1MzugqPr_xSNl6Q-1; Wed, 05 May 2021 17:10:51 -0400 X-MC-Unique: E3Q9JkI1MzugqPr_xSNl6Q-1 Received: by mail-wm1-f69.google.com with SMTP id 7-20020a05600c2307b02901432673350dso702962wmo.9 for ; Wed, 05 May 2021 14:10:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3ll0S7QnsmVnP+/vVrYK4l7xjVxe7b+K//XpBK6D6DU=; b=jt5jRt5c4PefcL1QBeChNzeTRiDgNwV/r9/3GVLzADcwXSFWQOXPr8cln7T58A4NXn VBvc80mW68t7bZ74PXx6uyAie/hXAX5KYPK8GE7Lw8nO8psRu78s1cmLSlUT6GjCK68D YhViR0Y8z+aqgEXTFH+bNrBT0lBZRX0oHNMf7kWlaplbEbvQh3Sk948aCXAhO12U2qsq QxVvbSq5Gh+3JVZYYfTeZFbB2fDuWmawelONkFIqSdEgqBmgbejaL7qaYOHpB0o/GZmY lbB9llr6BVFl4JXi8F8MAeZoLVzdKIFDotItPtgGLXebGh5SV4hrKUN4BlRhIKqnPGxD 5rUg== X-Gm-Message-State: AOAM532liC9F1a7mqhpL/UNQVfPONUcdHPDvUuusWasaj/mgiJCwPrVz 9MB1lH6N7DHfMKG2LKb1+geW6fyAWHi8nmIyA5pODMY3ed5qkWxoiyp8v9EXngn1RYYFs7IVlYR dkiVkFoXSAr/LyGFfNF2Hav6ToJtUAI2l7TxqsVzdZ6oaiWi5eTvrnvkzFXzwh7SL X-Received: by 2002:a5d:49c2:: with SMTP id t2mr1080598wrs.64.1620249050305; Wed, 05 May 2021 14:10:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhPKHe189annECOIBjeRafeArOAeRzdj3lKGhiMAt3AZbiZIRvZoFgPPQZA4bnruZwo8xoWw== X-Received: by 2002:a5d:49c2:: with SMTP id t2mr1080569wrs.64.1620249049909; Wed, 05 May 2021 14:10:49 -0700 (PDT) Received: from x1w.redhat.com (astrasbourg-653-1-188-220.w90-13.abo.wanadoo.fr. [90.13.127.220]) by smtp.gmail.com with ESMTPSA id h8sm523503wmq.19.2021.05.05.14.10.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 14:10:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 00/23] misc: Remove variable-length arrays on the stack Date: Wed, 5 May 2021 23:10:24 +0200 Message-Id: <20210505211047.1496765-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.693, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Gerd Hoffmann , =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Hi, This series is inspired by Gerd Hoffmann and CVE-2021-3527. It removes all uses of variable-length arrays in the repository, then enable the '-Wvla' warning to avoid new code using vla to be merged. Mostly trivial patches using GLib autofree. Please review, Phil. (based on usb-20210505-pull-request tag) Based-on: 20210505130716.1128420-1-kraxel@redhat.com Philippe Mathieu-Daudé (23): block/vpc: Avoid dynamic stack allocation chardev/baum: Replace magic values by X_MAX / Y_MAX definitions chardev/baum: Use definitions to avoid dynamic stack allocation chardev/baum: Avoid dynamic stack allocation io/channel-websock: Replace strlen(const_str) by sizeof(const_str) - 1 hw/block/dataplane/virtio-blk: Avoid dynamic stack allocation hw/block/nvme: Use definition to avoid dynamic stack allocation hw/block/nvme: Avoid dynamic stack allocation hw/net/e1000e_core: Use definition to avoid dynamic stack allocation hw/ppc/pnv: Avoid dynamic stack allocation hw/intc/xics: Avoid dynamic stack allocation hw/i386/multiboot: Avoid dynamic stack allocation hw/usb/hcd-xhci: Avoid dynamic stack allocation hw/usb/hcd-ohci: Use definition to avoid dynamic stack allocation net: Avoid dynamic stack allocation ui/curses: Avoid dynamic stack allocation ui/spice-display: Avoid dynamic stack allocation ui/vnc-enc-hextile: Use definitions to avoid dynamic stack allocation ui/vnc-enc-tight: Avoid dynamic stack allocation util/iov: Avoid dynamic stack allocation target/ppc/kvm: Avoid dynamic stack allocation tests/unit/test-vmstate: Avoid dynamic stack allocation configure: Prohibit variable-length allocations by using -Wvla CPPFLAG configure | 2 +- ui/vnc-enc-hextile-template.h | 3 ++- block/vpc.c | 4 ++-- chardev/baum.c | 22 +++++++++++++--------- hw/block/dataplane/virtio-blk.c | 7 ++++--- hw/block/nvme.c | 17 +++++++++-------- hw/i386/multiboot.c | 5 ++--- hw/intc/xics.c | 2 +- hw/net/e1000e_core.c | 7 ++++--- hw/net/fsl_etsec/rings.c | 9 ++++----- hw/net/rocker/rocker_of_dpa.c | 2 +- hw/ppc/pnv.c | 4 ++-- hw/ppc/spapr.c | 8 ++++---- hw/ppc/spapr_pci_nvlink2.c | 2 +- hw/usb/hcd-ohci.c | 7 ++++--- hw/usb/hcd-xhci.c | 2 +- io/channel-websock.c | 2 +- net/dump.c | 2 +- net/tap.c | 2 +- target/ppc/kvm.c | 2 +- tests/unit/test-vmstate.c | 7 +++---- ui/curses.c | 2 +- ui/spice-display.c | 2 +- ui/vnc-enc-tight.c | 11 ++++++----- util/iov.c | 2 +- 25 files changed, 71 insertions(+), 64 deletions(-)