From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Laurent Vivier <laurent@vivier.eu>,
Peter Maydell <peter.maydell@linaro.org>,
Richard Henderson <richard.henderson@linaro.org>
Subject: [PULL 1/3] linux-user/flatload.c: Fix setting of image_info::end_code
Date: Wed, 3 Aug 2022 16:56:11 +0200 [thread overview]
Message-ID: <20220803145613.428167-2-laurent@vivier.eu> (raw)
In-Reply-To: <20220803145613.428167-1-laurent@vivier.eu>
From: Peter Maydell <peter.maydell@linaro.org>
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 <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220728151406.2262862-1-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
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 e4c2f89a2267..e99570ca182b 100644
--- a/linux-user/flatload.c
+++ b/linux-user/flatload.c
@@ -808,7 +808,7 @@ int load_flt_binary(struct linux_binprm *bprm, struct image_info *info)
/* Stash our initial stack pointer into the mm structure */
info->start_code = libinfo[0].start_code;
- info->end_code = libinfo[0].start_code = libinfo[0].text_len;
+ info->end_code = libinfo[0].start_code + libinfo[0].text_len;
info->start_data = libinfo[0].start_data;
info->end_data = libinfo[0].end_data;
info->start_brk = libinfo[0].start_brk;
--
2.37.1
next prev parent reply other threads:[~2022-08-03 14:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-03 14:56 [PULL 0/3] Linux user for 7.1 patches Laurent Vivier
2022-08-03 14:56 ` Laurent Vivier [this message]
2022-08-03 14:56 ` [PULL 2/3] linux-user: Do not treat madvise()'s advice as a bitmask Laurent Vivier
2022-08-03 14:56 ` [PULL 3/3] linux-user: Use memfd for open syscall emulation Laurent Vivier
2022-08-03 17:12 ` [PULL 0/3] Linux user for 7.1 patches Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220803145613.428167-2-laurent@vivier.eu \
--to=laurent@vivier.eu \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).