From patchwork Wed Jun 1 16:51:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 12867065 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7E69C43334 for ; Wed, 1 Jun 2022 16:52:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344702AbiFAQww (ORCPT ); Wed, 1 Jun 2022 12:52:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236357AbiFAQwu (ORCPT ); Wed, 1 Jun 2022 12:52:50 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D003D1B797 for ; Wed, 1 Jun 2022 09:52:45 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 41155ED1; Wed, 1 Jun 2022 09:52:45 -0700 (PDT) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.197.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8F3143F66F; Wed, 1 Jun 2022 09:52:44 -0700 (PDT) From: Andre Przywara To: Will Deacon , Julien Thierry Cc: Alexandru Elisei , kvm@vger.kernel.org Subject: [PATCH kvmtool 0/4] Fix some undefined behaviour Date: Wed, 1 Jun 2022 17:51:34 +0100 Message-Id: <20220601165138.3135246-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi, triggered by some integer overflow issues, discovered through Alex' "set RAM base address" series, I enabled "-fsanitize=undefined -fsanitize=address" in the Makefile, and enjoyed the fireworks. This series is cheekily just picking the lowest hanging fruits: Some needlessly unaligned accesses in the virtio-mmio code, and signed shifts in the x86 CPUID code. There are more issues, but they take more time fixing. Please have a look! Cheers, Andre Andre Przywara (4): virtio/mmio: avoid unaligned accesses virtio/mmio: access header members normally virtio/mmio: remove unneeded virtio_mmio_hdr members x86/cpuid: fix undefined behaviour include/kvm/virtio-mmio.h | 12 ++---------- virtio/mmio.c | 19 +++++++++++++++---- x86/cpuid.c | 6 +++--- 3 files changed, 20 insertions(+), 17 deletions(-)