android_kernel_oneplus_msm8998/security
Jann Horn 4088997e5d device_cgroup: fix RCU imbalance in error case
commit 0fcc4c8c044e117ac126ab6df4138ea9a67fa2a9 upstream.

When dev_exception_add() returns an error (due to a failed memory
allocation), make sure that we move the RCU preemption count back to where
it was before we were called. We dropped the RCU read lock inside the loop
body, so we can't just "break".

sparse complains about this, too:

$ make -s C=2 security/device_cgroup.o
./include/linux/rcupdate.h:647:9: warning: context imbalance in
'propagate_exception' - unexpected unlock

Fixes: d591fb5661 ("device_cgroup: simplify cgroup tree walk in propagate_exception()")
Cc: stable@vger.kernel.org
Signed-off-by: Jann Horn <jannh@google.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-27 09:34:02 +02:00
..
apparmor apparmor: Make path_max parameter readonly 2018-03-22 09:23:24 +01:00
integrity ima: fix showing large 'violations' or 'runtime_measurements_count' 2018-11-21 09:27:35 +01:00
keys KEYS: restrict /proc/keys by credentials at open time 2019-03-23 08:44:29 +01:00
selinux selinux: fix GPF on invalid policy 2019-01-26 09:42:51 +01:00
smack smack: fix access permissions for keyring 2019-02-20 10:13:07 +01:00
tomoyo mm: replace get_user_pages() write/force parameters with gup_flags 2018-12-17 21:55:16 +01:00
yama Yama: Check for pid death before checking ancestry 2019-01-26 09:42:50 +01:00
commoncap.c ptrace: use fsuid, fsgid, effective creds for fs access checks 2016-02-25 12:01:16 -08:00
device_cgroup.c device_cgroup: fix RCU imbalance in error case 2019-04-27 09:34:02 +02:00
inode.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-07-04 19:36:06 -07:00
Kconfig KPTI: Rename to PAGE_TABLE_ISOLATION 2018-01-05 15:44:26 +01:00
lsm_audit.c missing barriers in some of unix_sock ->addr and ->path accesses 2019-03-23 08:44:31 +01:00
Makefile LSM: Switch to lists of hooks 2015-05-12 15:00:41 +10:00
min_addr.c mmap_min_addr check CAP_SYS_RAWIO only for write 2010-04-23 08:56:31 +10:00
security.c LSM: Check for NULL cred-security on free 2019-01-26 09:42:50 +01:00