mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: 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
Subject: Re: [PATCH v4 2/2] selftests: Add a test mangling with uc_sigmask
Date: Mon, 15 Jul 2024 17:19:03 +0530	[thread overview]
Message-ID: <09370b2d-2b52-4133-8e0d-83e66b801ff8@arm.com> (raw)
In-Reply-To: <20240630151808.GA13321@redhat.com>


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().

  reply	other threads:[~2024-07-15 11:49 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 [this message]
2024-07-22 14:58       ` Shuah Khan
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=09370b2d-2b52-4133-8e0d-83e66b801ff8@arm.com \
    --to=dev.jain@arm.com \
    --cc=Anshuman.Khandual@arm.com \
    --cc=DeepakKumar.Mishra@arm.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=broonie@kernel.org \
    --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®