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:   Fri, 3 Feb 2023 22:05:36 +0900
From:   Masami Hiramatsu (Google) <mhiramat@...nel.org>
To:     Tiezhu Yang <yangtiezhu@...ngson.cn>
Cc:     Steven Rostedt <rostedt@...dmis.org>, naveen.n.rao@...ux.ibm.com,
        anil.s.keshavamurthy@...el.com, davem@...emloft.net,
        linux-trace-kernel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kprobes: Replace memcpy() with direct assignment

On Tue, 31 Jan 2023 20:01:50 +0800
Tiezhu Yang <yangtiezhu@...ngson.cn> wrote:

> Just do a direct assignment, then give a chance to probe memcpy()
> for some archs or kernel versions which do not blacklist memcpy().
> 

NACK, because this is not invoked from kprobe int3 handling code.

Thank you,

> Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
> ---
>  kernel/kprobes.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index 1c18ecf..5a3cf9f 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -407,8 +407,8 @@ static inline bool kprobe_unused(struct kprobe *p)
>  /* Keep all fields in the kprobe consistent. */
>  static inline void copy_kprobe(struct kprobe *ap, struct kprobe *p)
>  {
> -	memcpy(&p->opcode, &ap->opcode, sizeof(kprobe_opcode_t));
> -	memcpy(&p->ainsn, &ap->ainsn, sizeof(struct arch_specific_insn));
> +	p->opcode = ap->opcode;
> +	p->ainsn = ap->ainsn;
>  }
>  
>  #ifdef CONFIG_OPTPROBES
> -- 
> 2.1.0
> 


-- 
Masami Hiramatsu (Google) <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ