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]
Date:   Thu, 7 Feb 2019 19:11:54 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Daniel Bristot de Oliveira <bristot@...hat.com>
Cc:     linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Jiri Kosina <jkosina@...e.cz>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Chris von Recklinghausen <crecklin@...hat.com>,
        Jason Baron <jbaron@...mai.com>, Scott Wood <swood@...hat.com>,
        Marcelo Tosatti <mtosatti@...hat.com>,
        Clark Williams <williams@...hat.com>, x86@...nel.org
Subject: Re: [PATCH V4 5/9] x86/alternative: Split text_poke_bp() into tree
 steps

On Mon,  4 Feb 2019 20:58:58 +0100
Daniel Bristot de Oliveira <bristot@...hat.com> wrote:

> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
> index d458c7973c56..202af29c43c0 100644
> --- a/arch/x86/kernel/alternative.c
> +++ b/arch/x86/kernel/alternative.c
> @@ -767,6 +767,29 @@ int poke_int3_handler(struct pt_regs *regs)
>  
>  }
>  
> +static void text_poke_bp_set_handler(void *addr, void *handler,
> +				     unsigned char int3)
> +{
> +	bp_int3_handler = handler;
> +	bp_int3_addr = (u8 *)addr + sizeof(int3);

Why add the above update to the handler in this function? It looks
strange in this patch. Then I thought, "hmm, maybe it has a reason to
be here in other patches". Then I see in patch 7, you *REMOVE* these
awkward lines from this function! Let's not move them here to begin
with.

We then don't even need to pass in "handler". And perhaps rename it to
just "text_poke_bp_add_int3()"?

-- Steve


> +	text_poke(addr, &int3, sizeof(int3));
> +}
> +
> +static void patch_all_but_first_byte(void *addr, const void *opcode,
> +				     size_t len, unsigned char int3)
> +{
> +	/* patch all but the first byte */
> +	text_poke((char *)addr + sizeof(int3),
> +		  (const char *) opcode + sizeof(int3),
> +		  len - sizeof(int3));
> +}
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ