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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 9 Dec 2022 10:41:55 +0100
From:   Ard Biesheuvel <ardb@...nel.org>
To:     Alexander Gordeev <agordeev@...ux.ibm.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Josh Poimboeuf <jpoimboe@...nel.org>,
        Jason Baron <jbaron@...mai.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] jump_label: explicitly annotate inittext labels as init

On Fri, 9 Dec 2022 at 07:08, Alexander Gordeev <agordeev@...ux.ibm.com> wrote:
>
> inittext code may be out of [__init_begin, __init_end]
> range on some architectures. Yet, the jump_label_init()
> only calls init_section_contains() function to check if
> a label needs to be annotated as init and inittext code
> is left behind.
>
> Fixes: 19483677684b ("jump_label: Annotate entries that operate on __init code earlier")
> Signed-off-by: Alexander Gordeev <agordeev@...ux.ibm.com>
> ---
>  kernel/jump_label.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/jump_label.c b/kernel/jump_label.c
> index 714ac4c3b556..77680665d374 100644
> --- a/kernel/jump_label.c
> +++ b/kernel/jump_label.c
> @@ -481,13 +481,16 @@ void __init jump_label_init(void)
>
>         for (iter = iter_start; iter < iter_stop; iter++) {
>                 struct static_key *iterk;
> +               unsigned long addr;
>                 bool in_init;
>
>                 /* rewrite NOPs */
>                 if (jump_label_type(iter) == JUMP_LABEL_NOP)
>                         arch_jump_label_transform_static(iter, JUMP_LABEL_NOP);
>
> -               in_init = init_section_contains((void *)jump_entry_code(iter), 1);
> +               addr = jump_entry_code(iter);
> +               in_init = init_section_contains((void *)addr, 1) ||
> +                         is_kernel_inittext(addr);

Isn't it sufficient to only call is_kenel_inittext here?

>                 jump_entry_set_init(iter, in_init);
>
>                 iterk = jump_entry_key(iter);
> --
> 2.34.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ