diff mbox series

[4/4] linux-user: Sanitize interp_info and, for mips only, init field fp_abi

Message ID 1556040926-23931-5-git-send-email-aleksandar.markovic@rt-rk.com
State New
Headers show
Series linux-user: A set of misc patches for 4.1 | expand

Commit Message

Aleksandar Markovic April 23, 2019, 5:35 p.m. UTC
From: Daniel Santos <daniel.santos@pobox.com>

Sanitize interp_info structure in load_elf_binary() and, for mips only,
init its field fp_abi. This fixes appearances of "Unexpected FPU mode"
message in some MIPS use cases.

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
 linux-user/elfload.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Philippe Mathieu-Daudé April 23, 2019, 10:42 p.m. UTC | #1
Hi Aleksandar,

On 4/23/19 7:35 PM, Aleksandar Markovic wrote:
> From: Daniel Santos <daniel.santos@pobox.com>
> 
> Sanitize interp_info structure in load_elf_binary() and, for mips only,
> init its field fp_abi. This fixes appearances of "Unexpected FPU mode"
> message in some MIPS use cases.
> 

Please add:

Fixes: https://bugs.launchpad.net/qemu/+bug/1825002

> Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
> ---
>  linux-user/elfload.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index c1a2602..7f09d57 100644
> --- a/linux-user/elfload.c
> +++ b/linux-user/elfload.c
> @@ -2698,6 +2698,11 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info)
>      char *elf_interpreter = NULL;
>      char *scratch;
>  
> +    memset(&interp_info, 0, sizeof(interp_info));
> +#ifdef TARGET_MIPS
> +    interp_info.fp_abi = MIPS_ABI_FP_UNKNOWN;
> +#endif
> +
>      info->start_mmap = (abi_ulong)ELF_START_MMAP;
>  
>      load_elf_image(bprm->filename, bprm->fd, info,
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Aleksandar Markovic April 24, 2019, 11:02 a.m. UTC | #2
> From: Philippe Mathieu-Daudé <philmd@redhat.com>
> Subject: Re: [Qemu-devel] [PATCH 4/4] linux-user: Sanitize interp_info and, for mips only, init field fp_abi
>
> Hi Aleksandar,
> 
> On 4/23/19 7:35 PM, Aleksandar Markovic wrote:
> > From: Daniel Santos <daniel.santos@pobox.com>
> >
> > Sanitize interp_info structure in load_elf_binary() and, for mips only,
> > init its field fp_abi. This fixes appearances of "Unexpected FPU mode"
> > message in some MIPS use cases.
> >
> 
> Please add:
> 
> Fixes: https://bugs.launchpad.net/qemu/+bug/1825002
> 

Will do, Philippe. Thanks a bunch!

Aleksandar
diff mbox series

Patch

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index c1a2602..7f09d57 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -2698,6 +2698,11 @@  int load_elf_binary(struct linux_binprm *bprm, struct image_info *info)
     char *elf_interpreter = NULL;
     char *scratch;
 
+    memset(&interp_info, 0, sizeof(interp_info));
+#ifdef TARGET_MIPS
+    interp_info.fp_abi = MIPS_ABI_FP_UNKNOWN;
+#endif
+
     info->start_mmap = (abi_ulong)ELF_START_MMAP;
 
     load_elf_image(bprm->filename, bprm->fd, info,