linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 15/16] apparmor: Replace spin_is_locked() with lockdep
       [not found] <20181003053902.6910-1-ldr709@gmail.com>
@ 2018-10-03  5:39 ` Lance Roy
  2018-10-03  5:56   ` John Johansen
  0 siblings, 1 reply; 2+ messages in thread
From: Lance Roy @ 2018-10-03  5:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul E. McKenney, Lance Roy, John Johansen, James Morris,
	Serge E. Hallyn, linux-security-module

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>
---
 security/apparmor/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/apparmor/file.c b/security/apparmor/file.c
index 4285943f7260..d0afed9ebd0e 100644
--- a/security/apparmor/file.c
+++ b/security/apparmor/file.c
@@ -496,7 +496,7 @@ static void update_file_ctx(struct aa_file_ctx *fctx, struct aa_label *label,
 	/* update caching of label on file_ctx */
 	spin_lock(&fctx->lock);
 	old = rcu_dereference_protected(fctx->label,
-					spin_is_locked(&fctx->lock));
+					lockdep_is_held(&fctx->lock));
 	l = aa_label_merge(old, label, GFP_ATOMIC);
 	if (l) {
 		if (l != old) {
-- 
2.19.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 15/16] apparmor: Replace spin_is_locked() with lockdep
  2018-10-03  5:39 ` [PATCH 15/16] apparmor: Replace spin_is_locked() with lockdep Lance Roy
@ 2018-10-03  5:56   ` John Johansen
  0 siblings, 0 replies; 2+ messages in thread
From: John Johansen @ 2018-10-03  5:56 UTC (permalink / raw)
  To: Lance Roy, linux-kernel
  Cc: Paul E. McKenney, James Morris, Serge E. Hallyn, linux-security-module

On 10/02/2018 10:39 PM, Lance Roy wrote:
> 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>

Acked-by: John Johansen <john.johansen@canonical.com>

> ---
>  security/apparmor/file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/security/apparmor/file.c b/security/apparmor/file.c
> index 4285943f7260..d0afed9ebd0e 100644
> --- a/security/apparmor/file.c
> +++ b/security/apparmor/file.c
> @@ -496,7 +496,7 @@ static void update_file_ctx(struct aa_file_ctx *fctx, struct aa_label *label,
>  	/* update caching of label on file_ctx */
>  	spin_lock(&fctx->lock);
>  	old = rcu_dereference_protected(fctx->label,
> -					spin_is_locked(&fctx->lock));
> +					lockdep_is_held(&fctx->lock));
>  	l = aa_label_merge(old, label, GFP_ATOMIC);
>  	if (l) {
>  		if (l != old) {
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-03  5:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20181003053902.6910-1-ldr709@gmail.com>
2018-10-03  5:39 ` [PATCH 15/16] apparmor: Replace spin_is_locked() with lockdep Lance Roy
2018-10-03  5:56   ` John Johansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).