Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

apparmor: Replace spin_is_locked() with lockdep

lockdep_assert_held() is better suited to checking locking requirements,
since it won't get confused when someone else holds the lock. This is
also a step towards possibly removing spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: John Johansen <john.johansen@canonical.com>
Cc: James Morris <jmorris@namei.org>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: <linux-security-module@vger.kernel.org>
Signed-off-by: John Johansen <john.johansen@canonical.com>

authored by

Lance Roy and committed by
John Johansen
0fb871cc ab9f2115

+1 -1
+1 -1
security/apparmor/file.c
··· 496 496 /* update caching of label on file_ctx */ 497 497 spin_lock(&fctx->lock); 498 498 old = rcu_dereference_protected(fctx->label, 499 - spin_is_locked(&fctx->lock)); 499 + lockdep_is_held(&fctx->lock)); 500 500 l = aa_label_merge(old, label, GFP_ATOMIC); 501 501 if (l) { 502 502 if (l != old) {