From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 577D7C2B9F7 for ; Fri, 28 May 2021 16:45:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E56C611CA for ; Fri, 28 May 2021 16:45:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236559AbhE1Qqp (ORCPT ); Fri, 28 May 2021 12:46:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235710AbhE1Qqf (ORCPT ); Fri, 28 May 2021 12:46:35 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A835C061574; Fri, 28 May 2021 09:44:41 -0700 (PDT) Date: Fri, 28 May 2021 18:44:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1622220279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MM/fYlgGh387J6P2lgkdYt7pFux0FECvUjgf+Lt7YEM=; b=H3aDHB9C1CRQ7mhy6uWO5eta+z8bvP7br4OWLOtZ5PZbpoLBW9jH/len3RLer3rypH4/EJ qyIZ3JgIUzETrn65te7SlpJkneIpOZeQzHt5Oz8KTAvPyMnJA21YZS//ngaYt+senX75ft iGra+Ea9s/w5+S4x7QHUIBfK6OxVi7/Lh9V9ZNC3WDL8Xvr2Kd8XuBlyXmI+WE3PIKKyx+ b4IT/v5t6d7WWDOqNV13Cb0RqXRR5jHPbndGiH7lV06dzcOVZsXod1Qjbd4b4mDajK2hBp 0IrSXdWbSNVtbaABBM19yDgBRZ/HOqcuHdREI1hIUAnmK8G9/FFY+OXI6ZrqoA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1622220279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MM/fYlgGh387J6P2lgkdYt7pFux0FECvUjgf+Lt7YEM=; b=hfb/qxn1syliAp0nMJggRr/rVQ29hRm6PaKz3PonsdTNrwKvwxFG4+vHIKNN+O2rGQDZE1 efe5QY63d6VDorCA== From: "Ahmed S. Darwish" To: Varad Gautam Cc: linux-kernel@vger.kernel.org, linux-rt-users , netdev@vger.kernel.org, stable@vger.kernel.org, Steffen Klassert , Herbert Xu , "David S. Miller" , Jakub Kicinski , Florian Westphal , "Peter Zijlstra (Intel)" Subject: Re: [PATCH v2] xfrm: policy: Read seqcount outside of rcu-read side in xfrm_policy_lookup_bytype Message-ID: References: <20210528120357.29542-1-varad.gautam@suse.com> <20210528160407.32127-1-varad.gautam@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210528160407.32127-1-varad.gautam@suse.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 28, 2021, Varad Gautam wrote: > > Thead 1 (xfrm_hash_resize) Thread 2 (xfrm_policy_lookup_bytype) > > rcu_read_lock(); > mutex_lock(&hash_resize_mutex); > read_seqcount_begin(&xfrm_policy_hash_generation); > mutex_lock(&hash_resize_mutex); // block > xfrm_bydst_resize(); > synchronize_rcu(); // block > > ... > > Fixes: 77cc278f7b20 ("xfrm: policy: Use sequence counters with associated lock") > Signed-off-by: Varad Gautam Acked-by: Ahmed S. Darwish