[lkml]   [2018]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2 1/2] livepatch: Initialize shadow variables safely by a custom callback
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


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


 \ /
  Last update: 2018-04-11 11:30    [W:0.085 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site