qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] linux-user/riscv: Disable unsupported SA_RESTORER
@ 2025-02-02 22:57 Thomas Weißschuh
  2025-02-24  3:41 ` Alistair Francis
  2025-02-24  4:10 ` Alistair Francis
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2025-02-02 22:57 UTC (permalink / raw)
  To: qemu-devel, Laurent Vivier; +Cc: Thomas Weißschuh

Linux on riscv does not support SA_RESTORER.
Currently QEMU thinks there is a field 'sa_restorer' in the middle of
'struct sigaction' which does not actually exist.
This leads to corrupted data and out-of-bounds accesses.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
---
 linux-user/riscv/target_signal.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/linux-user/riscv/target_signal.h b/linux-user/riscv/target_signal.h
index 6c0470f0bc82c6330ce50cb662f2039cf1fab288..258945770b674c0b6b66a94659d9c93fbabffdfb 100644
--- a/linux-user/riscv/target_signal.h
+++ b/linux-user/riscv/target_signal.h
@@ -4,5 +4,6 @@
 #include "../generic/signal.h"
 
 #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1
+#undef TARGET_SA_RESTORER
 
 #endif /* RISCV_TARGET_SIGNAL_H */

---
base-commit: 6fccaa2fba391815308a746d68f7fa197bc93586
change-id: 20250202-riscv-sa-restorer-edd3dfa7790f

Best regards,
-- 
Thomas Weißschuh <thomas@t-8ch.de>



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] linux-user/riscv: Disable unsupported SA_RESTORER
  2025-02-02 22:57 [PATCH] linux-user/riscv: Disable unsupported SA_RESTORER Thomas Weißschuh
@ 2025-02-24  3:41 ` Alistair Francis
  2025-02-24  4:10 ` Alistair Francis
  1 sibling, 0 replies; 4+ messages in thread
From: Alistair Francis @ 2025-02-24  3:41 UTC (permalink / raw)
  To: Thomas Weißschuh; +Cc: qemu-devel, Laurent Vivier

On Mon, Feb 3, 2025 at 8:58 AM Thomas Weißschuh <thomas@t-8ch.de> wrote:
>
> Linux on riscv does not support SA_RESTORER.
> Currently QEMU thinks there is a field 'sa_restorer' in the middle of
> 'struct sigaction' which does not actually exist.
> This leads to corrupted data and out-of-bounds accesses.
>
> Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  linux-user/riscv/target_signal.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/linux-user/riscv/target_signal.h b/linux-user/riscv/target_signal.h
> index 6c0470f0bc82c6330ce50cb662f2039cf1fab288..258945770b674c0b6b66a94659d9c93fbabffdfb 100644
> --- a/linux-user/riscv/target_signal.h
> +++ b/linux-user/riscv/target_signal.h
> @@ -4,5 +4,6 @@
>  #include "../generic/signal.h"
>
>  #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1
> +#undef TARGET_SA_RESTORER
>
>  #endif /* RISCV_TARGET_SIGNAL_H */
>
> ---
> base-commit: 6fccaa2fba391815308a746d68f7fa197bc93586
> change-id: 20250202-riscv-sa-restorer-edd3dfa7790f
>
> Best regards,
> --
> Thomas Weißschuh <thomas@t-8ch.de>
>
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] linux-user/riscv: Disable unsupported SA_RESTORER
  2025-02-02 22:57 [PATCH] linux-user/riscv: Disable unsupported SA_RESTORER Thomas Weißschuh
  2025-02-24  3:41 ` Alistair Francis
@ 2025-02-24  4:10 ` Alistair Francis
  2025-02-25  6:41   ` Thomas Weißschuh
  1 sibling, 1 reply; 4+ messages in thread
From: Alistair Francis @ 2025-02-24  4:10 UTC (permalink / raw)
  To: Thomas Weißschuh; +Cc: qemu-devel, Laurent Vivier

On Mon, Feb 3, 2025 at 8:58 AM Thomas Weißschuh <thomas@t-8ch.de> wrote:
>
> Linux on riscv does not support SA_RESTORER.
> Currently QEMU thinks there is a field 'sa_restorer' in the middle of
> 'struct sigaction' which does not actually exist.
> This leads to corrupted data and out-of-bounds accesses.
>
> Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>

Thanks!

Applied to riscv-to-apply.next

Alistair

> ---
>  linux-user/riscv/target_signal.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/linux-user/riscv/target_signal.h b/linux-user/riscv/target_signal.h
> index 6c0470f0bc82c6330ce50cb662f2039cf1fab288..258945770b674c0b6b66a94659d9c93fbabffdfb 100644
> --- a/linux-user/riscv/target_signal.h
> +++ b/linux-user/riscv/target_signal.h
> @@ -4,5 +4,6 @@
>  #include "../generic/signal.h"
>
>  #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1
> +#undef TARGET_SA_RESTORER
>
>  #endif /* RISCV_TARGET_SIGNAL_H */
>
> ---
> base-commit: 6fccaa2fba391815308a746d68f7fa197bc93586
> change-id: 20250202-riscv-sa-restorer-edd3dfa7790f
>
> Best regards,
> --
> Thomas Weißschuh <thomas@t-8ch.de>
>
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] linux-user/riscv: Disable unsupported SA_RESTORER
  2025-02-24  4:10 ` Alistair Francis
@ 2025-02-25  6:41   ` Thomas Weißschuh
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2025-02-25  6:41 UTC (permalink / raw)
  To: Alistair Francis; +Cc: qemu-devel, Laurent Vivier

Hi Alistair,

On 2025-02-24 14:10:19+1000, Alistair Francis wrote:
> On Mon, Feb 3, 2025 at 8:58 AM Thomas Weißschuh <thomas@t-8ch.de> wrote:
> >
> > Linux on riscv does not support SA_RESTORER.
> > Currently QEMU thinks there is a field 'sa_restorer' in the middle of
> > 'struct sigaction' which does not actually exist.
> > This leads to corrupted data and out-of-bounds accesses.
> >
> > Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
> 
> Thanks!
> 
> Applied to riscv-to-apply.next

Thanks, however this got superseded by Andreas Schwab's better
"linux-user: Move TARGET_SA_RESTORER out of generic/signal.h".

Could you drop it again?

[0] https://lore.kernel.org/qemu-devel/mvmed060xc9.fsf@suse.de/


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-25 17:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-02 22:57 [PATCH] linux-user/riscv: Disable unsupported SA_RESTORER Thomas Weißschuh
2025-02-24  3:41 ` Alistair Francis
2025-02-24  4:10 ` Alistair Francis
2025-02-25  6:41   ` Thomas Weißschuh

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