[CRIU] [PATCH 10/14] check: check that signalfd with SFD_RAW and sigqueueinfo with positive si_code
Andrey Vagin
avagin at openvz.org
Thu Jan 17 09:38:34 EST 2013
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
cr-check.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/cr-check.c b/cr-check.c
index db3bff6..384923b 100644
--- a/cr-check.c
+++ b/cr-check.c
@@ -22,6 +22,7 @@
#include "proc_parse.h"
#include "mount.h"
#include "tty.h"
+#include "signalfd.h"
static int check_tty(void)
{
@@ -425,6 +426,35 @@ static int check_ipc(void)
return -1;
}
+int check_signalfd()
+{
+ int fd;
+ sigset_t mask;
+ sigfillset(&mask);
+
+ fd = signalfd(-1, &mask, SFD_RAW);
+ if (fd < 0) {
+ pr_perror("Can't make signalfd with SFD_GROUP and SFD_RAW");
+ return 1;
+ }
+ close(fd);
+ return 0;
+}
+
+int check_sigqueuinfo()
+{
+ siginfo_t info = { .si_code = 1 };
+
+ signal(SIGUSR1, SIG_IGN);
+
+ if (sys_rt_sigqueueinfo(getpid(), SIGUSR1, &info)) {
+ pr_perror("Unable to send siginfo with positive si_code to itself");
+ return 1;
+ }
+
+ return 0;
+}
+
int cr_check(void)
{
int ret = 0;
@@ -450,6 +480,8 @@ int cr_check(void)
ret |= check_tty();
ret |= check_so_gets();
ret |= check_ipc();
+ ret |= check_signalfd();
+ ret |= check_sigqueuinfo();
if (!ret)
pr_msg("Looks good.\n");
--
1.7.11.7
More information about the CRIU
mailing list