From patchwork Tue Jul 14 13:35:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 495088 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4A365140773 for ; Tue, 14 Jul 2015 23:36:09 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yandex-team.ru header.i=@yandex-team.ru header.b=LN9F/q4j; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752946AbbGNNgD (ORCPT ); Tue, 14 Jul 2015 09:36:03 -0400 Received: from forward-corp1f.mail.yandex.net ([95.108.130.40]:59170 "EHLO forward-corp1f.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752928AbbGNNf6 (ORCPT ); Tue, 14 Jul 2015 09:35:58 -0400 Received: from smtpcorp4.mail.yandex.net (smtpcorp4.mail.yandex.net [95.108.252.2]) by forward-corp1f.mail.yandex.net (Yandex) with ESMTP id 658F32420DA1; Tue, 14 Jul 2015 16:35:56 +0300 (MSK) Received: from smtpcorp4.mail.yandex.net (localhost [127.0.0.1]) by smtpcorp4.mail.yandex.net (Yandex) with ESMTP id 1B3482C031F; Tue, 14 Jul 2015 16:35:56 +0300 (MSK) Received: from unknown (unknown [2a02:6b8:0:408:55be:d924:24e7:8b42]) by smtpcorp4.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ORtnAO0uWQ-ZusqW66F; Tue, 14 Jul 2015 16:35:56 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1436880956; bh=8fcifOHEvOpnTxdbGD6TLNVIhRU59qpH2elT2iTcJrw=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding; b=LN9F/q4jPWebzIVfkrth+3OIh9lvN1RNflKIdZaujdc64jLD47pmbgiKcqfHizB1Y TDlXKhdQVoF9pMUKSMUOwRsey4QNLbNFANKtUKa189a10dBMQdUCCT6aSrOcpZvWL3 CdQZRpcFBzoxfo0eieX+uv63rj8ISDQMECxwdzS0= Authentication-Results: smtpcorp4.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: [PATCH v3 5/5] ipvlan: ignore addresses from ipv6 autoconfiguration From: Konstantin Khlebnikov To: linux-netdev , Mahesh Bandewar Cc: "David S. Miller" , Jiri Benc Date: Tue, 14 Jul 2015 16:35:55 +0300 Message-ID: <20150714133555.22448.82099.stgit@buzz> In-Reply-To: <20150714132941.22448.42175.stgit@buzz> References: <20150714132941.22448.42175.stgit@buzz> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Inet6addr notifier is atomic and runs in bh context without RTNL when ipv6 receives router advertisement packet and performs autoconfiguration. Proper fix still in discussion. Let's at least plug the bug. v1: http://lkml.kernel.org/r/20150514135618.14062.1969.stgit@buzz v2: http://lkml.kernel.org/r/20150703125840.24121.91556.stgit@buzz Signed-off-by: Konstantin Khlebnikov --- drivers/net/ipvlan/ipvlan_main.c | 4 ++++ 1 file changed, 4 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index e995bc501ee6..20b58bdecf75 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -655,6 +655,10 @@ static int ipvlan_addr6_event(struct notifier_block *unused, struct net_device *dev = (struct net_device *)if6->idev->dev; struct ipvl_dev *ipvlan = netdev_priv(dev); + /* FIXME IPv6 autoconf calls us from bh without RTNL */ + if (in_softirq()) + return NOTIFY_DONE; + if (!netif_is_ipvlan(dev)) return NOTIFY_DONE;