[CRIU] [PATCH 7/7] check: check that signalfd with SFD_RAW and sigqueueinfo with positive si_code
Andrey Vagin
avagin at openvz.org
Tue Dec 4 04:50:31 EST 2012
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 32ac164..e631387 100644
--- a/cr-check.c
+++ b/cr-check.c
@@ -21,6 +21,7 @@
#include "proc_parse.h"
#include "mount.h"
#include "tty.h"
+#include "signalfd.h"
static int check_tty(void)
{
@@ -405,6 +406,35 @@ static int check_so_get_filter(void)
return 0;
}
+int check_signalfd()
+{
+ int fd;
+ sigset_t mask;
+ sigfillset(&mask);
+
+ fd = signalfd(-1, &mask, SFD_GROUP | 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;
@@ -429,6 +459,8 @@ int cr_check(void)
ret |= check_unaligned_vmsplice();
ret |= check_tty();
ret |= check_so_get_filter();
+ ret |= check_signalfd();
+ ret |= check_sigqueuinfo();
if (!ret)
pr_msg("Looks good.\n");
--
1.7.11.7
More information about the CRIU
mailing list