From nobody Tue Nov 26 08:56:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1709463144; cv=none; d=zohomail.com; s=zohoarc; b=a6jXVwMxM56dHhadttYMGqo3TIWP+F7GeDpLJ0ivZysoCK0dM3ABQnQ1xjgUFaO9JE2s/wbqAOUGacFHdujgFzwqzKJWT7WT5rpTzM+e+6DqhQssGnEly5Hqgfe7cjjHB2H2fFTL25ECX13X3omgy9iJdGz24xadnTs95AGGG7Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709463144; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ot05ideaXjHDt/XtCs48E+XgUuov6SHY9sSACugHv/8=; b=XG87zvxcKmILKete7Gs3bNL6lBQcqFaglMnqeE6Fswqi6yAl3Zn9CkrWR6sQh7tBgharQX8wYh0PT3kAGdSkfudD8Wh6rONUtUVcQiUFFT7xR7sWn9g9NeNaUiKn+k4RNrMQbWklt/dZSTWNcjyzjpntIvJSQ9ZAmmuAKonw11c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709463144727662.7578212183631; Sun, 3 Mar 2024 02:52:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgjRG-0002I2-1q; Sun, 03 Mar 2024 05:51:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rgjRE-0002Hp-Hn for qemu-devel@nongnu.org; Sun, 03 Mar 2024 05:51:24 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgjRD-0001vc-ID for qemu-devel@nongnu.org; Sun, 03 Mar 2024 05:51:24 -0500 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso3213592a12.3 for ; Sun, 03 Mar 2024 02:51:23 -0800 (PST) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id u11-20020a170903124b00b001dc01efaec2sm6435731plh.168.2024.03.03.02.51.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Mar 2024 02:51:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1709463082; x=1710067882; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Ot05ideaXjHDt/XtCs48E+XgUuov6SHY9sSACugHv/8=; b=rTRGAaMtiI4Z/8gWecRIiW0SCnN2fqQX4sA59lp6Yi8UqRvMFynz3rQvje2OANignS eyjHHQ6tn9VAFCXxm4QlnUeRKRFi8bT9CZCfEQ0oxbVDELv76HesGMCTmAunn98eP1z/ lK+aSvA1G2kUrwx1wJqTVyg9dUjUsYSyT9Z30zst2BcmSM8rtT5VpVpCNoqAOQMnNUSt NoAixkgvTp57Vzjc+gAog/xkt2cm6FHXcz1ypLPRl006QIujQOLYOrDDgYSFzDaqAqPG JMD68v0qMuAzV+GtK9p6tncQVo5YueXu/3ES2HoBtgn2BP7gruwgH7A6BmuvZ4rhlqxF zoLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709463082; x=1710067882; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ot05ideaXjHDt/XtCs48E+XgUuov6SHY9sSACugHv/8=; b=DTfyaL4ukvLoO84nmdyVUfR6HRNX5QFUAamyjqzC9bKyihu1rNm8YR0fUqanmyj27b w4Gk45+wXPye3505mgtrnp9PZe9g4GcF/iXDrVfDj3QKhu8RZT4Hvgo7n/vVmbVYX+bb SIsusl4ipLGGRusDd1OEZ69rk1SkeGmgxEG+S+FnHuRD/SjMgnnnZgt0THGTWFMCUnqf vCPCpk/pBMXRM1JfOOVvNlydb55GOOgex9nAPVPwJ7nVPKdyJZivrnMusMZ0vwLReCQm wxABG19YaTaiy4U1Dr2VOjcglK8Y72eWQK68x7P7c0v7YN4ZvFAjfE1Y3g3ugQiLVdgD WCOg== X-Gm-Message-State: AOJu0Yzq/658a1m9GzSryshuFQXcLXqU8bLezqDqC86SsDqZ7xMhnqQp b7TYBCQ/Z60CTDQ7Hq/35unasUogd1EPkfYHkClkDbT7MLDKlK4yq/89SbVmmCHaSZndG4Dh3b2 e X-Google-Smtp-Source: AGHT+IHPLsrD8aWFPj7I2exnN8z+GxwL27lj8jZ69zrPuabL64JztbfLxsWydaTz1Sp/aJ/gi6agYg== X-Received: by 2002:a17:902:c204:b0:1dc:f913:797c with SMTP id 4-20020a170902c20400b001dcf913797cmr4779179pll.51.1709463082191; Sun, 03 Mar 2024 02:51:22 -0800 (PST) From: Akihiko Odaki Date: Sun, 03 Mar 2024 19:50:38 +0900 Subject: [PATCH 4/7] contrib/elf2dmp: Use lduw_le_p() to read PDB MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240303-elf2dmp-v1-4-bea6649fe3e6@daynix.com> References: <20240303-elf2dmp-v1-0-bea6649fe3e6@daynix.com> In-Reply-To: <20240303-elf2dmp-v1-0-bea6649fe3e6@daynix.com> To: Viktor Prutyanov Cc: qemu-devel@nongnu.org, Akihiko Odaki X-Mailer: b4 0.12.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::532; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x532.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1709463145754100003 This resolved UBSan warnings. Signed-off-by: Akihiko Odaki --- contrib/elf2dmp/pdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/elf2dmp/pdb.c b/contrib/elf2dmp/pdb.c index 40991f5f4c34..2541234205c3 100644 --- a/contrib/elf2dmp/pdb.c +++ b/contrib/elf2dmp/pdb.c @@ -19,6 +19,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/bswap.h" =20 #include "pdb.h" #include "err.h" @@ -187,7 +188,7 @@ static int pdb_init_symbols(struct pdb_reader *r) =20 r->symbols =3D symbols; =20 - r->segments =3D *(uint16_t *)((const char *)symbols + sizeof(PDB_SYMBO= LS) + + r->segments =3D lduw_le_p((const char *)symbols + sizeof(PDB_SYMBOLS) + symbols->module_size + symbols->offset_size + symbols->hash_size + symbols->srcmodule_size + symbols->pdbimport_size + symbols->unknown2_size + --=20 2.44.0