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
| ||
|
Message-Id: <20250513100730.12664-10-byungchul@sk.com> Date: Tue, 13 May 2025 19:06:56 +0900 From: Byungchul Park <byungchul@...com> To: linux-kernel@...r.kernel.org Cc: kernel_team@...ynix.com, torvalds@...ux-foundation.org, damien.lemoal@...nsource.wdc.com, linux-ide@...r.kernel.org, adilger.kernel@...ger.ca, linux-ext4@...r.kernel.org, mingo@...hat.com, peterz@...radead.org, will@...nel.org, tglx@...utronix.de, rostedt@...dmis.org, joel@...lfernandes.org, sashal@...nel.org, daniel.vetter@...ll.ch, duyuyang@...il.com, johannes.berg@...el.com, tj@...nel.org, tytso@....edu, willy@...radead.org, david@...morbit.com, amir73il@...il.com, gregkh@...uxfoundation.org, kernel-team@....com, linux-mm@...ck.org, akpm@...ux-foundation.org, mhocko@...nel.org, minchan@...nel.org, hannes@...xchg.org, vdavydov.dev@...il.com, sj@...nel.org, jglisse@...hat.com, dennis@...nel.org, cl@...ux.com, penberg@...nel.org, rientjes@...gle.com, vbabka@...e.cz, ngupta@...are.org, linux-block@...r.kernel.org, josef@...icpanda.com, linux-fsdevel@...r.kernel.org, jack@...e.cz, jlayton@...nel.org, dan.j.williams@...el.com, hch@...radead.org, djwong@...nel.org, dri-devel@...ts.freedesktop.org, rodrigosiqueiramelo@...il.com, melissa.srw@...il.com, hamohammed.sa@...il.com, harry.yoo@...cle.com, chris.p.wilson@...el.com, gwan-gyeong.mun@...el.com, max.byungchul.park@...il.com, boqun.feng@...il.com, longman@...hat.com, yskelg@...il.com, yunseong.kim@...csson.com, yeoreum.yun@....com, netdev@...r.kernel.org, matthew.brost@...el.com, her0gyugyu@...il.com Subject: [PATCH v15 09/43] arm64, dept: add support CONFIG_ARCH_HAS_DEPT_SUPPORT to arm64 dept needs to notice every entrance from user to kernel mode to treat every kernel context independently when tracking wait-event dependencies. Roughly, system call and user oriented fault are the cases. Make dept aware of the entrances of arm64 and add support CONFIG_ARCH_HAS_DEPT_SUPPORT to arm64. Signed-off-by: Byungchul Park <byungchul@...com> --- arch/arm64/Kconfig | 1 + arch/arm64/kernel/syscall.c | 7 +++++++ arch/arm64/mm/fault.c | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index a182295e6f08..6c69598a6423 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -279,6 +279,7 @@ config ARM64 select HAVE_SOFTIRQ_ON_OWN_STACK select USER_STACKTRACE_SUPPORT select VDSO_GETRANDOM + select ARCH_HAS_DEPT_SUPPORT help ARM 64-bit (AArch64) Linux support. diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c index c442fcec6b9e..bbd306335179 100644 --- a/arch/arm64/kernel/syscall.c +++ b/arch/arm64/kernel/syscall.c @@ -7,6 +7,7 @@ #include <linux/ptrace.h> #include <linux/randomize_kstack.h> #include <linux/syscalls.h> +#include <linux/dept.h> #include <asm/debug-monitors.h> #include <asm/exception.h> @@ -96,6 +97,12 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr, * (Similarly for HVC and SMC elsewhere.) */ + /* + * This is a system call from user mode. Make dept work with a + * new kernel mode context. + */ + dept_update_cxt(); + if (flags & _TIF_MTE_ASYNC_FAULT) { /* * Process the asynchronous tag check fault before the actual diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index ec0a337891dd..0fcc3dc9c2a9 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -26,6 +26,7 @@ #include <linux/pkeys.h> #include <linux/preempt.h> #include <linux/hugetlb.h> +#include <linux/dept.h> #include <asm/acpi.h> #include <asm/bug.h> @@ -616,6 +617,12 @@ static int __kprobes do_page_fault(unsigned long far, unsigned long esr, if (!(mm_flags & FAULT_FLAG_USER)) goto lock_mmap; + /* + * This fault comes from user mode. Make dept work with a new + * kernel mode context. + */ + dept_update_cxt(); + vma = lock_vma_under_rcu(mm, addr); if (!vma) goto lock_mmap; -- 2.17.1
Powered by blists - more mailing lists