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]
Message-ID: <20201113024032.GF3576660@ZenIV.linux.org.uk>
Date:   Fri, 13 Nov 2020 02:40:32 +0000
From:   Al Viro <viro@...iv.linux.org.uk>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     ansuelsmth@...il.com, 'Will Deacon' <will@...nel.org>,
        'Catalin Marinas' <catalin.marinas@....com>,
        'Mark Rutland' <mark.rutland@....com>,
        'Pavel Tatashin' <pasha.tatashin@...een.com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: R: [PATCH] arm64: fix missing include in asm uaccess.h

On Thu, Nov 12, 2020 at 04:48:09PM -0800, Andrew Morton wrote:

> [viro@...iv.linux.org.uk: use linux/uaccess.h]
>   Link: https://lkml.kernel.org/r/20201111005826.GY3576660@ZenIV.linux.org.uk
> Link: https://lkml.kernel.org/r/20201111004440.8783-1-ansuelsmth@gmail.com
> Fixes: df325e05a682 ("arm64: Validate tagged addresses in access_ok() called from kernel threads")
> Signed-off-by: Ansuel Smith <ansuelsmth@...il.com>
> Cc: Will Deacon <will@...nel.org>
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: Mark Rutland <mark.rutland@....com>
> Cc: Pavel Tatashin <pasha.tatashin@...een.com>
> Cc: <stable@...r.kernel.org>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> ---
> 
>  arch/arm64/include/asm/uaccess.h |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/arch/arm64/include/asm/uaccess.h~arm64-fix-missing-include-in-asm-uaccessh
> +++ a/arch/arm64/include/asm/uaccess.h
> @@ -7,6 +7,8 @@
>  #ifndef __ASM_UACCESS_H
>  #define __ASM_UACCESS_H
>  
> +#include <linux/uaccess.h>
> +
>  #include <asm/alternative.h>
>  #include <asm/kernel-pgtable.h>
>  #include <asm/sysreg.h>

Huh?  You are creating a loop for no reason whatsoever.  Again,
	* asm/uaccess.h should be included only by linux/uaccess.h
	* asm/uaccess.h should NOT, NOT, NOT! include linux/uaccess.h
	* any place other than linux/uaccess.h that includes asm/uaccess.h,
should include linux/uaccess.h instead (assuming it really needs either of
those).

The last one applies to arch/arm64/include/asm-prototypes.h - the include
of asm/uaccess.h there should be replaced with include of linux/uaccess.h.

diff --git a/arch/arm64/include/asm/asm-prototypes.h b/arch/arm64/include/asm/asm-prototypes.h
index 1c9a3a0c5fa5..80077350dbc5 100644
--- a/arch/arm64/include/asm/asm-prototypes.h
+++ b/arch/arm64/include/asm/asm-prototypes.h
@@ -15,7 +15,7 @@
 #include <asm/ftrace.h>
 #include <asm/page.h>
 #include <asm/string.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 
 #include <asm-generic/asm-prototypes.h>
 
diff --git a/arch/nds32/math-emu/fpuemu.c b/arch/nds32/math-emu/fpuemu.c
index 46558a15c0dc..6fabf75c19b3 100644
--- a/arch/nds32/math-emu/fpuemu.c
+++ b/arch/nds32/math-emu/fpuemu.c
@@ -2,7 +2,7 @@
 // Copyright (C) 2005-2018 Andes Technology Corporation
 
 #include <asm/bitfield.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include <asm/sfp-machine.h>
 #include <asm/fpuemu.h>
 #include <asm/nds32_fpu_inst.h>
diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
index d0c2db0e07fa..3a4468cd21b9 100644
--- a/arch/powerpc/kvm/book3s_xive_native.c
+++ b/arch/powerpc/kvm/book3s_xive_native.c
@@ -12,7 +12,7 @@
 #include <linux/spinlock.h>
 #include <linux/delay.h>
 #include <linux/file.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include <asm/kvm_book3s.h>
 #include <asm/kvm_ppc.h>
 #include <asm/hvcall.h>
diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c
index 3adcf730f478..93aaeaf24151 100644
--- a/arch/powerpc/mm/book3s64/radix_pgtable.c
+++ b/arch/powerpc/mm/book3s64/radix_pgtable.c
@@ -27,7 +27,7 @@
 #include <asm/sections.h>
 #include <asm/smp.h>
 #include <asm/trace.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include <asm/ultravisor.h>
 
 #include <trace/events/thp.h>
diff --git a/drivers/s390/net/ctcm_mpc.c b/drivers/s390/net/ctcm_mpc.c
index 85a1a4533cbe..88b74ddd88f0 100644
--- a/drivers/s390/net/ctcm_mpc.c
+++ b/drivers/s390/net/ctcm_mpc.c
@@ -47,7 +47,7 @@
 #include <asm/ccwdev.h>
 #include <asm/ccwgroup.h>
 #include <linux/bitops.h>	/* instead of <asm/bitops.h> ok ? */
-#include <linux/uaccess.h>	/* instead of <asm/uaccess.h> ok ? */
+#include <linux/uaccess.h>
 #include <linux/wait.h>
 #include <linux/moduleparam.h>
 #include <asm/idals.h>
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index c7c6e8b8344d..3743957e207f 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -8,6 +8,11 @@
 #include <linux/sched.h>
 #include <linux/thread_info.h>
 
+/*
+ * NOTE: This is the one and only place that has any business trying
+ * to include asm/uaccess.h; if you see such include anywhere else,
+ * kill it.
+ */
 #include <asm/uaccess.h>
 
 #ifdef CONFIG_SET_FS

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ