Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2164550imm; Tue, 2 Oct 2018 22:40:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV60OVP+abgJh/TPgEmKG5aLpI9n8AnyfmIbNf7kJ9COpJuuN9FcEJ5iWsz85XwNGMMED2Ine X-Received: by 2002:a62:6003:: with SMTP id u3-v6mr19771171pfb.114.1538545257697; Tue, 02 Oct 2018 22:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538545257; cv=none; d=google.com; s=arc-20160816; b=Lvmr3D1nPR1Kya3qH6316tEJjAxh56X0tO/ONTy65L5Hci+/6xqhZbx5vhdZIiDWmd sZmb0cZBCe7drZRN0LpxqfXwsBLzm0mSd99R3WvGbmhypLEm8xzfcfGobhLna0aavRSb fbpdlMeVQ2i2etpq53V8MNr6Vpsf4/zoADJoiwcAfuKtw4kx+jjMmxvDRA6vExRTjcvP LvIUn0AU4oBcLZKg7hV+nvGWfycXZtWJpo3heoorAmvqUzXseojoTr7eXOACvfxg3jc6 Er6td8xRw7Y3ePr+kE+sMpIaMcHfBDpybrteYED6LuC927spRU0QWpBejW9uaa6W8SUw Qb4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :reply-to:references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=byJ8AL+OyL3/ECrNFu7CrcIuzdZe6o08gH2o2a57pfs=; b=KoPpV6ZfT4iYnas/3eyS9Etf5XcWz0yiWmGQ6rYJYhvE/iordfjh09m2MYc1hgj3Xb bzmJxzoNPpzfxSiOzpto/yS/VFvBcvz4bQffaDxNQZ6h14I0ny8CBQQbliT+6+RZfvym dKbeDe4pDo/PkZcuZaHcWF+28mh5jNNvQP3q5k1KwWNvdxGHJfQ5ffsmbwlZGm0s8Wab KHEnyKTKMRXhRt4xEWBDhEforgPVugbe0m5Bpi2tKM+sllG0P7mKjU+OZXFaxEO68aex CstwfQsO8/A+BtAtH0amEkYTdpirM1uA/CfSasbZe+4ISX680vkqoRGoYbxYm7DNyW8A eSSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y6r6Bbsj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s20-v6si254844pgj.546.2018.10.02.22.40.42; Tue, 02 Oct 2018 22:40:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y6r6Bbsj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727567AbeJCM1L (ORCPT + 99 others); Wed, 3 Oct 2018 08:27:11 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:34111 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727261AbeJCM1K (ORCPT ); Wed, 3 Oct 2018 08:27:10 -0400 Received: by mail-pg1-f195.google.com with SMTP id g12-v6so1038157pgs.1; Tue, 02 Oct 2018 22:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=byJ8AL+OyL3/ECrNFu7CrcIuzdZe6o08gH2o2a57pfs=; b=Y6r6BbsjRMWVeh92LOUKinxS79rm8SBPMErwSMXiiXzHhjPFpKrDTDUSW2y88RxGkf Wqn9C+HeNEEjhtiLhwp4os4wQs/ZGdVYZovAwpRqQ8083uoODo60oL9MqkdEDIWGTYl7 2pJlqI62NSBNc0SgFEyAG9zxaKMi7A2/VGcIJPL/8Xrps9Ic8Ns9nA6ZAGE3E/L2CBNX 4IcBdIWPf/5zUdtYGZGn4w8rCXLJdai99XGzqsfihQcMrVH4SMqrOBbLnnUgUbhmz/bj 8AUMsQzQiXdJv+uNPxK8vg6qEC+lVTBqYvj78fKyiy5EJjk2PIgnlsnHcT6/y4xvDjVK 7jpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=byJ8AL+OyL3/ECrNFu7CrcIuzdZe6o08gH2o2a57pfs=; b=r2TCGw1AzyQ1qpKebdtxJrqVoCE5MVjiUAX7Y8zQ2tbeMEDOy7KUn2tcY6VkRHLpoI SEJ1eVumet7aV52MuUR70zdM0MHmVWp/iVgNPCiO96TCwfCBkvtw8oL6uxojU7xcEb8l lpqaY5AHx3py+7QYCRUG1IgJj/7LR637Ou8hmm9PpyTzfcxDoO6WUqH+FfGnHMRTiz46 nTP/1VLiqque9GBC8ZUbgcxoRQ0cQLoWQQUhoNq4GAZEQgKqmQczhSqwRc8GyoSKD9CK MhPGvarxES7tBAG7fs1ipxHYzAymaG3xJ4UfkE3weIOiTNushBGDF1lRJgnTwQhqV/VC h3rQ== X-Gm-Message-State: ABuFfojwE6GyAIsvsxwahIit/ptWjJYctnoR1DQMmYtbnooeRxsRk9OZ RWRww9Mb4GwT/pdnHPdtAZs= X-Received: by 2002:a65:5083:: with SMTP id r3-v6mr16843103pgp.355.1538545219775; Tue, 02 Oct 2018 22:40:19 -0700 (PDT) Received: from E570.localdomain (c-24-21-68-121.hsd1.or.comcast.net. [24.21.68.121]) by smtp.gmail.com with ESMTPSA id g12-v6sm548219pfo.50.2018.10.02.22.40.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Oct 2018 22:40:19 -0700 (PDT) Received: by E570.localdomain (Postfix, from userid 1000) id 83E441643D0; Tue, 2 Oct 2018 22:40:18 -0700 (PDT) From: Lance Roy To: linux-kernel@vger.kernel.org Cc: "Paul E. McKenney" , Lance Roy , John Johansen , James Morris , "Serge E. Hallyn" , linux-security-module@vger.kernel.org Subject: [PATCH 15/16] apparmor: Replace spin_is_locked() with lockdep Date: Tue, 2 Oct 2018 22:39:01 -0700 Message-Id: <20181003053902.6910-16-ldr709@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181003053902.6910-1-ldr709@gmail.com> References: <20181003053902.6910-1-ldr709@gmail.com> Reply-To: Lance Roy MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: John Johansen Cc: James Morris Cc: "Serge E. Hallyn" Cc: --- 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