Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/usermode/usermode Prevent recursive IO signals. Thi...



details:   https://anonhg.NetBSD.org/src/rev/58433f6e383a
branches:  trunk
changeset: 773753:58433f6e383a
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Wed Feb 15 15:20:53 2012 +0000

description:
Prevent recursive IO signals. This prevents crashes when pieces of text are
pasted in say an Xterm. Each char might create a SIGIO running out of
stackspace very quickly!

diffstat:

 sys/arch/usermode/usermode/trap.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 03c8fea25f8b -r 58433f6e383a sys/arch/usermode/usermode/trap.c
--- a/sys/arch/usermode/usermode/trap.c Wed Feb 15 13:01:00 2012 +0000
+++ b/sys/arch/usermode/usermode/trap.c Wed Feb 15 15:20:53 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.62 2012/01/22 17:51:39 reinoud Exp $ */
+/* $NetBSD: trap.c,v 1.63 2012/02/15 15:20:53 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk <reinoud%netbsd.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.62 2012/01/22 17:51:39 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.63 2012/02/15 15:20:53 reinoud Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -362,6 +362,11 @@
 
        thunk_sigemptyset(&jump_ucp.uc_sigmask);
        jump_ucp.uc_flags = _UC_STACK | _UC_CPU | _UC_SIGMASK;
+
+       /* prevent recursive IO signals */
+       if (sig == SIGIO)
+               thunk_sigaddset(&jump_ucp.uc_sigmask, SIGIO);
+
        thunk_makecontext(&jump_ucp,
                        (void (*)(void)) f,
                3, (void *) from_userland, (void *) pc, (void *) va);



Home | Main Index | Thread Index | Old Index