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

Commit d0d58348 authored by Will Deacon's avatar Will Deacon Committed by Greg Kroah-Hartman
Browse files

locking/refcount: Consolidate implementations of refcount_t



[ Upstream commit fb041bb7c0a918b95c6889fc965cdc4a75b4c0ca ]

The generic implementation of refcount_t should be good enough for
everybody, so remove ARCH_HAS_REFCOUNT and REFCOUNT_FULL entirely,
leaving the generic implementation enabled unconditionally.

Signed-off-by: default avatarWill Deacon <will@kernel.org>
Reviewed-by: default avatarArd Biesheuvel <ardb@kernel.org>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Tested-by: default avatarHanjun Guo <guohanjun@huawei.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20191121115902.2551-9-will@kernel.org


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent dab787c7
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -915,27 +915,6 @@ config STRICT_MODULE_RWX
config ARCH_HAS_PHYS_TO_DMA
	bool

config ARCH_HAS_REFCOUNT
	bool
	help
	  An architecture selects this when it has implemented refcount_t
	  using open coded assembly primitives that provide an optimized
	  refcount_t implementation, possibly at the expense of some full
	  refcount state checks of CONFIG_REFCOUNT_FULL=y.

	  The refcount overflow check behavior, however, must be retained.
	  Catching overflows is the primary security concern for protecting
	  against bugs in reference counts.

config REFCOUNT_FULL
	bool "Perform full reference count validation at the expense of speed"
	help
	  Enabling this switches the refcounting infrastructure from a fast
	  unchecked atomic_t implementation to a fully state checked
	  implementation, which can be (slightly) slower but provides protections
	  against various use-after-free conditions that can be used in
	  security flaw exploits.

config HAVE_ARCH_COMPILER_H
	bool
	help
+0 −1
Original line number Diff line number Diff line
@@ -119,7 +119,6 @@ config ARM
	select OLD_SIGSUSPEND3
	select PCI_SYSCALL if PCI
	select PERF_USE_VMALLOC
	select REFCOUNT_FULL
	select RTC_LIB
	select SYS_SUPPORTS_APM_EMULATION
	# Above selects are sorted alphabetically; please add new ones
+0 −1
Original line number Diff line number Diff line
@@ -181,7 +181,6 @@ config ARM64
	select PCI_SYSCALL if PCI
	select POWER_RESET
	select POWER_SUPPLY
	select REFCOUNT_FULL
	select SPARSE_IRQ
	select SWIOTLB
	select SYSCTL_EXCEPTION_TRACE
+0 −1
Original line number Diff line number Diff line
@@ -62,7 +62,6 @@ CONFIG_OPROFILE=m
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
CONFIG_STATIC_KEYS_SELFTEST=y
CONFIG_REFCOUNT_FULL=y
CONFIG_LOCK_EVENT_COUNTS=y
CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y
+0 −1
Original line number Diff line number Diff line
@@ -73,7 +73,6 @@ config X86
	select ARCH_HAS_PMEM_API		if X86_64
	select ARCH_HAS_PTE_DEVMAP		if X86_64
	select ARCH_HAS_PTE_SPECIAL
	select ARCH_HAS_REFCOUNT
	select ARCH_HAS_UACCESS_FLUSHCACHE	if X86_64
	select ARCH_HAS_UACCESS_MCSAFE		if X86_64 && X86_MCE
	select ARCH_HAS_SET_MEMORY
Loading