On 6/30/24 20:48, Oleg Nesterov wrote:
I see nothing wrong, but perhaps this test can be simplified? Feel free to ignore. Say, On 06/27, Dev Jain wrote:+void handler_usr(int signo, siginfo_t *info, void *uc) +{ + int ret; + + /* + * Break out of infinite recursion caused by raise(SIGUSR1) invoked + * from inside the handler + */ + ++cnt; + if (cnt > 1) + return; + + ksft_print_msg("In handler_usr\n"); + + /* SEGV blocked during handler execution, delivered on return */ + if (raise(SIGSEGV)) + ksft_exit_fail_perror("raise"); + + ksft_print_msg("SEGV bypassed successfully\n");You could simply do sigprocmask(SIG_SETMASK, NULL, &oldset) and check if SIGSEGV is blocked in oldset. SIG_SETMASK has no effect if newset == NULL.
IMHO, isn't raising the signal, and the process not terminating, a stricter test? I have already included your described approach in
the last testcase; so, the test includes both ways: raising the signal -> process not terminating, and checking blockage with sigprocmask().
