lkml.org 
[lkml]   [2017]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] livepatch: add locking to force and signal functions
On Thu 2017-12-21 14:40:43, Miroslav Benes wrote:
> klp_send_signals() and klp_force_transition() do not acquire klp_mutex,
> because it seemed to be superfluous. A potential race in
> klp_send_signals() was harmless and there was nothing in
> klp_force_transition() which needed to be synchronized. That changed
> with the addition of klp_forced variable during the review process.
>
> There is a small window now, when klp_complete_transition() does not see
> klp_forced set to true while all tasks have been already transitioned to
> the target state. module_put() is called and the module can be removed.
>
> Acquire klp_mutex in sysfs callback to prevent it. Do the same for the
> signal sending just to be sure. There is no real downside to that.
>
> Reported-by: Jason Baron <jbaron@akamai.com>
> Signed-off-by: Miroslav Benes <mbenes@suse.cz>

Looks good to me.

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

\
 
 \ /
  Last update: 2017-12-21 16:21    [W:0.095 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site