mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miroslav Benes <mbenes@suse.cz>
To: Petr Mladek <pmladek@suse.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	Jessica Yu <jeyu@kernel.org>, Nicolai Stange <nstange@suse.de>,
	live-patching@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] livepatch: Initialize shadow variables safely by a custom callback
Date: Wed, 11 Apr 2018 11:29:56 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LSU.2.21.1804111030120.28885@pobox.suse.cz> (raw)
In-Reply-To: <20180405122315.29065-2-pmladek@suse.com>

On Thu, 5 Apr 2018, Petr Mladek wrote:

> The existing API allows to pass a sample data to initialize the shadow
> data. It works well when the data are position independent. But it fails
> miserably when we need to set a pointer to the shadow structure itself.
> 
> Unfortunately, we might need to initialize the pointer surprisingly
> often because of struct list_head. It is even worse because the list
> might be hidden in other common structures, for example, struct mutex,
> struct wait_queue_head.
> 
> For example, this was needed to fix races in ALSA sequncer. It required

s/sequncer/sequencer/

> to add mutex into struct snd_seq_client. See commit b3defb791b26ea06
> ("ALSA: seq: Make ioctls race-free") and commit d15d662e89fc667b9
> ("ALSA: seq: Fix racy pool initializations")
> 
> This patch makes the API more safe. A custom constructor function and data
> are passed to klp_shadow_*alloc() functions instead of the sample data.
> 
> Note that ctor_data are not longer a template for shadow->data. It might

s/not longer/no longer/

> point to any data that might be necessary when the constructor is called.

Miroslav

  parent reply	other threads:[~2018-04-11  9:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05 12:23 [PATCH v2 0/2] livepatch: Allocate and free shadow variables more safely Petr Mladek
2018-04-05 12:23 ` [PATCH v2 1/2] livepatch: Initialize shadow variables safely by a custom callback Petr Mladek
2018-04-06 22:34   ` Josh Poimboeuf
2018-04-10 11:33     ` Petr Mladek
2018-04-11  9:29   ` Miroslav Benes [this message]
2018-04-05 12:23 ` [PATCH v2 2/2] livepatch: Allow to call a custom callback when freeing shadow variables Petr Mladek

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=alpine.LSU.2.21.1804111030120.28885@pobox.suse.cz \
    --to=mbenes@suse.cz \
    --cc=jeyu@kernel.org \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=nstange@suse.de \
    --cc=pmladek@suse.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 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®