Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3439309imu; Sun, 11 Nov 2018 15:07:28 -0800 (PST) X-Google-Smtp-Source: AJdET5dz79sxgMQyQa1RDSqkwfDrM0pIhhJGVEx77pfAW03RTzbNNebMXHgIOh3v5EWsTDHJukfO X-Received: by 2002:a17:902:5e4:: with SMTP id f91-v6mr4591566plf.75.1541977648035; Sun, 11 Nov 2018 15:07:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977648; cv=none; d=google.com; s=arc-20160816; b=UrPEmkknCo6oYXFErmh2rfRwf9um9mAsJSS8TXluF5wlj/FVKAXW3b0UEAZn4ySUsq h0Vgrlc5dOkr8qskZxztV7T4c5v5v67uNz+tb/d242/AET0aNP95q49rRT3h6vBLkFTh wJbrsecEKe1zOLlwv+1ycaWnVn12W9YEBgx0KYCZmKKb9NhUq2DWKhPJVQiJMg26DC6F dzmC3fLhbnd0rhAmMv1lIJTLNF6B02NvXmMU8uk6I5J3tPOWzW09bOaGHSSX4Ic6FVhH R8DzUlpTFVDZKJvsKWTgyEc3x4/ES3aaLssiW0JslN2sQZFoCfMs80iPBkWYAoTbnJE4 h8cQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ll+gn8by381LwX6W8/c+O2tne7Ij8bTh06bq+mIWgUY=; b=hrszhnOA808z/nM415oeAmErCzPp3/pnasVX87ca5XZonjFAfBFie3v7iMRyTr1vdY P3KncsFNoTbsIzCnMWL0IQB90ob4c+WzgxWaggiXdtEEGu7XZodoA8C8OH+FPC6j/XKN 5gJDjenqpVIaiscvdmHg0o46YbNXM1jsbFjlCqxMhCNk1sAENiwsj3AAgx08rJ+DPWq+ B25F4EWNfYCsvVSSeoLlOlgQR3z7esCs5OYI32ycEoONkDvPhyHw4QfY2JATfdnj0nNI wQCHb3m1GrWZDtEEDD+4zQCAqL8bPTBM6zrOBFD1kDgoXVLHHmWpR/zLj8GsgILFhU9R 1Y+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tdN5y1Ce; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1si14811815pgq.13.2018.11.11.15.07.13; Sun, 11 Nov 2018 15:07:28 -0800 (PST) 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=tdN5y1Ce; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390434AbeKLIWP (ORCPT + 99 others); Mon, 12 Nov 2018 03:22:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:51332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390381AbeKLIWN (ORCPT ); Mon, 12 Nov 2018 03:22:13 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7A8B22243E; Sun, 11 Nov 2018 22:32:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975536; bh=kXwuAl6oNtkGN8WDsyODNMFV5TZw2kVB/wax3GbVJqs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tdN5y1Ce6c5ZzRw6yaShhwy7wOoKEJVaBCla6ckcl3EL9/R6+Kg5I7UNiiOc4xu74 0JX7PhABzgCttxLS625QYToYPgCvpiBcJDyuKcuHy3znMed0nTN5O/I1eXqJSWiDa4 c/irs7mTbiXouL3646HTO/NL/qvhHHaGtKTZ55WQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Westphal , Steffen Klassert , Sasha Levin Subject: [PATCH 4.14 027/222] xfrm: policy: use hlist rcu variants on insert Date: Sun, 11 Nov 2018 14:22:04 -0800 Message-Id: <20181111221650.718226953@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Florian Westphal [ Upstream commit 9dffff200fd178f11dd50eb1fd8ccd0650c9284e ] bydst table/list lookups use rcu, so insertions must use rcu versions. Fixes: a7c44247f704e ("xfrm: policy: make xfrm_policy_lookup_bytype lockless") Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/xfrm/xfrm_policy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -626,9 +626,9 @@ static void xfrm_hash_rebuild(struct wor break; } if (newpos) - hlist_add_behind(&policy->bydst, newpos); + hlist_add_behind_rcu(&policy->bydst, newpos); else - hlist_add_head(&policy->bydst, chain); + hlist_add_head_rcu(&policy->bydst, chain); } spin_unlock_bh(&net->xfrm.xfrm_policy_lock); @@ -767,9 +767,9 @@ int xfrm_policy_insert(int dir, struct x break; } if (newpos) - hlist_add_behind(&policy->bydst, newpos); + hlist_add_behind_rcu(&policy->bydst, newpos); else - hlist_add_head(&policy->bydst, chain); + hlist_add_head_rcu(&policy->bydst, chain); __xfrm_policy_link(policy, dir); /* After previous checking, family can either be AF_INET or AF_INET6 */