mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Dev Jain <dev.jain@arm.com>, Oleg Nesterov <oleg@redhat.com>
Cc: shuah@kernel.org, mingo@kernel.org, tglx@linutronix.de,
	mark.rutland@arm.com, ryan.roberts@arm.com, broonie@kernel.org,
	suzuki.poulose@arm.com, Anshuman.Khandual@arm.com,
	DeepakKumar.Mishra@arm.com, aneesh.kumar@kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v4 2/2] selftests: Add a test mangling with uc_sigmask
Date: Mon, 22 Jul 2024 08:58:51 -0600	[thread overview]
Message-ID: <abd97c85-c9d9-43c9-b0c2-36f6f0e442e0@linuxfoundation.org> (raw)
In-Reply-To: <09370b2d-2b52-4133-8e0d-83e66b801ff8@arm.com>

On 7/15/24 05:49, Dev Jain wrote:
> 
> 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");

This message isn't very useful. Why do you need this message?

>>> +
>>> +    /* 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().

thanks,
-- Shuah


  reply	other threads:[~2024-07-22 14:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27  3:52 [PATCH v4 0/2] Add test to distinguish between thread's signal mask and ucontext_t Dev Jain
2024-06-27  3:52 ` [PATCH v4 1/2] selftests: Rename sigaltstack to generic signal Dev Jain
2024-06-27  3:52 ` [PATCH v4 2/2] selftests: Add a test mangling with uc_sigmask Dev Jain
2024-06-27 16:20   ` Mark Brown
2024-06-30 15:18   ` Oleg Nesterov
2024-07-15 11:49     ` Dev Jain
2024-07-22 14:58       ` Shuah Khan [this message]
2024-07-23  4:30         ` Dev Jain
2024-07-23 15:55           ` Shuah Khan
2024-07-16  9:44 ` [PATCH v4 0/2] Add test to distinguish between thread's signal mask and ucontext_t Dev Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=abd97c85-c9d9-43c9-b0c2-36f6f0e442e0@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=Anshuman.Khandual@arm.com \
    --cc=DeepakKumar.Mishra@arm.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=broonie@kernel.org \
    --cc=dev.jain@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=ryan.roberts@arm.com \
    --cc=shuah@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®