qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Missing Frame initialization
@ 2020-03-19 14:31 Mansour Ahmadi
  0 siblings, 0 replies; only message in thread
From: Mansour Ahmadi @ 2020-03-19 14:31 UTC (permalink / raw)
  To: qemu-devel, Laurent Vivier

[-- Attachment #1: Type: text/plain, Size: 1068 bytes --]

I originally reported this:

In the case of badframe, user struct is not unlocked here and may lead to
deadlock:

https://github.com/qemu/qemu
/blob/d4f7d56759f7c75270c13d5f3f5f736a9558929c/linux-user/m68k/signal.c#L380

In similar case, it in unlocked correctly:
https://github.com/qemu/qemu
/blob/d4f7d56759f7c75270c13d5f3f5f736a9558929c/linux-user/sh4/signal.c#L303

Laurant replied that frame needs to be initialized with NULL in the second
case indeed:

In fact, this case is a little bit different and wrong but to fix that
the solution is to set frame to NULL when it is declared:

linux-user/qemu.h:
* Unlock an area of guest memory.  The first LEN bytes must be
   flushed back to guest memory. host_ptr = NULL is explicitly
   allowed and does nothing. */
static inline void unlock_user(void *host_ptr, abi_ulong guest_addr,
                               long len)
like for linux-user/aarch64/signal.c:
long do_rt_sigreturn(CPUARMState *env)
{
    struct target_rt_sigframe *frame = NULL;
...
We have several targets with the same problem.

Thanks,
Mansour

[-- Attachment #2: Type: text/html, Size: 4961 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-19 14:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19 14:31 Missing Frame initialization Mansour Ahmadi

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).