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: <0ed72555-372a-64ff-5d0e-a6567650bd91@loongson.cn>
Date: Mon, 1 Jul 2024 14:22:46 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Oleg Nesterov <oleg@...hat.com>, Huacai Chen <chenhuacai@...nel.org>
Cc: andrii.nakryiko@...il.com, andrii@...nel.org, bpf@...r.kernel.org,
 jolsa@...nel.org, kernel@...0n.name, linux-kernel@...r.kernel.org,
 linux-trace-kernel@...r.kernel.org, loongarch@...ts.linux.dev,
 mhiramat@...nel.org, nathan@...nel.org, rostedt@...dmis.org
Subject: Re: [PATCH] LoongArch: make the users of larch_insn_gen_break()
 constant

On 06/29/2024 11:03 PM, Oleg Nesterov wrote:
> LoongArch defines UPROBE_SWBP_INSN as a function call and this breaks
> arch_uprobe_trampoline() which uses it to initialize a static variable.
>
> Add the new "__builtin_constant_p" helper, __emit_break(), and redefine
> the current users of larch_insn_gen_break() to use it.
>
> The patch adds check_emit_break() into kprobes.c and uprobes.c to test
> this change. They can be removed if LoongArch boots at least once, but
> otoh these 2 __init functions will be discarded by free_initmem().
>
> Fixes: ff474a78cef5 ("uprobe: Add uretprobe syscall to speed up return probe")
> Reported-by: Nathan Chancellor <nathan@...nel.org>
> Closes: https://lore.kernel.org/all/20240614174822.GA1185149@thelio-3990X/
> Suggested-by: Andrii Nakryiko <andrii@...nel.org>
> Signed-off-by: Oleg Nesterov <oleg@...hat.com>

Tested on LoongArch machine with Loongson-3A5000 and Loongson-3A6000
CPU, based on 6.10-rc3,

KPROBE_BP_INSN == larch_insn_gen_break(BRK_KPROBE_BP)
KPROBE_SSTEPBP_INSN == larch_insn_gen_break(BRK_KPROBE_SSTEPBP)
UPROBE_SWBP_INSN  == larch_insn_gen_break(BRK_UPROBE_BP)
UPROBE_XOLBP_INSN == larch_insn_gen_break(BRK_UPROBE_XOLBP)

The two functions check_emit_break() can be removed in
arch/loongarch/kernel/kprobes.c and arch/loongarch/kernel/uprobes.c

Tested-by: Tiezhu Yang <yangtiezhu@...ngson.cn>

Thanks,
Tiezhu


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ