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]
Message-ID: <533CB39D.2030509@codeaurora.org>
Date:	Wed, 02 Apr 2014 18:04:29 -0700
From:	Laura Abbott <lauraa@...eaurora.org>
To:	Rabin Vincent <rabin@....in>, linux-arm-kernel@...ts.infradead.org
CC:	linux-kernel@...r.kernel.org, mitchelh@...eaurora.org
Subject: Re: [PATCH] arm: ftrace: work with CONFIG_DEBUG_SET_MODULE_RONX

On 4/2/2014 3:10 PM, Rabin Vincent wrote:
> Make ftrace work with CONFIG_DEBUG_SET_MODULE_RONX by making module text
> writable around the place where ftrace does its work, like it is done on
> x86 in the patch which introduced CONFIG_DEBUG_SET_MODULE_RONX,
> 84e1c6bb38eb ("x86: Add RO/NX protection for loadable kernel modules").
> 
> Signed-off-by: Rabin Vincent <rabin@....in>
> ---
>  arch/arm/kernel/ftrace.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c
> index 34e5664..70ce654 100644
> --- a/arch/arm/kernel/ftrace.c
> +++ b/arch/arm/kernel/ftrace.c
> @@ -14,6 +14,7 @@
>  
>  #include <linux/ftrace.h>
>  #include <linux/uaccess.h>
> +#include <linux/module.h>
>  
>  #include <asm/cacheflush.h>
>  #include <asm/opcodes.h>
> @@ -63,6 +64,18 @@ static unsigned long adjust_address(struct dyn_ftrace *rec, unsigned long addr)
>  }
>  #endif
>  
> +int ftrace_arch_code_modify_prepare(void)
> +{
> +	set_all_modules_text_rw();
> +	return 0;
> +}
> +
> +int ftrace_arch_code_modify_post_process(void)
> +{
> +	set_all_modules_text_ro();
> +	return 0;
> +}
> +
>  static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr)
>  {
>  	return arm_gen_branch_link(pc, addr);
> 

I think Mitch tested this on our internal targets. I'll let him reply with his Tested-by

Laura

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
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