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

 



It's possible to send ourselves a SIGINT using F_SETSIG. This is then
interpreted as a Ctrl-c from the user and trinity quits.

Avoid SIGINT, instead use 0, which switches back to the default
behaviour of sending SIGIO.
---
 syscalls/fcntl.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/syscalls/fcntl.c b/syscalls/fcntl.c
index 5d651af..e13735d 100644
--- a/syscalls/fcntl.c
+++ b/syscalls/fcntl.c
@@ -18,6 +18,7 @@
  */
 
 #include <fcntl.h>
+#include <signal.h>
 #include "random.h"
 #include "sanitise.h"
 #include "shm.h"
@@ -90,6 +91,8 @@ void sanitise_fcntl(int childno)
 
 	case F_SETSIG:
 		shm->a3[childno] = (unsigned long) rand32();
+		if (shm->a3[childno] == SIGINT)
+			shm->a3[childno] = 0; /* restore default (SIGIO) */
 		break;
 
 	case F_NOTIFY:
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe trinity" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux