From nobody Fri Sep 20 22:15:02 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1659021629; cv=none; d=zohomail.com; s=zohoarc; b=I00nTOyV4bi6ZywhdGPazJAgPRvsZRhcnUoXGJeeHQJYJEFMcttXakSd4DrvcllYixHFPNCJtDcKyLfcKcGE1l1EkaemnQSBiF44AfoXbu50qUbCv3+jQT43+QPDuh/HBZcfQ6EeglfNg+fjqNxpfeIkzsl9GMDUGV3NVDoTvSY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659021629; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=c4ss+tbkFJfFRzI7qatNEZJh7WZ3snIsk/Ar1GUZZ/8=; b=f188SBeehkQWDDK76DPZPt8//b3imfs34Log/DMDAaFTnWBEdZuA5LqGxQkO4zo/mXluAs2b8cwYDcg33oBwL4e/0Qjosa2Malk/j5lG/GRSi64Qznf/TXOh9q1PPM+G5XeLYrJBGvkOBrzZuUPreSSeC5uc/v+UayTmgudqmhU= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1659021629958192.09490606922998; Thu, 28 Jul 2022 08:20:29 -0700 (PDT) Received: from localhost ([::1]:50706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oH5JM-0000Eo-07 for importer@patchew.org; Thu, 28 Jul 2022 11:20:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oH5DI-0005JJ-Gv for qemu-devel@nongnu.org; Thu, 28 Jul 2022 11:14:12 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:38647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oH5DG-0005mO-Am for qemu-devel@nongnu.org; Thu, 28 Jul 2022 11:14:11 -0400 Received: by mail-wm1-x330.google.com with SMTP id 2-20020a1c0202000000b003a3a22178beso1108831wmc.3 for ; Thu, 28 Jul 2022 08:14:09 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id f18-20020a5d50d2000000b0021e9fafa601sm1337573wrt.22.2022.07.28.08.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jul 2022 08:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=c4ss+tbkFJfFRzI7qatNEZJh7WZ3snIsk/Ar1GUZZ/8=; b=gtSM04pK6sDMm69TAJ5+8HYHe4EtHeEyoad9VOeXBzeyqelA4/VeL4rklBuApqallC FrwJMa5EhXxFVFdiSb1XPvv7OgABLg57DUydnxZrsVlvff5hccUmsorSYSLT8Y71IMsZ J5v4ayx2ZIj6A2tpYXyXN588gp05X1MQwx0i8bEQCYS6rkd/9uW36uCyHp+tSxDVNP4I iujduaV46/JN4PaE9ZBbZTtu47BR4o+r3HvHF6GpNBTm4Gk+E/oLoE1UPzg58dIm8nNh Irgedyhnrmx7L/CM2r5Sh87QISMNW62jZOoQH+09Ln9EH8KquxbSTVKwJV6rjyDKK27m m0qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=c4ss+tbkFJfFRzI7qatNEZJh7WZ3snIsk/Ar1GUZZ/8=; b=UkewrFgOiM37MOS4B4hTcFjaBiim67Lh7lZ+u97F4Z5MlfJsSsbgfNQTcU7OXxZcuz R3z2Nix8tgHLhxctBX0/ZYYIKr/MK61W87QH8atFL8fFiOwBZzmn0vJIUrF0krmBSS5U WpNwaUtI1Zm0AnEFsjBOkqp8IHg7JUWOxyn05MvFIbEV2VuSgCpc9h475FEvEk7eSXnQ uxVOepBxlg4J7WA0QfuniuWCpz9tCSdbuqHEFJr6GvRYpZGlSSDaTi7r4TRxS7QgbtGw +Z74XlwBMJFonQISE0XfVi6R9SNKog5LlNTj0AowcH6m46EsRlP96/7iJvWfARUwLRO1 qvcg== X-Gm-Message-State: AJIora/DG6sf+ms51gi3bEpO1kSn4SAEvjr5WDRLIiwhGdKiFsJYQ7YC zAPsl0sq92sQk+3cjIPtIPq/reZYqSoigg== X-Google-Smtp-Source: AGRyM1ucWCsoysElCMdOBx77CI9KF0/a1VBCFWi7rS2Zj0ATrxBpCwuhEks8Na3nhTlVD7xt6Qqmwg== X-Received: by 2002:a05:600c:190c:b0:3a3:4293:3710 with SMTP id j12-20020a05600c190c00b003a342933710mr7029854wmq.81.1659021248338; Thu, 28 Jul 2022 08:14:08 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Laurent Vivier Subject: [PATCH for-7.1] linux-user/flatload.c: Fix setting of image_info::end_code Date: Thu, 28 Jul 2022 16:14:06 +0100 Message-Id: <20220728151406.2262862-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1659021631376100001 Content-Type: text/plain; charset="utf-8" The flatload loader sets the end_code field in the image_info struct incorrectly, due to a typo. This is a very long-standing bug (dating all the way back to when the bFLT loader was added in 2006), but has gone unnoticed because (a) most people don't use bFLT binaries (b) we don't actually do anything with the end_code field, except print it in debugging traces and pass it to TCG plugins Fix the typo. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1119 Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- linux-user/flatload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/flatload.c b/linux-user/flatload.c index e4c2f89a226..e99570ca182 100644 --- a/linux-user/flatload.c +++ b/linux-user/flatload.c @@ -808,7 +808,7 @@ int load_flt_binary(struct linux_binprm *bprm, struct i= mage_info *info) =20 /* Stash our initial stack pointer into the mm structure */ info->start_code =3D libinfo[0].start_code; - info->end_code =3D libinfo[0].start_code =3D libinfo[0].text_len; + info->end_code =3D libinfo[0].start_code + libinfo[0].text_len; info->start_data =3D libinfo[0].start_data; info->end_data =3D libinfo[0].end_data; info->start_brk =3D libinfo[0].start_brk; --=20 2.25.1