lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54E1C36B.5020907@suse.cz>
Date:	Mon, 16 Feb 2015 11:16:11 +0100
From:	Jiri Slaby <jslaby@...e.cz>
To:	Josh Poimboeuf <jpoimboe@...hat.com>,
	Seth Jennings <sjenning@...hat.com>,
	Jiri Kosina <jkosina@...e.cz>, Vojtech Pavlik <vojtech@...e.cz>
CC:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 9/9] livepatch: update task universe when exiting
 kernel

On 02/09/2015, 06:31 PM, Josh Poimboeuf wrote:
> Update a tasks's universe when returning from a system call or user
> space interrupt, or after handling a signal.
> 
> This greatly increases the chances of a patch operation succeeding.  If
> a task is I/O bound, it can switch universes when returning from a
> system call.  If a task is CPU bound, it can switch universes when
> returning from an interrupt.  If a task is sleeping on a to-be-patched
> function, the user can send SIGSTOP and SIGCONT to force it to switch.
> 
> Since the idle "swapper" tasks don't ever exit the kernel, they're
> updated from within the idle loop.
> 
> Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
> ---
>  arch/x86/include/asm/thread_info.h |  4 +++-
>  arch/x86/kernel/signal.c           |  4 ++++
>  include/linux/livepatch.h          |  2 ++
>  kernel/livepatch/transition.c      | 15 +++++++++++++++
>  kernel/sched/idle.c                |  4 ++++
...
> --- a/kernel/sched/idle.c
> +++ b/kernel/sched/idle.c
> @@ -7,6 +7,7 @@
>  #include <linux/tick.h>
>  #include <linux/mm.h>
>  #include <linux/stackprotector.h>
> +#include <linux/livepatch.h>
>  
>  #include <asm/tlb.h>
>  
> @@ -250,6 +251,9 @@ static void cpu_idle_loop(void)
>  
>  		sched_ttwu_pending();
>  		schedule_preempt_disabled();
> +
> +		if (unlikely(test_thread_flag(TIF_KLP_NEED_UPDATE)))
> +			klp_update_task_universe(current);

Oh, this is indeed broken on non-x86 archs as kbuild reports.
(TIF_KLP_NEED_UPDATE undefined)

We need a klp_maybe_update_task_universe inline or something like that
and define it void for non-LIVEPATCH configs.

regards,
-- 
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ