android_kernel_xiaomi_sm7250/kernel
Peter Zijlstra e90dc48804 UPSTREAM: locking/static_key: Fix false positive warnings on concurrent dec/inc
Even though the atomic_dec_and_mutex_lock() in
__static_key_slow_dec_cpuslocked() can never see a negative value in
key->enabled the subsequent sanity check is re-reading key->enabled, which may
have been set to -1 in the meantime by static_key_slow_inc_cpuslocked().

                CPU  A                               CPU B

 __static_key_slow_dec_cpuslocked():          static_key_slow_inc_cpuslocked():
                               # enabled = 1
   atomic_dec_and_mutex_lock()
                               # enabled = 0
                                              atomic_read() == 0
                                              atomic_set(-1)
                               # enabled = -1
   val = atomic_read()
   # Oops - val == -1!

The test case is TCP's clean_acked_data_enable() / clean_acked_data_disable()
as tickled by KTLS (net/ktls).

Bug: 179222305
Suggested-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reported-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Tested-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: ard.biesheuvel@linaro.org
Cc: oss-drivers@netronome.com
Cc: pbonzini@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit a1247d06d01045d7ab2882a9c074fbf21137c690)
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: I5c3be23d196f2edcb1cf1379b172a13d8bdf564a
2021-02-25 11:16:14 -08:00
..
bpf This is the 4.19.177 stable release 2021-02-23 15:49:34 +01:00
cgroup UPSTREAM: cgroup: Move cgroup_parse_float() implementation out of CONFIG_SYSFS 2020-11-16 09:22:35 +01:00
configs
debug This is the 4.19.155 stable release 2020-11-05 14:02:27 +01:00
dma Merge 4.19.158 into android-4.19-stable 2020-11-19 12:25:33 +01:00
events Merge 4.19.158 into android-4.19-stable 2020-11-19 12:25:33 +01:00
gcov This is the 4.19.146 stable release 2020-09-17 13:59:19 +02:00
irq This is the 4.19.175 stable release 2021-02-10 09:57:00 +01:00
livepatch livepatch: Nullify obj->mod in klp_module_coming()'s error path 2019-10-07 18:57:10 +02:00
locking rtmutex: Remove unused argument from rt_mutex_proxy_unlock() 2021-01-30 13:32:12 +01:00
power This is the 4.19.173 stable release 2021-02-03 23:49:39 +01:00
printk This is the 4.19.149 stable release 2020-10-01 16:49:05 +02:00
rcu rcu: Avoid data-race in rcu_gp_fqs_check_wake() 2020-02-11 04:33:55 -08:00
sched This is the 4.19.164 stable release 2020-12-30 12:19:31 +01:00
time Merge 4.19.158 into android-4.19-stable 2020-11-19 12:25:33 +01:00
trace This is the 4.19.177 stable release 2021-02-23 15:49:34 +01:00
.gitignore BACKPORT: Provide in-kernel headers to make extending kernel easier 2019-06-12 12:33:20 +00:00
acct.c acct_on(): don't mess with freeze protection 2019-05-31 06:46:05 -07:00
async.c
audit_fsnotify.c
audit_tree.c audit: Embed key into chunk 2019-12-13 08:51:11 +01:00
audit_watch.c audit: CONFIG_CHANGE don't log internal bookkeeping as an event 2020-10-01 13:14:33 +02:00
audit.c audit: fix a net reference leak in audit_list_rules_send() 2020-06-22 09:05:13 +02:00
audit.h audit: fix a net reference leak in audit_list_rules_send() 2020-06-22 09:05:13 +02:00
auditfilter.c audit: fix a net reference leak in audit_list_rules_send() 2020-06-22 09:05:13 +02:00
auditsc.c audit: print empty EXECVE args 2019-12-01 09:17:17 +01:00
backtracetest.c
bounds.c kbuild: fix kernel/bounds.c 'W=1' warning 2018-11-13 11:08:47 -08:00
capability.c LSM: generalize flag passing to security_capable 2020-01-23 08:21:29 +01:00
cfi.c ANDROID: cfi: fix export symbol types 2020-04-29 19:16:15 +02:00
compat.c make 'user_access_begin()' do 'access_ok()' 2020-06-22 09:04:58 +02:00
configs.c
context_tracking.c
cpu_pm.c kernel/cpu_pm: Fix uninitted local in cpu_pm 2020-06-22 09:05:28 +02:00
cpu.c This is the 4.19.164 stable release 2020-12-30 12:19:31 +01:00
crash_core.c kernel/crash_core.c: print timestamp using time64_t 2018-08-22 10:52:47 -07:00
crash_dump.c
cred.c memcg: account security cred as well to kmemcg 2020-01-09 10:19:00 +01:00
delayacct.c UPSTREAM: delayacct: track delays from thrashing cache pages 2019-03-21 16:25:26 -07:00
dma.c
exec_domain.c
exit.c This is the 4.19.172 stable release 2021-02-01 12:59:33 +01:00
extable.c
fail_function.c fail_function: Remove a redundant mutex unlock 2020-11-24 13:27:23 +01:00
fork.c This is the 4.19.172 stable release 2021-02-01 12:59:33 +01:00
freezer.c PM / reboot: Eliminate race between reboot and suspend 2018-08-06 12:35:20 +02:00
futex.c futex: Handle faults correctly for PI futexes 2021-01-30 13:32:13 +01:00
gen_kheaders.sh UPSTREAM: kheaders: include only headers into kheaders_data.tar.xz 2020-04-16 18:00:25 +00:00
groups.c
hung_task.c kernel: hung_task.c: disable on suspend 2019-04-20 09:16:02 +02:00
iomem.c
irq_work.c irq_work: Do not raise an IPI when queueing work on the local CPU 2019-05-31 06:46:19 -07:00
jump_label.c UPSTREAM: locking/static_key: Fix false positive warnings on concurrent dec/inc 2021-02-25 11:16:14 -08:00
kallsyms.c Merge 4.19.133 into android-4.19-stable 2020-07-17 07:54:52 +02:00
kcmp.c
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt kconfig: include kernel/Kconfig.preempt from init/Kconfig 2018-08-02 08:06:54 +09:00
kcov.c UPSTREAM: kcov: remote coverage support 2020-01-15 14:51:23 +00:00
kexec_core.c kernel: kexec: remove the lock operation of system_transition_mutex 2021-02-03 23:23:23 +01:00
kexec_file.c
kexec_internal.h
kexec.c kexec: add call to LSM hook in original kexec_load syscall 2018-07-16 12:31:57 -07:00
kheaders.c BACKPORT: kheaders: Move from proc to sysfs 2019-06-12 12:33:54 +00:00
kmod.c kmod: make request_module() return an error when autoloading is disabled 2020-04-17 10:48:52 +02:00
kprobes.c tracing/kprobe: Fix to support kretprobe events on unloaded modules 2021-02-13 13:51:13 +01:00
ksysfs.c
kthread.c This is the 4.19.174 stable release 2021-02-07 15:41:31 +01:00
latencytop.c
Makefile This is the 4.19.175 stable release 2021-02-10 09:57:00 +01:00
memremap.c mm/memory_hotplug: shrink zones when offlining memory 2020-01-29 16:43:27 +01:00
module_signing.c modsign: log module name in the event of an error 2018-07-02 11:36:17 +02:00
module-internal.h modsign: log module name in the event of an error 2018-07-02 11:36:17 +02:00
module.c This is the 4.19.165 stable release 2021-01-06 15:16:13 +01:00
notifier.c x86/mm: split vmalloc_sync_all() 2020-03-25 08:06:13 +01:00
nsproxy.c
padata.c padata: purge get_cpu and reorder_via_wq from padata_do_serial 2020-05-27 17:37:36 +02:00
panic.c UPSTREAM: GKI: panic/reboot: allow specifying reboot_mode for panic only 2020-04-17 05:00:40 +00:00
params.c ANDROID: GKI: export symbols from abi_gki_aarch64_qcom_whitelist 2020-04-13 21:36:41 +00:00
pid_namespace.c signal/pid_namespace: Fix reboot_pid_ns to use send_sig not force_sig 2019-07-26 09:14:01 +02:00
pid.c UPSTREAM: pid: add pidfd_open() 2019-08-12 13:36:37 -04:00
profile.c
ptrace.c ptrace: Set PF_SUPERPRIV when checking capability 2020-11-24 13:27:26 +01:00
range.c
reboot.c Merge 4.19.158 into android-4.19-stable 2020-11-19 12:25:33 +01:00
relay.c kernel/relay.c: fix memleak on destroy relay channel 2020-08-26 10:30:59 +02:00
resource.c resource: fix locking in find_next_iomem_res() 2019-09-16 08:22:20 +02:00
rseq.c rseq: uapi: Declare rseq_cs field as union, update includes 2018-07-10 22:18:52 +02:00
scs.c FROMLIST: scs: add support for stack usage debugging 2019-11-27 12:37:25 -08:00
seccomp.c seccomp: Set PF_SUPERPRIV when checking capability 2020-11-24 13:27:26 +01:00
signal.c This is the 4.19.156 stable release 2020-11-10 13:23:09 +01:00
smp.c cpu/hotplug: Fix "SMT disabled by BIOS" detection for KVM 2019-02-12 19:47:25 +01:00
smpboot.c kthread: Extract KTHREAD_IS_PER_CPU 2021-02-07 14:48:38 +01:00
smpboot.h
softirq.c nohz: Fix missing tick reprogram when interrupting an inline softirq 2018-08-03 15:52:10 +02:00
stacktrace.c
stop_machine.c Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-08-13 11:25:07 -07:00
sys_ni.c UPSTREAM: signal: support CLONE_PIDFD with pidfd_send_signal 2019-08-12 13:36:37 -04:00
sys.c This is the 4.19.149 stable release 2020-10-01 16:49:05 +02:00
sysctl_binary.c
sysctl.c This is the 4.19.174 stable release 2021-02-07 15:41:31 +01:00
task_work.c
taskstats.c taskstats: fix data-race 2020-01-09 10:18:59 +01:00
test_kprobes.c
torture.c
tracepoint.c tracepoint: Fix tracepoint array element size mismatch 2018-10-17 15:35:29 -04:00
tsacct.c
ucount.c
uid16.c
uid16.h
umh.c usermodehelper: reset umask to default before executing user process 2020-10-14 10:31:21 +02:00
up.c
user_namespace.c userns: also map extents in the reverse map to kernel IDs 2018-11-13 11:09:00 -08:00
user-return-notifier.c
user.c ANDROID: proc: Add /proc/uid directory 2019-03-06 15:59:21 +00:00
utsname_sysctl.c sys: don't hold uts_sem while accessing userspace memory 2018-08-11 02:05:53 -05:00
utsname.c
watchdog_hld.c watchdog: Mark watchdog touch functions as notrace 2018-08-30 12:56:40 +02:00
watchdog.c watchdog/softlockup: Enforce that timestamp is valid on boot 2020-02-24 08:34:49 +01:00
workqueue_internal.h UPSTREAM: psi: fix aggregation idle shut-off 2019-03-21 16:25:27 -07:00
workqueue.c This is the 4.19.174 stable release 2021-02-07 15:41:31 +01:00