Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp6046146ybg; Tue, 22 Oct 2019 12:14:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmaUX5Tuo2YqiE1YMssX21VXigdCexQHDEKPnNeKn30RshOVLJYjF3LPdUTxSWf7n0AELk X-Received: by 2002:a17:906:80cd:: with SMTP id a13mr29378505ejx.12.1571771658028; Tue, 22 Oct 2019 12:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571771658; cv=none; d=google.com; s=arc-20160816; b=jhWFB4f4jHcyW5C4i47HpODQ+URqojfFApum8fgnYMMBv+gBtRcwc0q2PQHz+wuA5r nNsGOlgFTBPRiMpzznFlbkNubYOhhGubPOYBXsdM5+hMjP7GuFT3rg0XZXl/B6Gv9MLE bnhwocg3NV/B0kVuLfpodgF6XSMNgODoNTQvdMFMYAgfEVlmo/m25JFahlvWXeavZLOf TGyaq7QCIZwEA0+PKegEYQ0IkDprKO9viZSOMa2tvJuggm9RU6owtr/GcWjRugmVCbR5 DnQLv2FB/htA11O/dNdXjTq9tgCcBDacoOlkkEN0+exj/IvxNMXC+92PNEOO+5kdJLWB hdcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=KOBQifONXK+naDBXAUgkDW1UcXn3g22bHNAaTgTLHU8=; b=fimF/PRzdEdqqA/aFfrG0V5IZpSsdLQzNnMWpvSOGsavifklWLlNAW0E4w71hozQwW TtZNrgczMt9bkGrM3msnz8xLWWW/NyhA5u3exhNHgfFXB8jLYB52G2DwOVMKFrsM+6FV VHV96goh/XwdRQK1EzdogV1BzWKosfdz6fZ1cyh5zB00TGgp12rYAO0jdqB6yvBypCbb EXziaLzCTl6RsJkl14nOdor5nqd/fbO5YRRonp6qKuIooZmmExvKNhPlhbr2s3ssf0LW QqSbXCLTwSgKoPRFwfxcBJE5OQAlqJvWE9lXnPgSjla9HGgscNVxH9unjSelJuGNLs7U KQDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PROCQPtZ; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ot22si3160673ejb.166.2019.10.22.12.13.53; Tue, 22 Oct 2019 12:14:18 -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=@kernel.org header.s=default header.b=PROCQPtZ; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388743AbfJVTMn (ORCPT + 99 others); Tue, 22 Oct 2019 15:12:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:43894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388467AbfJVTMj (ORCPT ); Tue, 22 Oct 2019 15:12:39 -0400 Received: from localhost.localdomain (rrcs-50-75-166-42.nys.biz.rr.com [50.75.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 06965222CD; Tue, 22 Oct 2019 19:12:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571771558; bh=Okum0wathcf1ScrSzrZsCiqUTVvdU9caLoqJnp5U0KY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PROCQPtZDZmaKyYXPxYHvgKsVUd/icvfFR9ashemkF8b/cixY0p8T5H1q9SF38sBr 8iri0bC7CQke9mmhPYmo4U1NgsMRLbOQQabuABTlzoaPZa8D4+ShipM7VUQ0Rqj8Nj o4TNk7r5ZBTlxeytc81cjTk1hXuefFEPw5RjLaqg= From: paulmck@kernel.org To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, "Paul E. McKenney" , Micah Morton , James Morris , "Serge E. Hallyn" , linux-security-module@vger.kernel.org Subject: [PATCH tip/core/rcu 10/10] security/safesetid: Replace rcu_swap_protected() with rcu_replace() Date: Tue, 22 Oct 2019 12:12:15 -0700 Message-Id: <20191022191215.25781-10-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20191022191136.GA25627@paulmck-ThinkPad-P72> References: <20191022191136.GA25627@paulmck-ThinkPad-P72> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Paul E. McKenney" This commit replaces the use of rcu_swap_protected() with the more intuitively appealing rcu_replace() as a step towards removing rcu_swap_protected(). Link: https://lore.kernel.org/lkml/CAHk-=wiAsJLw1egFEE=Z7-GGtM6wcvtyytXZA1+BHqta4gg6Hw@mail.gmail.com/ Reported-by: Linus Torvalds Reported-by: Reported-by: kbuild test robot [ paulmck: From rcu_replace() to rcu_replace_pointer() per Ingo Molnar. ] Signed-off-by: Paul E. McKenney Cc: Micah Morton Cc: James Morris Cc: "Serge E. Hallyn" Cc: --- security/safesetid/securityfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/safesetid/securityfs.c b/security/safesetid/securityfs.c index 74a13d4..f8bc574 100644 --- a/security/safesetid/securityfs.c +++ b/security/safesetid/securityfs.c @@ -179,8 +179,8 @@ static ssize_t handle_policy_update(struct file *file, * doesn't currently exist, just use a spinlock for now. */ mutex_lock(&policy_update_lock); - rcu_swap_protected(safesetid_setuid_rules, pol, - lockdep_is_held(&policy_update_lock)); + pol = rcu_replace_pointer(safesetid_setuid_rules, pol, + lockdep_is_held(&policy_update_lock)); mutex_unlock(&policy_update_lock); err = len; -- 2.9.5