Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 446f24d1 authored by Stephen Boyd's avatar Stephen Boyd Committed by Linus Torvalds
Browse files

Kconfig: consolidate CONFIG_DEBUG_STRICT_USER_COPY_CHECKS



The help text for this config is duplicated across the x86, parisc, and
s390 Kconfig.debug files.  Arnd Bergman noted that the help text was
slightly misleading and should be fixed to state that enabling this
option isn't a problem when using pre 4.4 gcc.

To simplify the rewording, consolidate the text into lib/Kconfig.debug
and modify it there to be more explicit about when you should say N to
this config.

Also, make the text a bit more generic by stating that this option
enables compile time checks so we can cover architectures which emit
warnings vs.  ones which emit errors.  The details of how an
architecture decided to implement the checks isn't as important as the
concept of compile time checking of copy_from_user() calls.

While we're doing this, remove all the copy_from_user_overflow() code
that's duplicated many times and place it into lib/ so that any
architecture supporting this option can get the function for free.

Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarIngo Molnar <mingo@kernel.org>
Acked-by: default avatarH. Peter Anvin <hpa@zytor.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: default avatarHelge Deller <deller@gmx.de>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a05342cb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
config PARISC
	def_bool y
	select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
	select HAVE_IDE
	select HAVE_OPROFILE
	select HAVE_FUNCTION_TRACER if 64BIT
+0 −14
Original line number Diff line number Diff line
@@ -12,18 +12,4 @@ config DEBUG_RODATA
         portion of the kernel code won't be covered by a TLB anymore.
         If in doubt, say "N".

config DEBUG_STRICT_USER_COPY_CHECKS
	bool "Strict copy size checks"
	depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING
	---help---
	  Enabling this option turns a certain set of sanity checks for user
	  copy operations into compile time failures.

	  The copy_from_user() etc checks are there to help test if there
	  are sufficient security checks on the length argument of
	  the copy operation, by having gcc prove that the argument is
	  within bounds.

	  If unsure, or if you run an older (pre 4.4) gcc, say N.

endmenu
+1 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ config S390
	select ARCH_INLINE_WRITE_UNLOCK_BH
	select ARCH_INLINE_WRITE_UNLOCK_IRQ
	select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
	select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
	select ARCH_SAVE_PAGE_KEYS if HIBERNATION
	select ARCH_WANT_IPC_PARSE_VERSION
	select BUILDTIME_EXTABLE_SORT
+0 −14
Original line number Diff line number Diff line
@@ -17,20 +17,6 @@ config STRICT_DEVMEM

	  If you are unsure, say Y.

config DEBUG_STRICT_USER_COPY_CHECKS
	def_bool n
	prompt "Strict user copy size checks"
	---help---
	  Enabling this option turns a certain set of sanity checks for user
	  copy operations into compile time warnings.

	  The copy_from_user() etc checks are there to help test if there
	  are sufficient security checks on the length argument of
	  the copy operation, by having gcc prove that the argument is
	  within bounds.

	  If unsure, or if you run an older (pre 4.4) gcc, say N.

config S390_PTDUMP
	bool "Export kernel pagetable layout to userspace via debugfs"
	depends on DEBUG_KERNEL
+0 −1
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
#

lib-y += delay.o string.o uaccess_std.o uaccess_pt.o
obj-y += usercopy.o
obj-$(CONFIG_32BIT) += div64.o qrnnd.o ucmpdi2.o mem32.o
obj-$(CONFIG_64BIT) += mem64.o
lib-$(CONFIG_64BIT) += uaccess_mvcos.o
Loading