1 /* Tries to exploit bug in pselect mask handling:
2 https://bugs.kde.org/show_bug.cgi?id=359871
3 where client program was able to successfully block VG_SIGVGKILL. */
5 #include <sys/select.h>
14 static pthread_mutex_t mutex
= PTHREAD_MUTEX_INITIALIZER
;
15 static pthread_cond_t cond
= PTHREAD_COND_INITIALIZER
;
20 pthread_mutex_lock(&mutex
);
22 pthread_cond_signal(&cond
);
23 pthread_mutex_unlock(&mutex
);
28 struct timespec ts
= {10000, 0};
29 pselect(0, NULL
, NULL
, NULL
, &ts
, &ss
);
39 int ret
= pthread_create(&thr
, NULL
, mythr
, NULL
);
41 fprintf(stderr
, "pthread_create failed\n");
45 pthread_mutex_lock(&mutex
);
47 pthread_cond_wait(&cond
, &mutex
);
49 pthread_mutex_unlock(&mutex
);
51 #if defined(VGO_linux)
52 assert(pselect(0, NULL
, NULL
, NULL
, NULL
, (sigset_t
*)12) == -1);
53 assert(errno
== EFAULT
);
56 alarm(1); /* Unhandled SIGALRM should cause exit. */