linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Miroslav Benes <mbenes@suse.cz>
Cc: jeyu@kernel.org, jikos@kernel.org, pmladek@suse.com,
	lpechacek@suse.cz, pavel@ucw.cz, live-patching@vger.kernel.org,
	linux-kernel@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>,
	linuxppc-dev@lists.ozlabs.org, x86@kernel.org
Subject: Re: [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks
Date: Thu, 2 Nov 2017 08:32:00 -0500	[thread overview]
Message-ID: <20171102133200.abwvepjx3ytufsc4@treble> (raw)
In-Reply-To: <20171031114853.841-2-mbenes@suse.cz>

On Tue, Oct 31, 2017 at 12:48:52PM +0100, Miroslav Benes wrote:
> diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
> index bf8c8fd72589..b7c60662baf3 100644
> --- a/kernel/livepatch/core.c
> +++ b/kernel/livepatch/core.c
> @@ -440,6 +440,7 @@ EXPORT_SYMBOL_GPL(klp_enable_patch);
>   * /sys/kernel/livepatch/<patch>
>   * /sys/kernel/livepatch/<patch>/enabled
>   * /sys/kernel/livepatch/<patch>/transition
> + * /sys/kernel/livepatch/<patch>/signal
>   * /sys/kernel/livepatch/<patch>/<object>
>   * /sys/kernel/livepatch/<patch>/<object>/<function,sympos>
>   */
> @@ -514,11 +515,37 @@ static ssize_t transition_show(struct kobject *kobj,
>  			patch == klp_transition_patch);
>  }
>  
> +static ssize_t signal_store(struct kobject *kobj, struct kobj_attribute *attr,
> +			    const char *buf, size_t count)
> +{
> +	int ret;
> +	bool val;
> +
> +	/*
> +	 * klp_mutex lock is not grabbed here intentionally. It is not really
> +	 * needed. The race window is harmless and grabbing the lock would only
> +	 * hold the action back.
> +	 */
> +	if (!klp_transition_patch)
> +		return -EINVAL;
> +
> +	ret = kstrtobool(buf, &val);
> +	if (ret)
> +		return ret;
> +
> +	if (val)
> +		klp_force_signals();
> +
> +	return count;
> +}

The function still has global functionality even though the sysfs entry
is now per-patch.  So if you do

  echo 1 > /sys/kernel/livepatch/patch1/signal

But patch2 is in transition, then it will send signals based on patch2.
Instead it should probably return an error.

There's a similar issue with force_store().

-- 
Josh

  parent reply	other threads:[~2017-11-02 13:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31 11:48 [PATCH v3 0/2] livepatch: Introduce signal and force sysfs attributes Miroslav Benes
2017-10-31 11:48 ` [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks Miroslav Benes
2017-11-01 15:06   ` Miroslav Benes
2017-11-01 15:13   ` Petr Mladek
2017-11-01 16:43     ` Oleg Nesterov
2017-11-02 10:36       ` Miroslav Benes
2017-11-02 14:08         ` Oleg Nesterov
2017-11-02 13:09   ` Josh Poimboeuf
2017-11-03  8:02     ` Miroslav Benes
2017-11-03 12:57       ` Josh Poimboeuf
2017-11-02 13:32   ` Josh Poimboeuf [this message]
2017-11-03  8:06     ` Miroslav Benes
2017-11-06 11:08   ` Pavel Machek
2017-10-31 11:48 ` [PATCH v3 2/2] livepatch: force transition process to finish Miroslav Benes
2017-11-01 15:32   ` Petr Mladek
2017-11-02 13:13   ` Josh Poimboeuf
2017-11-03  8:07     ` Miroslav Benes
2017-11-06 11:11   ` Pavel Machek
2017-11-06 12:03     ` Jiri Kosina
2017-11-09 11:14       ` Pavel Machek

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=20171102133200.abwvepjx3ytufsc4@treble \
    --to=jpoimboe@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jeyu@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=live-patching@vger.kernel.org \
    --cc=lpechacek@suse.cz \
    --cc=luto@kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=oleg@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=pmladek@suse.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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).