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]
Message-ID: <4F4E262B.9030806@hitachi.com>
Date:	Wed, 29 Feb 2012 22:20:43 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	linux-kernel@...r.kernel.org, yrl.pp-manager.tt@...achi.com,
	systemtap@...rceware.org, anderson@...hat.com,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>
Subject: Re: [PATCH v3 -tip] [BUGFIX] x86/kprobes: Fix to recover instructions
 on optimized path

(2012/02/28 18:59), Ingo Molnar wrote:
> 
> * Masami Hiramatsu <masami.hiramatsu.pt@...achi.com> wrote:
> 
>> (2012/02/28 17:48), Ingo Molnar wrote:
>>>
>>> * Masami Hiramatsu <masami.hiramatsu.pt@...achi.com> wrote:
>>>
>>>> (2012/02/27 18:34), Ingo Molnar wrote:
>>>>>
>>>>> * Masami Hiramatsu <masami.hiramatsu.pt@...achi.com> wrote:
>>>>>
>>>>>> +
>>>>>> +#ifdef CONFIG_OPTPROBES
>>>>>> +static unsigned long __recover_optprobed_insn(struct kprobe *kp,
>>>>>> +					      kprobe_opcode_t *buf,
>>>>>> +					      unsigned long addr)
>>>>>> +{
>>>>>> +	long offs = addr - (unsigned long)kp->addr - 1;
>>>>>> +	struct optimized_kprobe *op = container_of(kp, struct optimized_kprobe, kp);
>>>>>> +
>>>>>> +	/*
>>>>>> +	 * If the kprobe can be optimized, original bytes which can be
>>>>>> +	 * overwritten by jump destination address. In this case, original
>>>>>> +	 * bytes must be recovered from op->optinsn.copied_insn buffer.
>>>>>> +	 */
>>>>>> +	memcpy(buf, (void *)addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
>>>>>> +	if (addr == (unsigned long)kp->addr) {
>>>>>> +		buf[0] = kp->opcode;
>>>>>> +		memcpy(buf + 1, op->optinsn.copied_insn, RELATIVE_ADDR_SIZE);
>>>>>> +	} else
>>>>>> +		memcpy(buf, op->optinsn.copied_insn + offs, RELATIVE_ADDR_SIZE - offs);
>>>>>> +
>>>>>> +	return (unsigned long)buf;
>>>>>> +}
>>>>>> +#endif
>>>>>
>>>>> Why not stick this into a new kprobes-opt.c file?
>>>>
>>>> Would you mean that I should split all optprobe stuffs into 
>>>> new file?
>>>
>>> Yeah, that would be sensible I think - and it might help avoid 
>>> similar complications in the future.
>>>
>>> Could (and probably should) be done in a separate patch - to 
>>> keep the bits that you already fixed and tested intact.
>>
>> OK, I'll make a separate patch.
> 
> Could be done on top of your existing patch, to keep things 
> simpler for you - a split-up patch done before your fix would 
> create a lot of conflicts in the fix patch.

I see. And in the previous patch, I've just find a small
racing bug. I'll update it too.

Thank you,


-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: 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