Article View: linux.kernel.netdev
Article #19472Re: [PATCH net-next 4/4] tap: remove tap_get_tap_dev() and tap_put_tap_dev()
From: Willem de Bruijn
Date: Fri, 20 Nov 2026 00:03
Date: Fri, 20 Nov 2026 00:03
28 lines
11739 bytes
11739 bytes
Eric Dumazet wrote:
> tap_get_tap_dev() takes a reference on tap->dev, released by
> tap_put_tap_dev().
>
> This comes from commit 8f475a318aaa ("macvtap: introduce
> macvtap_get_vlan()"), when q->vlan was read under rcu_read_lock_bh()
> and the reference was needed to use the device after
> rcu_read_unlock_bh().
>
> Both remaining callers, SIOCGIFHWADDR and SIOCSIFHWADDR, hold RTNL
Iff respinning would be worthwhile to add when the condition that
required the dev_hold went away.
Apparently very soon after the introduction in commit 441ac0fcaadc
("macvtap: Convert to using rtnl lock").
> for the whole time the device is used. tap_del_queues() clears q->tap
> under RTNL, before the device can be freed, so a non NULL q->tap
> guarantees the device stays around until rtnl_unlock(). TUNSETOFFLOAD
> already relies on this.
>
> Use rtnl_dereference(q->tap) directly.
>
> Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Technical Details
Message-ID:
<willemdebruijn.kernel.e221ffaa921e@gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer04.iad!feed-me.highwinds-media.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367438-linux-kernel-netdev=dewy.ruReferences:
<20261119072258.3157902-1-edumazet@kernel.org> <20261119072258.3157902-5-edumazet@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer04.iad!feed-me.highwinds-media.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367438-linux-kernel-netdev=dewy.ru From: willemdebruijn.kernel@gmail.com (Willem de Bruijn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 4/4] tap: remove tap_get_tap_dev() and tap_put_tap_dev() Date: Thu, 19 Nov 2026 19:03:21 -0500 Organization: Usenet Network Message-ID: <willemdebruijn.kernel.e221ffaa921e@gmail.com> References: <20261119072258.3157902-1-edumazet@kernel.org> <20261119072258.3157902-5-edumazet@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="3015876"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:PoryaSiPGNccBTixrjxOFJXueMY= sha256:S8ltQiKNQge8tMMoqI4tpI33mIihfFE4ZvqwgM3dNq8= sha1:aB5sRfFW2/OqWGxfHIGVdNoVX4c= sha256:hQN/06ioc5pJWBulkurW0zUxOFu9/g0fK1BM7xG/MCE= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 28BAB115810; Fri, 20 Nov 2026 03:03:46 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.049 X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q4mIaR9Xadvr; Fri, 20 Nov 2026 03:03:43 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-367438-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 014D2115125; Fri, 20 Nov 2026 03:03:34 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 19E422649C2; Fri, 20 Nov 2026 00:03:27 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795133006; b=Q8QvxxeKAxlQxpdTZxlJXj5n58/MTcE7+4718wD02Co7QVGyRcxQ6RhWQUY2hlmNeXSU pG2akkEt8Wj0BKEy5lTHUGhDnXFaqR0zktR767uEWR8BBUr8B/AELBjSkyYu0Jn8y/B1j AfqGnMv9atcecw7xgTkOIJPAscGp/mAnQU8M9Syh5zqu1W1B1tVxVa0hKTv41uoSTgjQ4 YcJEXWDmDMPeBbF0xXHwJ440o3xnuDx7b8CGLiUgqm0JixiBnIkxJLFuUX2zQi5i2jRco mgMuWBl82z6oyevfhsbitvvq3vfgUdBWZkahy0SEZ+5SZEYwWWFlKtXjX1Zmi51lH6A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795133006; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:Date:From:To:Cc:Message-ID:In-Reply-To: References:Subject:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Type:Content-Transfer-Encoding; bh=qX3sjmsKWyJLgJKQz7CR3/3TQ9oKhkHisfSxdP4egWY=; b=yfBFbDw7IXtsQJskAT3G7ZZ8coIXDxt7vBPNrbXo0x4uyBAUEJhBDPxqHiYb1o+kAquh m0IqzzermKEL69394pso7T6dXtlNhEYyLeiYPvqxeW2qIlF0kWmiQXSCxOzmjStkAh/kg RiHKyd/s4KuOGBXUPxCNgB2u9IJo52vYh5dn+1pHHzY37bWwp/wiX+imJ+Me2FUfekvSN TEIX5EPnPGLwkqDJBMXfTv+jwp3/VXjaQ+YsfSskTD+pEBWQ39bJ5G2v0rPMuvOOnpM46 Duhv56jKh3/xkC5P6ygXIHb3Nohl5kTeeC0wLEGWpfA8mm9ZrNmILmcjdSm41T9EVGg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=CCf1ah2r; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01EC360A2613; Fri, 20 Nov 2026 00:03:26 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=CCf1ah2r X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.180 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795133005; b=l9A3aiiM/BeK0wmSZ54WOVaGzWJvpVqyG5DYpVKPT1X+kv+9bI4X6l4FSEEx+1CR1Zvj YRMUkbmYEVi/zw6uxrEwxiug/uktfUIs2V5lqlQeqtiA4IA3rPGc/IEh64c4WNo+I783j dHSPPc4bJUfHHY+neXLqWGAkQPT5I+rIJj0ILZIWtzsRv5PzAaBuJ15s0wg40sEqUJAlq aaw4ojirQRcglvzLncUBwK9ga9Y4psx0LHs1ONfUmPuzte3yo4P8x+J2yrmvSh42xf5cA tUBcucuzMvmPHAAS2adpq0/YsAka/djDMABOAKRBJU6KrA1EFk284ent19V+J6J37SA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795133005; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=qX3sjmsKWyJLgJKQz7CR3/3TQ9oKhkHisfSxdP4egWY=; b=ZRtEF806BnzKn7oH9Qdji/lQPK21/DDGLmfPvjSzNfFv+l91p0cAjl4bd8+pv+50OL13 pykAR28zgdMKrSGdetyQtsyeJTwBqF0Hgd3Ounogf/vauRTb1sPEL8bjyyA1NB6va5zPd KzLpjijVCay2QnjXWJuAvKFefSp6Yziwt18Prxqqd/WvYFGzKMY37/1gugeoyZ7jH66AJ isf0t9BMM5e/B2rZiNoxBv2hzTQIfyEpUNbS+Sye2HnSxWLzLPHqOKXDXfWpM/56Opj0b 6rUUhAsjmNdXlq11Zckreg3k35JmAFY8T1V2KLxevZaqjxtLKd8pkcgqVcPiGuh1jqA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=CCf1ah2r; arc=none smtp.remote-ip=209.85.222.180 X-Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D8CD606A330 for <netdev@vger.kernel.org>; Fri, 20 Nov 2026 00:03:23 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5D8CD606A330 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com X-Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-9496400270fso31790685a.1 for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 16:03:23 -0800 (PST) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795133002; x=1795737802; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:subject :references:in-reply-to:message-id:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to:content-type; bh=qX3sjmsKWyJLgJKQz7CR3/3TQ9oKhkHisfSxdP4egWY=; b=CCf1ah2rUECxTd+CtbA6vuqAb10VO+eDjDXTYB1a9zilYGbdU37tb3+N1yeAPobi30 dcyu63Q5edMJ9S4lGe+Dx0X1G0ct20tWnsQef+en9swzcaua7AKXV6ERLS3XWVSD5jZW n/w2+4mlCjqfvJ1wl6+oZyXKAd7T7XD7iA/yCQ8ZalDWLIm+D1GwVLA+HvB/zwtkll/P 6nGi9wjoqhzVVUXYvY2LOolFRbEslxOs+vlVZJ++tbN9fIJEq3TLiS1ZbvWB0Zz9NDxg LH6nAdizTPNmyMF5OdCBTC5MB2iYZHa2F5bkFGu1FnX1zCL44IuX9o8rlv4BP1Fg25dB fNiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795133002; x=1795737802; h=content-transfer-encoding:content-type:mime-version:subject :references:in-reply-to:message-id:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=qX3sjmsKWyJLgJKQz7CR3/3TQ9oKhkHisfSxdP4egWY=; b=x0onhTVd9auxbrbfBd3ycEqnU6LHeI9n9gRiCGcPyTlfuG6cNRIAi7nPorG6UW3Dj4 +exmeeVN9kqeHc97YCz5Nn1TJEzqVqo2BCMKNwAIxG02uMSlqL1VtQ9hUjU4Xe1YzL3u FmMsFElOvFL2Sm+43dVI2twd+7YMaVvGSA+scGtgu0YlfqAWOhbiXXuOyXXJVwmsGIDF CRaZjDGBH+B2t0BVZVJuJnewukCmH1N7SmosFHGWa7cEGZ/UqW57pdNPV8gZaMppc5qD /d5CdUsQtBcRIrPuTSKKOFOwTg+blgtsw3Rcio4sr/TVBsumBYJUIn8tqWNuGSP8G9JC FBqA== X-Forwarded-Encrypted: i=1; AL+hErEAdlXYfRwGOuuYOMjqDmdAQa4e+ayCg0SmKJO3pTnI/XXLtFfq/7GC3/ZNquKP44lh1oNDUl8=@vger.kernel.org X-Gm-Message-State: APuU4Z9lHtwBDC09eKI3j4erufEf46kKzN05qPjy0ZIDrRwEIlYCKyws OyuAQQNJyprwk+T37GWA1FQrvyc1NC+ZrXvlHzfWSi0GuVabVtwlWGfsDukPcg== X-Gm-Gg: AYBFou38q31WN/MPJFMH9FMs7c87mjtV3cRAnSBXJcen69ewE7pYICtVxXLzLQCLNOC PeYAjAmwLnXJAgOBO34iVS0SFyGjD4yREfHPIzbLBr0ZgNwgSDfpmAm5n4O0uWiS/gCJbMgeKHI fsg7e3fTrVZO0Uap0lCKShn3tUvyu2N6JErlzrsF3Ug/50n3goKwGCCn7aP6BHenAi6JXJbC0Xp Wi/M/gZB9noMazuSGHvfyy+KHBj4Is73OxRCLwqr2Gq6A8KFpwxSHXHtawsW6jjZLJjPugOckCo NzEDU41/iz/sn+7W51+H4L8Cxki77FUAByNGVRxDfb5/NAhPiutQL/o5hgPbPyNJNYbrFyuU1QR LZy7znYUJWYe//ozKP/mQtDz/e99LwAjRLe8KC3p8Kvzfw6eo2MxCV/oy4NTqJnmQEpdF08n6oJ 4VizsTAan3mvvm6ZfvnrZKhXgebLySZouK/eqd8bqCL/pWQ3+JAvAu687b4xrEa9JrOFz9ZWX20 w564Zd0WyMvEvPE5En/cKF5izhUxvFDuYjmdCXME8ChmKJECW/w56OXlY3yVDZ2A2urJ1jAxicC jXOk9fpTH3LX5hZYzezai/eTuyZsDg02RF6aSRhzFg0vp9TiP9QxQY32E6AYkn/z++8SB5yIu8W xaPKrmwnw/jhjaCfeS0DYGjeJg2s4iaquXmIUtnSdsTVWkAOzucHseIhLaYSPfoWI X-Received: by 2002:a05:620a:45a4:b0:945:ad46:5e19 with SMTP id af79cd13be357-949ba9f9eafmr234949485a.38.1795133002061; Thu, 19 Nov 2026 16:03:22 -0800 (PST) X-Received: from gmail.com (15.60.86.34.bc.googleusercontent.com. [34.86.60.15]) by smtp.gmail.com with ESMTPSA id af79cd13be357-949bb34ae74sm74818085a.8.2026.11.19.16.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2026 16:03:21 -0800 (PST) X-Cc: Kuniyuki Iwashima <kuniyu@google.com>, Simon Horman <horms@kernel.org>, netdev@vger.kernel.org, Eric Dumazet <edumazet@kernel.org> X-In-Reply-To: <20261119072258.3157902-5-edumazet@kernel.org> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-Received-Bytes: 11542