All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Walt Drummond <walt@drummond.us>,
	aacraid@microsemi.com, viro@zeniv.linux.org.uk,
	anna.schumaker@netapp.com, arnd@arndb.de, bsegall@google.com,
	bp@alien8.de, chuck.lever@oracle.com, bristot@redhat.com,
	dave.hansen@linux.intel.com, dwmw2@infradead.org,
	dietmar.eggemann@arm.com, dinguyen@kernel.org,
	geert@linux-m68k.org, gregkh@linuxfoundation.org, hpa@zytor.com,
	idryomov@gmail.com, mingo@redhat.com, yzaikin@google.com,
	ink@jurassic.park.msu.ru, jejb@linux.ibm.com, jmorris@namei.org,
	bfields@fieldses.org, jlayton@kernel.org, jirislaby@kernel.org,
	john.johansen@canonical.com, juri.lelli@redhat.com,
	keescook@chromium.org, mcgrof@kernel.org,
	martin.petersen@oracle.com, mattst88@gmail.com, mgorman@suse.de,
	oleg@redhat.com, pbonzini@redhat.com, peterz@infradead.org,
	rth@twiddle.net, richard@nod.at, serge@hallyn.com,
	rostedt@goodmis.org, tglx@linutronix.de,
	trond.myklebust@hammerspace.com, vincent.guittot@linaro.org,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	ceph-devel@vger.kernel.org, kvm@vger.kernel.org,
	linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-m68k@vger.kernel.org,
	linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org,
	linux-scsi@vger.kernel.org,
	linux-security-module@vger.kernel.org
Subject: Re: [RFC PATCH 0/8] signals: Support more than 64 signals
Date: Tue, 04 Jan 2022 16:05:26 -0600	[thread overview]
Message-ID: <87pmp79mxl.fsf@email.froward.int.ebiederm.org> (raw)
In-Reply-To: <YdSzjPbVDVGKT4km@mit.edu> (Theodore Ts'o's message of "Tue, 4 Jan 2022 15:52:28 -0500")

"Theodore Ts'o" <tytso@mit.edu> writes:

> On Tue, Jan 04, 2022 at 12:00:34PM -0600, Eric W. Biederman wrote:
>> I dug through the previous conversations and there is a little debate
>> about what makes sense for SIGPWR to do by default.  Alan Cox remembered
>> SIGPWR was sent when the power was restored, so ignoring SIGPWR by
>> default made sense.  Ted Tso pointed out a different scenario where it
>> was reasonable for SIGPWR to be a terminating signal.
>> 
>> So far no one has actually found any applications that will regress if
>> SIGPWR becomes ignored by default.  Furthermore on linux SIGPWR is only
>> defined to be sent to init, and init ignores all signals by default so
>> in practice SIGPWR is ignored by the only process that receives it
>> currently.
>
> As it turns out, systemd does *not* ignore SIGPWR.  Instead, it will
> initiate the sigpwr target.  From the systemd.special man page:
>
>        sigpwr.target
>            A special target that is started when systemd receives the
>            SIGPWR process signal, which is normally sent by the kernel
>            or UPS daemons when power fails.
>
> And child processes of systemd are not ignoring SIGPWR.  Instead, they
> are getting terminated.
>
> <tytso@cwcc>
> 41% /bin/sleep 50 &
> [1] 180671
> <tytso@cwcc>
> 42% kill -PWR 180671
> [1]+  Power failure           /bin/sleep 50


That is all as expected, and does not demonstrate a regression would
happen if SIGPWR were to treat SIG_DFL as SIG_IGN, as SIGWINCH, SIGCONT,
SIGCHLD, SIGURG do.  It does show there is the possibility of problems.

The practical question is does anything send SIGPWR to anything besides
init, and expect the process to handle SIGPWR or terminate?

Possibly easier to implement (if people desire) is to simply send
SIGCONT with an si_code that indicates someone pressed the VSTATUS
key.  We have a per signal 32bit si_code space so that should
be comparatively easy.

> I claim, though, that we could implement VSTATUS without implenting
> the SIGINFO part of the feature.

I agree that is the place to start.  And if we aren't going to use
SIGINFO perhaps we could have an equally good notification method
if anyone wants one.  Say call an ioctl and get an fd that can
be read when a VSTATUS request comes in.

SIGINFO vs SIGCONT vs a fd vs something else is something we can sort
out when people get interested in modifying userspace.

Eric

WARNING: multiple messages have this Message-ID (diff)
From: ebiederm@xmission.com (Eric W. Biederman)
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Walt Drummond <walt@drummond.us>,
	 aacraid@microsemi.com, viro@zeniv.linux.org.uk,
	 anna.schumaker@netapp.com,  arnd@arndb.de, bsegall@google.com,
	 bp@alien8.de,  chuck.lever@oracle.com, bristot@redhat.com,
	 dave.hansen@linux.intel.com,  dwmw2@infradead.org,
	dietmar.eggemann@arm.com,  dinguyen@kernel.org,
	 geert@linux-m68k.org, gregkh@linuxfoundation.org,
	 hpa@zytor.com,  idryomov@gmail.com, mingo@redhat.com,
	 yzaikin@google.com,  ink@jurassic.park.msu.ru,
	jejb@linux.ibm.com,  jmorris@namei.org,  bfields@fieldses.org,
	jlayton@kernel.org,  jirislaby@kernel.org,
	 john.johansen@canonical.com, juri.lelli@redhat.com,
	 keescook@chromium.org,  mcgrof@kernel.org,
	martin.petersen@oracle.com,  mattst88@gmail.com,
	 mgorman@suse.de, oleg@redhat.com,  pbonzini@redhat.com,
	 peterz@infradead.org, rth@twiddle.net,  richard@nod.at,
	 serge@hallyn.com, rostedt@goodmis.org,  tglx@linutronix.de,
	trond.myklebust@hammerspace.com,  vincent.guittot@linaro.org,
	x86@kernel.org,  linux-kernel@vger.kernel.org,
	ceph-devel@vger.kernel.org,  kvm@vger.kernel.org,
	linux-alpha@vger.kernel.org,  linux-arch@vger.kernel.org,
	linux-fsdevel@vger.kernel.org,  linux-m68k@vger.kernel.org,
	linux-mtd@lists.infradead.org,  linux-nfs@vger.kernel.org,
	linux-scsi@vger.kernel.org,
	 linux-security-module@vger.kernel.org
Subject: Re: [RFC PATCH 0/8] signals: Support more than 64 signals
Date: Tue, 04 Jan 2022 16:05:26 -0600	[thread overview]
Message-ID: <87pmp79mxl.fsf@email.froward.int.ebiederm.org> (raw)
In-Reply-To: <YdSzjPbVDVGKT4km@mit.edu> (Theodore Ts'o's message of "Tue, 4 Jan 2022 15:52:28 -0500")

"Theodore Ts'o" <tytso@mit.edu> writes:

> On Tue, Jan 04, 2022 at 12:00:34PM -0600, Eric W. Biederman wrote:
>> I dug through the previous conversations and there is a little debate
>> about what makes sense for SIGPWR to do by default.  Alan Cox remembered
>> SIGPWR was sent when the power was restored, so ignoring SIGPWR by
>> default made sense.  Ted Tso pointed out a different scenario where it
>> was reasonable for SIGPWR to be a terminating signal.
>> 
>> So far no one has actually found any applications that will regress if
>> SIGPWR becomes ignored by default.  Furthermore on linux SIGPWR is only
>> defined to be sent to init, and init ignores all signals by default so
>> in practice SIGPWR is ignored by the only process that receives it
>> currently.
>
> As it turns out, systemd does *not* ignore SIGPWR.  Instead, it will
> initiate the sigpwr target.  From the systemd.special man page:
>
>        sigpwr.target
>            A special target that is started when systemd receives the
>            SIGPWR process signal, which is normally sent by the kernel
>            or UPS daemons when power fails.
>
> And child processes of systemd are not ignoring SIGPWR.  Instead, they
> are getting terminated.
>
> <tytso@cwcc>
> 41% /bin/sleep 50 &
> [1] 180671
> <tytso@cwcc>
> 42% kill -PWR 180671
> [1]+  Power failure           /bin/sleep 50


That is all as expected, and does not demonstrate a regression would
happen if SIGPWR were to treat SIG_DFL as SIG_IGN, as SIGWINCH, SIGCONT,
SIGCHLD, SIGURG do.  It does show there is the possibility of problems.

The practical question is does anything send SIGPWR to anything besides
init, and expect the process to handle SIGPWR or terminate?

Possibly easier to implement (if people desire) is to simply send
SIGCONT with an si_code that indicates someone pressed the VSTATUS
key.  We have a per signal 32bit si_code space so that should
be comparatively easy.

> I claim, though, that we could implement VSTATUS without implenting
> the SIGINFO part of the feature.

I agree that is the place to start.  And if we aren't going to use
SIGINFO perhaps we could have an equally good notification method
if anyone wants one.  Say call an ioctl and get an fd that can
be read when a VSTATUS request comes in.

SIGINFO vs SIGCONT vs a fd vs something else is something we can sort
out when people get interested in modifying userspace.

Eric

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: ebiederm@xmission.com (Eric W. Biederman)
To: Theodore Ts'o <tytso@mit.edu>
Cc: Walt Drummond <walt@drummond.us>,
	aacraid@microsemi.com, viro@zeniv.linux.org.uk,
	anna.schumaker@netapp.com, arnd@arndb.de, bsegall@google.com,
	bp@alien8.de, chuck.lever@oracle.com, bristot@redhat.com,
	dave.hansen@linux.intel.com, dwmw2@infradead.org,
	dietmar.eggemann@arm.com, dinguyen@kernel.org,
	geert@linux-m68k.org, gregkh@linuxfoundation.org, hpa@zytor.com,
	idryomov@gmail.com, mingo@redhat.com, yzaikin@google.com,
	ink@jurassic.park.msu.ru, jejb@linux.ibm.com, jmorris@namei.org,
	bfields@fieldses.org, jlayton@kernel.org, jirislaby@kernel.org,
	john.johansen@canonical.com, juri.lelli@redhat.com,
	keescook@chromium.org, mcgrof@kernel.org,
	martin.petersen@oracle.com, mattst88@gmail.com, mgorman@suse.de,
	oleg@redhat.com, pbonzini@redhat.com, peterz@infradead.org,
	rth@twiddle.net, richa
Subject: Re: [RFC PATCH 0/8] signals: Support more than 64 signals
Date: Tue, 04 Jan 2022 16:05:26 -0600	[thread overview]
Message-ID: <87pmp79mxl.fsf@email.froward.int.ebiederm.org> (raw)
In-Reply-To: <YdSzjPbVDVGKT4km@mit.edu> (Theodore Ts'o's message of "Tue, 4 Jan 2022 15:52:28 -0500")

"Theodore Ts'o" <tytso@mit.edu> writes:

> On Tue, Jan 04, 2022 at 12:00:34PM -0600, Eric W. Biederman wrote:
>> I dug through the previous conversations and there is a little debate
>> about what makes sense for SIGPWR to do by default.  Alan Cox remembered
>> SIGPWR was sent when the power was restored, so ignoring SIGPWR by
>> default made sense.  Ted Tso pointed out a different scenario where it
>> was reasonable for SIGPWR to be a terminating signal.
>> 
>> So far no one has actually found any applications that will regress if
>> SIGPWR becomes ignored by default.  Furthermore on linux SIGPWR is only
>> defined to be sent to init, and init ignores all signals by default so
>> in practice SIGPWR is ignored by the only process that receives it
>> currently.
>
> As it turns out, systemd does *not* ignore SIGPWR.  Instead, it will
> initiate the sigpwr target.  From the systemd.special man page:
>
>        sigpwr.target
>            A special target that is started when systemd receives the
>            SIGPWR process signal, which is normally sent by the kernel
>            or UPS daemons when power fails.
>
> And child processes of systemd are not ignoring SIGPWR.  Instead, they
> are getting terminated.
>
> <tytso@cwcc>
> 41% /bin/sleep 50 &
> [1] 180671
> <tytso@cwcc>
> 42% kill -PWR 180671
> [1]+  Power failure           /bin/sleep 50


That is all as expected, and does not demonstrate a regression would
happen if SIGPWR were to treat SIG_DFL as SIG_IGN, as SIGWINCH, SIGCONT,
SIGCHLD, SIGURG do.  It does show there is the possibility of problems.

The practical question is does anything send SIGPWR to anything besides
init, and expect the process to handle SIGPWR or terminate?

Possibly easier to implement (if people desire) is to simply send
SIGCONT with an si_code that indicates someone pressed the VSTATUS
key.  We have a per signal 32bit si_code space so that should
be comparatively easy.

> I claim, though, that we could implement VSTATUS without implenting
> the SIGINFO part of the feature.

I agree that is the place to start.  And if we aren't going to use
SIGINFO perhaps we could have an equally good notification method
if anyone wants one.  Say call an ioctl and get an fd that can
be read when a VSTATUS request comes in.

SIGINFO vs SIGCONT vs a fd vs something else is something we can sort
out when people get interested in modifying userspace.

Eric

  parent reply	other threads:[~2022-01-04 22:06 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-03 18:19 [RFC PATCH 0/8] signals: Support more than 64 signals Walt Drummond
2022-01-03 18:19 ` Walt Drummond
2022-01-03 18:19 ` Walt Drummond
2022-01-03 18:19 ` [RFC PATCH 1/8] signals: Make the real-time signal system calls accept different sized sigset_t from user space Walt Drummond
2022-01-03 18:19 ` [RFC PATCH 2/8] signals: Put the full signal mask on the signal stack for x86_64, X32 and ia32 compatibility mode Walt Drummond
2022-01-03 18:19 ` [RFC PATCH 3/8] signals: Use a helper function to test if a signal is a real-time signal Walt Drummond
2022-01-03 18:19 ` [RFC PATCH 4/8] signals: Remove sigmask() macro Walt Drummond
2022-01-03 18:19   ` Walt Drummond
2022-01-03 18:19   ` Walt Drummond
2022-01-03 18:19 ` [RFC PATCH 5/8] signals: Better support cases where _NSIG_WORDS is greater than 2 Walt Drummond
2022-01-03 18:19 ` [RFC PATCH 6/8] signals: Round up _NSIG_WORDS Walt Drummond
2022-01-03 18:19 ` [RFC PATCH 7/8] signals: Add signal debugging Walt Drummond
2022-01-03 18:19 ` [RFC PATCH 8/8] signals: Support BSD VSTATUS, KERNINFO and SIGINFO Walt Drummond
2022-01-04  7:27   ` Greg Kroah-Hartman
2022-01-07 21:48   ` Arseny Maslennikov
2022-01-07 21:52     ` Walt Drummond
2022-01-07 22:39       ` Arseny Maslennikov
2022-01-08 14:38   ` Arseny Maslennikov
2022-01-03 18:48 ` [RFC PATCH 0/8] signals: Support more than 64 signals Al Viro
2022-01-03 18:48   ` Al Viro
2022-01-03 18:48   ` Al Viro
2022-01-04  1:00   ` Walt Drummond
2022-01-04  1:00     ` Walt Drummond
2022-01-04  1:00     ` Walt Drummond
2022-01-04  1:16     ` Al Viro
2022-01-04  1:16       ` Al Viro
2022-01-04  1:16       ` Al Viro
2022-01-04  1:49       ` Al Viro
2022-01-04  1:49         ` Al Viro
2022-01-04  1:49         ` Al Viro
2022-01-04 18:00 ` Eric W. Biederman
2022-01-04 18:00   ` Eric W. Biederman
2022-01-04 18:00   ` Eric W. Biederman
2022-01-04 20:52   ` Theodore Ts'o
2022-01-04 20:52     ` Theodore Ts'o
2022-01-04 20:52     ` Theodore Ts'o
2022-01-04 21:33     ` Walt Drummond
2022-01-04 21:33       ` Walt Drummond
2022-01-04 21:33       ` Walt Drummond
2022-01-04 22:05     ` Eric W. Biederman [this message]
2022-01-04 22:05       ` Eric W. Biederman
2022-01-04 22:05       ` Eric W. Biederman
2022-01-04 22:23       ` Theodore Ts'o
2022-01-04 22:23         ` Theodore Ts'o
2022-01-04 22:23         ` Theodore Ts'o
2022-01-04 22:31         ` Walt Drummond
2022-01-04 22:31           ` Walt Drummond
2022-01-04 22:31           ` Walt Drummond
2022-01-07 19:29           ` Arseny Maslennikov
2022-01-07 19:29             ` Arseny Maslennikov
2022-01-07 19:29             ` Arseny Maslennikov
2022-05-19 12:27             ` Pavel Machek
2022-05-19 12:27               ` Pavel Machek
2022-05-19 12:27               ` Pavel Machek
2022-01-07 19:19     ` Arseny Maslennikov
2022-01-07 19:19       ` Arseny Maslennikov
2022-01-07 19:19       ` Arseny Maslennikov

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=87pmp79mxl.fsf@email.froward.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=aacraid@microsemi.com \
    --cc=anna.schumaker@netapp.com \
    --cc=arnd@arndb.de \
    --cc=bfields@fieldses.org \
    --cc=bp@alien8.de \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=dinguyen@kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=idryomov@gmail.com \
    --cc=ink@jurassic.park.msu.ru \
    --cc=jejb@linux.ibm.com \
    --cc=jirislaby@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=jmorris@namei.org \
    --cc=john.johansen@canonical.com \
    --cc=juri.lelli@redhat.com \
    --cc=keescook@chromium.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mattst88@gmail.com \
    --cc=mcgrof@kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=richard@nod.at \
    --cc=rostedt@goodmis.org \
    --cc=rth@twiddle.net \
    --cc=serge@hallyn.com \
    --cc=tglx@linutronix.de \
    --cc=trond.myklebust@hammerspace.com \
    --cc=tytso@mit.edu \
    --cc=vincent.guittot@linaro.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=walt@drummond.us \
    --cc=x86@kernel.org \
    --cc=yzaikin@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.