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]
Message-ID: <54E735CD.4020507@hitachi.com>
Date:	Fri, 20 Feb 2015 22:25:33 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	Petr Mladek <pmladek@...e.cz>,
	"David S. Miller" <davem@...emloft.net>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
	Ananth NMavinakayanahalli <ananth@...ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Jiri Kosina <jkosina@...e.cz>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] kprobes/x86: Use 5-byte NOP when the code might be
 modified by ftrace

(2015/02/20 21:52), Ingo Molnar wrote:
> 
> * Masami Hiramatsu <masami.hiramatsu.pt@...achi.com> wrote:
> 
>> (2015/02/20 19:26), Ingo Molnar wrote:
>>>
>>> * Petr Mladek <pmladek@...e.cz> wrote:
>>>
>>>> can_probe() checks if the given address points to the 
>>>> beginning of an instruction. It analyzes all the 
>>>> instructions from the beginning of the function until the 
>>>> given address. The code might be modified by another 
>>>> Kprobe. In this case, the current code is read into a 
>>>> buffer, int3 breakpoint is replaced by the saved opcode 
>>>> in the buffer, and can_probe() analyzes the buffer 
>>>> instead.
>>>>
>>>> [...]
>>>
>>> Had to drop this patch due to build failures on 32-bit x86:
>>>
>>> arch/x86/kernel/kprobes/core.c:258:40: error: ‘MCOUNT_INSN_SIZE’ undeclared (first use in this function)
>>
>> Oops, MCOUNT_INSN_SIZE actually depends on 
>> CONFIG_FUNCTION_TRACER... I think we can use 5 instead of 
>> that since we are copying NOP_ATOMIC5.
> 
> Or just make the define more widely available? It's not 
> like the size changes from disabling the function tracer.

Yeah, it could be.
Actually, to tell the truth, if CONFIG_FUNCTION_TRACER=n,
ftrace_location() always returns 0, so the 2nd memcpy never be
executed (it should be disappeared by optimization).
Thus *this* issue is very local one, and I thought we'd better
fix this locally. :)

Thank you,

-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research 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