Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3755773pxv; Mon, 19 Jul 2021 08:03:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8wtsgViXUgzk4FlYwaZcFDb6Llbj+22uazRfhsLlDCP/gAAjfMbKaF2SJqILGRDamH2JK X-Received: by 2002:a02:a115:: with SMTP id f21mr22038885jag.3.1626706988958; Mon, 19 Jul 2021 08:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626706988; cv=none; d=google.com; s=arc-20160816; b=U1t0Z+Zo5jZ1PMmovQdcH7lvwShKi/py1jkzNyjlMpgJ/KPyYzPW3/uEt3XvJlTzdA cHf6l78tjJZt+RH2RAxd4RPq/nW91lUCb+AuA7rmHHSCuU9m0NDLEWxdQ19M2ZIt/w4H N4ch5J2zKLqaC7ito05czcyyPA+aUnMjXbTCZCgZMFtGBGeCfetOtTMmaICzKJgarcRI dGBja/tWNNDPlaWTBuHZ/i2SbKO1WeFjP5RwJagPUN3JyK4rKi+ZV1Yb/FsX0aNun9W5 gR0aGHC+1+r/bbz273K+RieC+6fmC/TGb8UjmERdJYSivvbHz5C8751zZToSFnAEqnc0 GAiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=d3YhuilaZnO3MKfUnEiL+7Klcr04Vju+1wEF//CFDDc=; b=XH3JitO81IMxKFzcEuBl7tjcrKE9JkV+9EP6BFCmVvaR+Xsdl2f2+VqCtRNJ5+sxIu stlFdvF1/TViajRFRqSDuqz26M3urUFDv4iEHN5Vuwo5zqZiL23kNnXS512K//KC/Bba 3MCiP4ZOAC40sBftrHkPaoS7M1NuqN3PCx2mMujIWh1/43NrPrPnzOf0GPZzdzioSrYk Gl6ZPsypfobHHY4lVwZbfV4b2VfLwCpGdx7Fdt1SzdPGbyoO22IoyXFGWMSJjr819L4E WalvJAgpp1xcDNyk0oeMK83SP3GCTOoIoy31b8iMwoHamFxnjLCEWeHYxeSc1GNypwMB +d2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pydUVFhd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si22434975jam.87.2021.07.19.08.02.36; Mon, 19 Jul 2021 08:03:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pydUVFhd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242857AbhGSOVN (ORCPT + 99 others); Mon, 19 Jul 2021 10:21:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:56506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242382AbhGSOTu (ORCPT ); Mon, 19 Jul 2021 10:19:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A009B61165; Mon, 19 Jul 2021 15:00:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626706829; bh=Fi1WOGB/gHgrOPil0YCRQlkbeL9NDzzccaMwb4AsXMc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pydUVFhdDgWxVuDLpWPAcTQna98f0gZkevuT0fdbw83JA/iRzuKDR+o+WyWLzM6Xz KTSMFjDUViq0QeeHhoRQV3dbUOy7/h7CAL7yxlnnTw/fCeXq/PhTQtuwWYmfmelDSS xmwEz4jiZvHKz+LTdeJG3E0iNcZNLBLv7Nnmyem0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , syzbot , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 073/188] vxlan: add missing rcu_read_lock() in neigh_reduce() Date: Mon, 19 Jul 2021 16:50:57 +0200 Message-Id: <20210719144930.039980271@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144913.076563739@linuxfoundation.org> References: <20210719144913.076563739@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Dumazet [ Upstream commit 85e8b032d6ebb0f698a34dd22c2f13443d905888 ] syzbot complained in neigh_reduce(), because rcu_read_lock_bh() is treated differently than rcu_read_lock() WARNING: suspicious RCU usage 5.13.0-rc6-syzkaller #0 Not tainted ----------------------------- include/net/addrconf.h:313 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 3 locks held by kworker/0:0/5: #0: ffff888011064d38 ((wq_completion)events){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888011064d38 ((wq_completion)events){+.+.}-{0:0}, at: atomic64_set include/asm-generic/atomic-instrumented.h:856 [inline] #0: ffff888011064d38 ((wq_completion)events){+.+.}-{0:0}, at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline] #0: ffff888011064d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:617 [inline] #0: ffff888011064d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:644 [inline] #0: ffff888011064d38 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x871/0x1600 kernel/workqueue.c:2247 #1: ffffc90000ca7da8 ((work_completion)(&port->wq)){+.+.}-{0:0}, at: process_one_work+0x8a5/0x1600 kernel/workqueue.c:2251 #2: ffffffff8bf795c0 (rcu_read_lock_bh){....}-{1:2}, at: __dev_queue_xmit+0x1da/0x3130 net/core/dev.c:4180 stack backtrace: CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 5.13.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events ipvlan_process_multicast Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 __in6_dev_get include/net/addrconf.h:313 [inline] __in6_dev_get include/net/addrconf.h:311 [inline] neigh_reduce drivers/net/vxlan.c:2167 [inline] vxlan_xmit+0x34d5/0x4c30 drivers/net/vxlan.c:2919 __netdev_start_xmit include/linux/netdevice.h:4944 [inline] netdev_start_xmit include/linux/netdevice.h:4958 [inline] xmit_one net/core/dev.c:3654 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3670 __dev_queue_xmit+0x2133/0x3130 net/core/dev.c:4246 ipvlan_process_multicast+0xa99/0xd70 drivers/net/ipvlan/ipvlan_core.c:287 process_one_work+0x98d/0x1600 kernel/workqueue.c:2276 worker_thread+0x64c/0x1120 kernel/workqueue.c:2422 kthread+0x3b1/0x4a0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Fixes: f564f45c4518 ("vxlan: add ipv6 proxy support") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/vxlan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 50ede6b8b874..4d44ec5b7cd7 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -1549,6 +1549,7 @@ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb) struct neighbour *n; struct inet6_dev *in6_dev; + rcu_read_lock(); in6_dev = __in6_dev_get(dev); if (!in6_dev) goto out; @@ -1605,6 +1606,7 @@ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb) } out: + rcu_read_unlock(); consume_skb(skb); return NETDEV_TX_OK; } -- 2.30.2