From patchwork Tue May 9 14:42:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 98925 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1857491qge; Tue, 9 May 2017 07:43:23 -0700 (PDT) X-Received: by 10.84.213.2 with SMTP id f2mr727191pli.22.1494341003440; Tue, 09 May 2017 07:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494341003; cv=none; d=google.com; s=arc-20160816; b=DnvOux0YmtbB+XF4brZjA0iKgiHfM4SbW3oclWpz9saIZfZ0+k+w2xLeRkL4E9LoYC KWQN5MlJPu1k6nB0SNF8bhSDaxPdJThU1jcYELI6xQ2t6PZEKv/HgUnYQm4wobZc5LH2 EZGtbI04mzvbRYJiHUTASc0243Ig10yDn8QvUrnNBPIv7lBvLfGY+13bKiya4t5CkjyW /BuVwAaM3DCi8X6BJBW5tYgVGxrVZVEEl8Yyr/4JOnnPeahAqYsmr1htOD5qduSuRs0o XI70Z30dmWmEK0nSeZtit1Y9eNgHDqgB2AXIjeVWEAxbcI35MwMWt8j2xG6Yh9U1TMBs QNpw== 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:arc-authentication-results; bh=HeiTbPTzg+tTwf67Pv38+8+wT+ep8aVSl2DanJU0OKY=; b=joU6jIg1a0WOruoKpJO4xggeJCXVw1WyUNMNN5emV8lb7q+CMKlY8E0Q0VoOWG/1uW fiLHKryJaJXPtJQVSlojyH94WHoKO6dko1ACltHIi5LG6xnBLhW3zkqpHAMxi+1J5HaD bzDmNX8tbmq+hUHhspOp9RuQ/9bfRXI0vZJV7bGbB/lNBZcWxdzqkLIAtOG3LiBM+Fcn 7haRIicKQyUOfSM+jxqWJB8B+fEW7rKOsKAtMmqy+Ur5RMFqLVsNAXPYi2UQzRWIS5gz KkuqD50WaPukaw+6ycU3rNRDSbgvb4D5o4OJcSDCt0ez3tAG7ndwqW7BkJF7/WoU7558 UHGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w34si113540pla.121.2017.05.09.07.43.23; Tue, 09 May 2017 07:43:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754195AbdEIOnW (ORCPT + 6 others); Tue, 9 May 2017 10:43:22 -0400 Received: from mail-pg0-f47.google.com ([74.125.83.47]:33090 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753957AbdEIOnW (ORCPT ); Tue, 9 May 2017 10:43:22 -0400 Received: by mail-pg0-f47.google.com with SMTP id u187so785771pgb.0 for ; Tue, 09 May 2017 07:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HeiTbPTzg+tTwf67Pv38+8+wT+ep8aVSl2DanJU0OKY=; b=O9IkSylQxqn5aUVZyk3oYnlMJlzLLoEaglB63zm52hZEObpwJBbbLUDtb0mlJO5i/8 7Vxm6ZqRDPE/7V/g64K6z8suwa1hEFn/1ZHD1ZngbLNo5wr0thDUNAEhW1iLEf8zBDjP zxpImHY2Al8p3xyCWeuq8r6eSIv+wgvQbmbAs= 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; bh=HeiTbPTzg+tTwf67Pv38+8+wT+ep8aVSl2DanJU0OKY=; b=D5ueUP89T1c56wE5dJNcyX6rA9Zd4NtFVJyWy+Y/as+tzAbYbAnBPRHRl+kDlVF/Cl PweWODomAeO0ZZ05+3v3ozCifG1KYLd8gNgQ0hFbm8bdU3xpKrJKwVWjWUwVTC9aV1oy d3+4qVY++FOTx22YF7ldhIfuM6Y9cAaLleLRq9ekjoQlwG8KcQAaI3D8iYlSIyGfAesr hnlQ3h5yKuyHQL6o7p0ZHAzLyboV3xyL8j8WYFo9CSFhTezu7cQ//HufGWjfktgfsVuH bY7Wl4QYMd5b8HX+LHytAwbOr2cccOxk/o3ny3oxy1u+Giue5vY7OFNFUbMwFYDNS1m6 tDPA== X-Gm-Message-State: AODbwcA58d4xXy6rxNBaaFJLbMCClsSglK92gW4dZ/kVZmcOqRubv2pK a+u6Fs6sh18Bde/ctxYrsw== X-Received: by 10.84.136.131 with SMTP id 3mr615603pll.181.1494341001593; Tue, 09 May 2017 07:43:21 -0700 (PDT) Received: from localhost.localdomain ([106.51.135.126]) by smtp.gmail.com with ESMTPSA id 11sm341811pfj.59.2017.05.09.07.43.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 May 2017 07:43:20 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: stable@vger.kernel.org, Eric Dumazet , "David S . Miller" Subject: [PATCH for-3.18 12/24] ipv6: sctp: fix lockdep splat in sctp_v6_get_dst() Date: Tue, 9 May 2017 20:12:36 +0530 Message-Id: <1494340968-17152-13-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494340968-17152-1-git-send-email-amit.pundir@linaro.org> References: <1494340968-17152-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eric Dumazet commit 69ce6487dcd364245a3d26322fc8f4ffd1e8d947 upstream. While cooking the sctp np->opt rcu fixes, I forgot to move one rcu_read_unlock() after the added rcu_dereference() in sctp_v6_get_dst() This gave lockdep warnings reported by Dave Jones. Fixes: c836a8ba9386 ("ipv6: sctp: add rcu protection around np->opt") Reported-by: Dave Jones Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Amit Pundir --- net/sctp/ipv6.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.7.4 diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 15bc2886a529..5fb8b7b579f9 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c @@ -323,14 +323,13 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr, } } } - rcu_read_unlock(); - if (baddr) { fl6->saddr = baddr->v6.sin6_addr; fl6->fl6_sport = baddr->v6.sin6_port; final_p = fl6_update_dst(fl6, rcu_dereference(np->opt), &final); dst = ip6_dst_lookup_flow(sk, fl6, final_p); } + rcu_read_unlock(); out: if (!IS_ERR_OR_NULL(dst)) {