[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [BUG] Inappropriate size of target_sigset_t
From: |
Aleksandar Markovic |
Subject: |
[Qemu-devel] [BUG] Inappropriate size of target_sigset_t |
Date: |
Wed, 3 Jul 2019 19:46:42 +0000 |
Hello, Peter, Laurent,
While working on another problem yesterday, I think I discovered a
long-standing bug in QEMU Linux user mode: our target_sigset_t structure is
eight times smaller as it should be!
In this code segment from syscalls_def.h:
#ifdef TARGET_MIPS
#define TARGET_NSIG 128
#else
#define TARGET_NSIG 64
#endif
#define TARGET_NSIG_BPW TARGET_ABI_BITS
#define TARGET_NSIG_WORDS (TARGET_NSIG / TARGET_NSIG_BPW)
typedef struct {
abi_ulong sig[TARGET_NSIG_WORDS];
} target_sigset_t;
... TARGET_ABI_BITS should be replaced by eight times smaller constant (in
fact, semantically, we need TARGET_ABI_BYTES, but it is not defined) (what is
needed is actually "a byte per signal" in target_sigset_t, and we allow "a bit
per signal").
All this probably sounds to you like something impossible, since this code is
in QEMU "since forever", but I checked everything, and the bug seems real. I
wish you can prove me wrong.
I just wanted to let you know about this, given the sensitive timing of current
softfreeze, and the fact that I won't be able to do more investigation on this
in coming weeks, since I am busy with other tasks, but perhaps you can analyze
and do something which you consider appropriate.
Yours,
Aleksandar