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] [day] [month] [year] [list]
Date:	Mon, 17 Dec 2007 10:16:16 -0500
From:	Masami Hiramatsu <mhiramat@...hat.com>
To:	Harvey Harrison <harvey.harrison@...il.com>
CC:	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] x86: Unify cosmetic kprobes{32|64}.c

Hi Harvey,

Harvey Harrison wrote:
> diff --git a/arch/x86/kernel/kprobes_32.c b/arch/x86/kernel/kprobes_32.c
> index f4ba584..2a8acd6 100644
> --- a/arch/x86/kernel/kprobes_32.c
> +++ b/arch/x86/kernel/kprobes_32.c
> @@ -234,7 +234,7 @@ static int __kprobes is_IF_modifier(kprobe_opcode_t opcode)
>  
>  int __kprobes arch_prepare_kprobe(struct kprobe *p)
>  {
> -	/* insn: must be on special executable page on i386. */
> +	/* insn: must be on special executable page on x86_32|64. */
>  	p->ainsn.insn = get_insn_slot();
>  	if (!p->ainsn.insn)
>  		return -ENOMEM;
> @@ -373,13 +373,21 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
>  static __always_inline void clear_btf(void)
>  {
>  	if (test_thread_flag(TIF_DEBUGCTLMSR))
> +#ifdef CONFIG_X86_32
>  		wrmsr(MSR_IA32_DEBUGCTLMSR, 0, 0);
> +#else
> +		wrmsrl(MSR_IA32_DEBUGCTLMSR, 0);
> +#endif
>  }
>  
>  static __always_inline void restore_btf(void)
>  {
>  	if (test_thread_flag(TIF_DEBUGCTLMSR))
> +#ifdef CONFIG_X86_32
>  		wrmsr(MSR_IA32_DEBUGCTLMSR, current->thread.debugctlmsr, 0);
> +#else
> +		wrmsrl(MSR_IA32_DEBUGCTLMSR, current->thread.debugctlmsr);
> +#endif
>  }

I think you can use wrmsr() on X86_64 too.
So, we can merge it to wrmsr().


-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@...hat.com, masami.hiramatsu.pt@...achi.com

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