Re: [PATCH v2 07/11] arm64: Add skeleton to harden the branch predictor against aliasing attacks

2018-01-21 Thread Li Kun
On 2018/1/19 22:28, Will Deacon Wrote: On Fri, Jan 19, 2018 at 11:37:24AM +0800, Li Kun wrote: 在 2018/1/17 18:07, Will Deacon 写道: On Wed, Jan 17, 2018 at 12:10:33PM +0800, Yisheng Xie wrote: On 2018/1/5 21:12, Will Deacon wrote: diff --git a/arch/arm64/mm/context.c b/arch/arm64/mm

Re: [PATCH v2 07/11] arm64: Add skeleton to harden the branch predictor against aliasing attacks

2018-01-21 Thread Li Kun
On 2018/1/19 22:28, Will Deacon Wrote: On Fri, Jan 19, 2018 at 11:37:24AM +0800, Li Kun wrote: 在 2018/1/17 18:07, Will Deacon 写道: On Wed, Jan 17, 2018 at 12:10:33PM +0800, Yisheng Xie wrote: On 2018/1/5 21:12, Will Deacon wrote: diff --git a/arch/arm64/mm/context.c b/arch/arm64/mm

Re: [PATCH v2 07/11] arm64: Add skeleton to harden the branch predictor against aliasing attacks

2018-01-18 Thread Li Kun
g list linux-arm-ker...@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel -- Best Regards Li Kun

Re: [PATCH v2 07/11] arm64: Add skeleton to harden the branch predictor against aliasing attacks

2018-01-18 Thread Li Kun
g list linux-arm-ker...@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel -- Best Regards Li Kun

Re: [kernel-hardening] [PATCH 00/11] ARMv8.3 pointer authentication userspace support

2017-07-25 Thread Li Kun
insertions(+), 13 deletions(-) create mode 100644 Documentation/arm64/elf_hwcaps.txt create mode 100644 Documentation/arm64/pointer-authentication.txt create mode 100644 arch/arm64/include/asm/pointer_auth.h create mode 100644 arch/arm64/kvm/hyp/ptrauth-sr.c -- Best Regards Li Kun

Re: [kernel-hardening] [PATCH 00/11] ARMv8.3 pointer authentication userspace support

2017-07-25 Thread Li Kun
insertions(+), 13 deletions(-) create mode 100644 Documentation/arm64/elf_hwcaps.txt create mode 100644 Documentation/arm64/pointer-authentication.txt create mode 100644 arch/arm64/include/asm/pointer_auth.h create mode 100644 arch/arm64/kvm/hyp/ptrauth-sr.c -- Best Regards Li Kun

Re: [kernel-hardening] [PATCH v8 3/3] x86/refcount: Implement fast refcount overflow protection

2017-07-25 Thread Li Kun
: "cc", "cx"); here when the result LT_ZERO, you will saturate the r->refs.counter and make the atomic_try_cmpxchg(&(r->refs), , new) bound to fail first time. maybe we can just saturate the value of variable "new" ? + + } while (!atomic_try_cmpxchg(&(r->refs), , new)); + + return c; +} + -- Best Regards Li Kun

Re: [kernel-hardening] [PATCH v8 3/3] x86/refcount: Implement fast refcount overflow protection

2017-07-25 Thread Li Kun
: "cc", "cx"); here when the result LT_ZERO, you will saturate the r->refs.counter and make the atomic_try_cmpxchg(&(r->refs), , new) bound to fail first time. maybe we can just saturate the value of variable "new" ? + + } while (!atomic_try_cmpxchg(&(r->refs), , new)); + + return c; +} + -- Best Regards Li Kun

Re: [kernel-hardening] [PATCH v5 3/3] x86/refcount: Implement fast refcount overflow protection

2017-06-29 Thread Li Kun
on 2017/6/30 6:05, Kees Cook wrote: On Wed, Jun 28, 2017 at 9:13 PM, Li Kun <hw.li...@huawei.com> wrote: 在 2017/5/31 5:39, Kees Cook 写道: +bool ex_handler_refcount(const struct exception_table_entry *fixup, +struct pt_regs *regs, int trapnr) +{ + int

Re: [kernel-hardening] [PATCH v5 3/3] x86/refcount: Implement fast refcount overflow protection

2017-06-29 Thread Li Kun
on 2017/6/30 6:05, Kees Cook wrote: On Wed, Jun 28, 2017 at 9:13 PM, Li Kun wrote: 在 2017/5/31 5:39, Kees Cook 写道: +bool ex_handler_refcount(const struct exception_table_entry *fixup, +struct pt_regs *regs, int trapnr) +{ + int reset

Re: [kernel-hardening] [PATCH v5 3/3] x86/refcount: Implement fast refcount overflow protection

2017-06-28 Thread Li Kun
current->comm, task_pid_nr(current), + from_kuid_munged(_user_ns, current_uid()), + from_kuid_munged(_user_ns, current_euid())); + print_symbol(KERN_EMERG "refcount error occurred at: %s\n", + instruction_pointer(regs)); + show_regs(regs); +} +#endif + core_param(panic, panic_timeout, int, 0644); core_param(pause_on_oops, pause_on_oops, int, 0644); core_param(panic_on_warn, panic_on_warn, int, 0644); -- Best Regards Li Kun

Re: [kernel-hardening] [PATCH v5 3/3] x86/refcount: Implement fast refcount overflow protection

2017-06-28 Thread Li Kun
*/ + do_send_sig_info(SIGKILL, SEND_SIG_FORCED, current, true); + + if (!__ratelimit(_ratelimit)) + return; + + pr_emerg("refcount overflow detected in: %s:%d, uid/euid: %u/%u\n", + current->comm, task_pid_nr(current), + from_kuid_munged(_user_ns, current_uid()), + from_kuid_munged(_user_ns, current_euid())); + print_symbol(KERN_EMERG "refcount error occurred at: %s\n", + instruction_pointer(regs)); + show_regs(regs); +} +#endif + core_param(panic, panic_timeout, int, 0644); core_param(pause_on_oops, pause_on_oops, int, 0644); core_param(panic_on_warn, panic_on_warn, int, 0644); -- Best Regards Li Kun