From: "Christoph Böhmwalder" <christoph.boehmwalder@linbit.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Philipp Reisner <philipp.reisner@linbit.com>,
David Laight <David.Laight@aculab.com>,
Jens Axboe <axboe@kernel.dk>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
Steve French <smfrench@gmail.com>,
ronnie sahlberg <ronniesahlberg@gmail.com>,
Jeff Layton <jlayton@primarydata.com>,
linux-cifs <linux-cifs@vger.kernel.org>
Subject: Re: [PATCH] signal: Allow cifs and drbd to receive their terminating signals
Date: Mon, 19 Aug 2019 10:37:59 +0200 [thread overview]
Message-ID: <20190819083759.73ee5zct4yxbyyfd@gintonic.linbit> (raw)
In-Reply-To: <87k1bclpmt.fsf_-_@xmission.com>
On Fri, Aug 16, 2019 at 05:19:38PM -0500, Eric W. Biederman wrote:
>
> My recent to change to only use force_sig for a synchronous events
> wound up breaking signal reception cifs and drbd. I had overlooked
> the fact that by default kthreads start out with all signals set to
> SIG_IGN. So a change I thought was safe turned out to have made it
> impossible for those kernel thread to catch their signals.
>
> Reverting the work on force_sig is a bad idea because what the code
> was doing was very much a misuse of force_sig. As the way force_sig
> ultimately allowed the signal to happen was to change the signal
> handler to SIG_DFL. Which after the first signal will allow userspace
> to send signals to these kernel threads. At least for
> wake_ack_receiver in drbd that does not appear actively wrong.
>
> So correct this problem by adding allow_kernel_signal that will allow
> signals whose siginfo reports they were sent by the kernel through,
> but will not allow userspace generated signals, and update cifs and
> drbd to call allow_kernel_signal in an appropriate place so that their
> thread can receive this signal.
>
> Fixing things this way ensures that userspace won't be able to send
> signals and cause problems, that it is clear which signals the
> threads are expecting to receive, and it guarantees that nothing
> else in the system will be affected.
>
> This change was partly inspired by similar cifs and drbd patches that
> added allow_signal.
>
> Reported-by: ronnie sahlberg <ronniesahlberg@gmail.com>
> Reported-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
> Cc: Steve French <smfrench@gmail.com>
> Cc: Philipp Reisner <philipp.reisner@linbit.com>
> Cc: David Laight <David.Laight@ACULAB.COM>
> Fixes: 247bc9470b1e ("cifs: fix rmmod regression in cifs.ko caused by force_sig changes")
> Fixes: 72abe3bcf091 ("signal/cifs: Fix cifs_put_tcp_session to call send_sig instead of force_sig")
> Fixes: fee109901f39 ("signal/drbd: Use send_sig not force_sig")
> Fixes: 3cf5d076fb4d ("signal: Remove task parameter from force_sig")
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
> ---
> drivers/block/drbd/drbd_main.c | 2 ++
> fs/cifs/connect.c | 2 +-
> include/linux/signal.h | 15 ++++++++++++++-
> kernel/signal.c | 5 +++++
> 4 files changed, 22 insertions(+), 2 deletions(-)
>
Just tested this patch, and I can confirm that it makes DRBD work as
intended again.
Tested-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running
DRBD HA — Disaster Recovery — Software defined Storage
next prev parent reply other threads:[~2019-08-19 8:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190729083248.30362-1-christoph.boehmwalder@linbit.com>
[not found] ` <1761552.9xIroHqhk7@fat-tyre>
[not found] ` <1fcbb94c5f264c17af3394807438ad50@AcuMS.aculab.com>
[not found] ` <2789113.VEJ2NpTmzX@fat-tyre>
2019-08-16 22:19 ` [PATCH] signal: Allow cifs and drbd to receive their terminating signals Eric W. Biederman
2019-08-19 8:37 ` Christoph Böhmwalder [this message]
2019-08-19 22:03 ` [GIT PULL] " Eric W. Biederman
2019-08-19 23:35 ` pr-tracker-bot
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=20190819083759.73ee5zct4yxbyyfd@gintonic.linbit \
--to=christoph.boehmwalder@linbit.com \
--cc=David.Laight@aculab.com \
--cc=axboe@kernel.dk \
--cc=ebiederm@xmission.com \
--cc=jlayton@primarydata.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=philipp.reisner@linbit.com \
--cc=ronniesahlberg@gmail.com \
--cc=smfrench@gmail.com \
--cc=stable@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).