diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-03 15:14:18 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-03 15:14:18 -0400 |
| commit | 892ad5acca0b2ddb514fae63fa4686bf726d2471 (patch) | |
| tree | 9945b41e6552c0b6b9b1b5b0ffb77f2f15857671 | |
| parent | 162b246eb420d2ca2002a50917c897b10c9aba09 (diff) | |
| parent | 5d6dec6fba38c3e2d408df108bb92ef4ac201f18 (diff) | |
Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking updates from Ingo Molnar:
"The main changes in this cycle were:
- Add CONFIG_REFCOUNT_FULL=y to allow the disabling of the 'full'
(robustness checked) refcount_t implementation with slightly lower
runtime overhead. (Kees Cook)
The lighter weight variant is the default. The two variants use the
same API. Having this variant was a precondition by some
maintainers to merge refcount_t cleanups.
- Add lockdep support for rtmutexes (Peter Zijlstra)
- liblockdep fixes and improvements (Sasha Levin, Ben Hutchings)
- ... misc fixes and improvements"
* 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (30 commits)
locking/refcount: Remove the half-implemented refcount_sub() API
locking/refcount: Create unchecked atomic_t implementation
locking/rtmutex: Don't initialize lockdep when not required
locking/selftest: Add RT-mutex support
locking/selftest: Remove the bad unlock ordering test
rt_mutex: Add lockdep annotations
MAINTAINERS: Claim atomic*_t maintainership
locking/x86: Remove the unused atomic_inc_short() methd
tools/lib/lockdep: Remove private kernel headers
tools/lib/lockdep: Hide liblockdep output from test results
tools/lib/lockdep: Add dummy current_gfp_context()
tools/include: Add IS_ERR_OR_NULL to err.h
tools/lib/lockdep: Add empty __is_[module,kernel]_percpu_address
tools/lib/lockdep: Include err.h
tools/include: Add (mostly) empty include/linux/sched/mm.h
tools/lib/lockdep: Use LDFLAGS
tools/lib/lockdep: Remove double-quotes from soname
tools/lib/lockdep: Fix object file paths used in an out-of-tree build
tools/lib/lockdep: Fix compilation for 4.11
tools/lib/lockdep: Don't mix fd-based and stream IO
...
72 files changed, 641 insertions, 234 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 503f80a43bec..d357695ee4fe 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -2322,6 +2322,15 @@ F: Documentation/devicetree/bindings/input/atmel,maxtouch.txt | |||
| 2322 | F: drivers/input/touchscreen/atmel_mxt_ts.c | 2322 | F: drivers/input/touchscreen/atmel_mxt_ts.c |
| 2323 | F: include/linux/platform_data/atmel_mxt_ts.h | 2323 | F: include/linux/platform_data/atmel_mxt_ts.h |
| 2324 | 2324 | ||
| 2325 | ATOMIC INFRASTRUCTURE | ||
| 2326 | M: Will Deacon <will.deacon@arm.com> | ||
| 2327 | M: Peter Zijlstra <peterz@infradead.org> | ||
| 2328 | R: Boqun Feng <boqun.feng@gmail.com> | ||
| 2329 | L: linux-kernel@vger.kernel.org | ||
| 2330 | S: Maintained | ||
| 2331 | F: arch/*/include/asm/atomic*.h | ||
| 2332 | F: include/*/atomic*.h | ||
| 2333 | |||
| 2325 | ATTO EXPRESSSAS SAS/SATA RAID SCSI DRIVER | 2334 | ATTO EXPRESSSAS SAS/SATA RAID SCSI DRIVER |
| 2326 | M: Bradley Grove <linuxdrivers@attotech.com> | 2335 | M: Bradley Grove <linuxdrivers@attotech.com> |
| 2327 | L: linux-scsi@vger.kernel.org | 2336 | L: linux-scsi@vger.kernel.org |
| @@ -7555,7 +7564,7 @@ S: Maintained | |||
| 7555 | F: drivers/ata/sata_promise.* | 7564 | F: drivers/ata/sata_promise.* |
| 7556 | 7565 | ||
| 7557 | LIBLOCKDEP | 7566 | LIBLOCKDEP |
| 7558 | M: Sasha Levin <sasha.levin@oracle.com> | 7567 | M: Sasha Levin <alexander.levin@verizon.com> |
| 7559 | S: Maintained | 7568 | S: Maintained |
| 7560 | F: tools/lib/lockdep/ | 7569 | F: tools/lib/lockdep/ |
| 7561 | 7570 | ||
diff --git a/arch/Kconfig b/arch/Kconfig index 6c00e5b00f8b..f76b214cf7ad 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
| @@ -867,4 +867,13 @@ config STRICT_MODULE_RWX | |||
| 867 | config ARCH_WANT_RELAX_ORDER | 867 | config ARCH_WANT_RELAX_ORDER |
| 868 | bool | 868 | bool |
| 869 | 869 | ||
| 870 | config REFCOUNT_FULL | ||
| 871 | bool "Perform full reference count validation at the expense of speed" | ||
| 872 | help | ||
| 873 | Enabling this switches the refcounting infrastructure from a fast | ||
| 874 | unchecked atomic_t implementation to a fully state checked | ||
| 875 | implementation, which can be (slightly) slower but provides protections | ||
| 876 | against various use-after-free conditions that can be used in | ||
| 877 | security flaw exploits. | ||
| 878 | |||
| 870 | source "kernel/gcov/Kconfig" | 879 | source "kernel/gcov/Kconfig" |
diff --git a/arch/tile/lib/atomic_asm_32.S b/arch/tile/lib/atomic_asm_32.S index 1a70e6c0f259..94709ab41ed8 100644 --- a/arch/tile/lib/atomic_asm_32.S +++ b/arch/tile/lib/atomic_asm_32.S | |||
| @@ -24,8 +24,7 @@ | |||
| 24 | * has an opportunity to return -EFAULT to the user if needed. | 24 | * has an opportunity to return -EFAULT to the user if needed. |
| 25 | * The 64-bit routines just return a "long long" with the value, | 25 | * The 64-bit routines just return a "long long" with the value, |
| 26 | * since they are only used from kernel space and don't expect to fault. | 26 | * since they are only used from kernel space and don't expect to fault. |
| 27 | * Support for 16-bit ops is included in the framework but we don't provide | 27 | * Support for 16-bit ops is included in the framework but we don't provide any. |
| 28 | * any (x86_64 has an atomic_inc_short(), so we might want to some day). | ||
| 29 | * | 28 | * |
| 30 | * Note that the caller is advised to issue a suitable L1 or L2 | 29 | * Note that the caller is advised to issue a suitable L1 or L2 |
| 31 | * prefetch on the address being manipulated to avoid extra stalls. | 30 | * prefetch on the address being manipulated to avoid extra stalls. |
diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h index caa5798c92f4..33380b871463 100644 --- a/arch/x86/include/asm/atomic.h +++ b/arch/x86/include/asm/atomic.h | |||
| @@ -246,19 +246,6 @@ static __always_inline int __atomic_add_unless(atomic_t *v, int a, int u) | |||
| 246 | return c; | 246 | return c; |
| 247 | } | 247 | } |
| 248 | 248 | ||
| 249 | /** | ||
| 250 | * atomic_inc_short - increment of a short integer | ||
| 251 | * @v: pointer to type int | ||
| 252 | * | ||
| 253 | * Atomically adds 1 to @v | ||
| 254 | * Returns the new value of @u | ||
| 255 | */ | ||
| 256 | static __always_inline short int atomic_inc_short(short int *v) | ||
| 257 | { | ||
| 258 | asm(LOCK_PREFIX "addw $1, %0" : "+m" (*v)); | ||
| 259 | return *v; | ||
| 260 | } | ||
| 261 | |||
| 262 | #ifdef CONFIG_X86_32 | 249 | #ifdef CONFIG_X86_32 |
| 263 | # include <asm/atomic64_32.h> | 250 | # include <asm/atomic64_32.h> |
| 264 | #else | ||
