Stable Archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev, Pablo Neira Ayuso <pablo@netfilter.org>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.15 38/80] netfilter: nf_tables: honor table dormant flag from netdev release event path
Date: Tue, 30 Apr 2024 12:40:10 +0200	[thread overview]
Message-ID: <20240430103044.543303303@linuxfoundation.org> (raw)
In-Reply-To: <20240430103043.397234724@linuxfoundation.org>

5.15-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pablo Neira Ayuso <pablo@netfilter.org>

[ Upstream commit 8e30abc9ace4f0add4cd761dfdbfaebae5632dd2 ]

Check for table dormant flag otherwise netdev release event path tries
to unregister an already unregistered hook.

[524854.857999] ------------[ cut here ]------------
[524854.858010] WARNING: CPU: 0 PID: 3386599 at net/netfilter/core.c:501 __nf_unregister_net_hook+0x21a/0x260
[...]
[524854.858848] CPU: 0 PID: 3386599 Comm: kworker/u32:2 Not tainted 6.9.0-rc3+ #365
[524854.858869] Workqueue: netns cleanup_net
[524854.858886] RIP: 0010:__nf_unregister_net_hook+0x21a/0x260
[524854.858903] Code: 24 e8 aa 73 83 ff 48 63 43 1c 83 f8 01 0f 85 3d ff ff ff e8 98 d1 f0 ff 48 8b 3c 24 e8 8f 73 83 ff 48 63 43 1c e9 26 ff ff ff <0f> 0b 48 83 c4 18 48 c7 c7 00 68 e9 82 5b 5d 41 5c 41 5d 41 5e 41
[524854.858914] RSP: 0018:ffff8881e36d79e0 EFLAGS: 00010246
[524854.858926] RAX: 0000000000000000 RBX: ffff8881339ae790 RCX: ffffffff81ba524a
[524854.858936] RDX: dffffc0000000000 RSI: 0000000000000008 RDI: ffff8881c8a16438
[524854.858945] RBP: ffff8881c8a16438 R08: 0000000000000001 R09: ffffed103c6daf34
[524854.858954] R10: ffff8881e36d79a7 R11: 0000000000000000 R12: 0000000000000005
[524854.858962] R13: ffff8881c8a16000 R14: 0000000000000000 R15: ffff8881351b5a00
[524854.858971] FS:  0000000000000000(0000) GS:ffff888390800000(0000) knlGS:0000000000000000
[524854.858982] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[524854.858991] CR2: 00007fc9be0f16f4 CR3: 00000001437cc004 CR4: 00000000001706f0
[524854.859000] Call Trace:
[524854.859006]  <TASK>
[524854.859013]  ? __warn+0x9f/0x1a0
[524854.859027]  ? __nf_unregister_net_hook+0x21a/0x260
[524854.859044]  ? report_bug+0x1b1/0x1e0
[524854.859060]  ? handle_bug+0x3c/0x70
[524854.859071]  ? exc_invalid_op+0x17/0x40
[524854.859083]  ? asm_exc_invalid_op+0x1a/0x20
[524854.859100]  ? __nf_unregister_net_hook+0x6a/0x260
[524854.859116]  ? __nf_unregister_net_hook+0x21a/0x260
[524854.859135]  nf_tables_netdev_event+0x337/0x390 [nf_tables]
[524854.859304]  ? __pfx_nf_tables_netdev_event+0x10/0x10 [nf_tables]
[524854.859461]  ? packet_notifier+0xb3/0x360
[524854.859476]  ? _raw_spin_unlock_irqrestore+0x11/0x40
[524854.859489]  ? dcbnl_netdevice_event+0x35/0x140
[524854.859507]  ? __pfx_nf_tables_netdev_event+0x10/0x10 [nf_tables]
[524854.859661]  notifier_call_chain+0x7d/0x140
[524854.859677]  unregister_netdevice_many_notify+0x5e1/0xae0

Fixes: d54725cd11a5 ("netfilter: nf_tables: support for multiple devices per netdev hook")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nft_chain_filter.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nft_chain_filter.c b/net/netfilter/nft_chain_filter.c
index 35aa4ea942051..8c76ca4d86a8a 100644
--- a/net/netfilter/nft_chain_filter.c
+++ b/net/netfilter/nft_chain_filter.c
@@ -336,7 +336,9 @@ static void nft_netdev_event(unsigned long event, struct net_device *dev,
 		return;
 
 	if (n > 1) {
-		nf_unregister_net_hook(ctx->net, &found->ops);
+		if (!(ctx->chain->table->flags & NFT_TABLE_F_DORMANT))
+			nf_unregister_net_hook(ctx->net, &found->ops);
+
 		list_del_rcu(&found->list);
 		kfree_rcu(found, rcu);
 		return;
-- 
2.43.0




  parent reply	other threads:[~2024-04-30 11:17 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 10:39 [PATCH 5.15 00/80] 5.15.158-rc1 review Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 01/80] smb: client: fix rename(2) regression against samba Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 02/80] cifs: reinstate original behavior again for forceuid/forcegid Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 03/80] HID: intel-ish-hid: ipc: Fix dev_err usage with uninitialized dev->devc Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 04/80] HID: logitech-dj: allow mice to use all types of reports Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 05/80] arm64: dts: rockchip: enable internal pull-up on Q7_USB_ID for RK3399 Puma Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 06/80] arm64: dts: rockchip: fix alphabetical ordering RK3399 puma Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 07/80] arm64: dts: rockchip: enable internal pull-up on PCIE_WAKE# for RK3399 Puma Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 08/80] arm64: dts: rockchip: Remove unsupported node from the Pinebook Pro dts Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 09/80] arm64: dts: mediatek: mt8183: Add power-domains properity to mfgcfg Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 10/80] arm64: dts: mediatek: mt7622: add support for coherent DMA Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 11/80] arm64: dts: mediatek: mt7622: introduce nodes for Wireless Ethernet Dispatch Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 12/80] arm64: dts: mediatek: mt7622: fix clock controllers Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 13/80] arm64: dts: mediatek: mt7622: fix IR nodename Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 14/80] arm64: dts: mediatek: mt7622: fix ethernet controller "compatible" Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 15/80] arm64: dts: mediatek: mt7622: drop "reset-names" from thermal block Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 16/80] arm64: dts: mediatek: mt2712: fix validation errors Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 17/80] ARC: [plat-hsdk]: Remove misplaced interrupt-cells property Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 18/80] wifi: iwlwifi: mvm: remove old PASN station when adding a new one Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 19/80] wifi: iwlwifi: mvm: return uid from iwl_mvm_build_scan_cmd Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 20/80] vxlan: drop packets from invalid src-address Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 21/80] mlxsw: core: Unregister EMAD trap using FORWARD action Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 22/80] icmp: prevent possible NULL dereferences from icmp_build_probe() Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 23/80] bridge/br_netlink.c: no need to return void function Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 24/80] NFC: trf7970a: disable all regulators on removal Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 25/80] ipv4: check for NULL idev in ip_route_use_hint() Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 26/80] net: usb: ax88179_178a: stop lying about skb->truesize Greg Kroah-Hartman
2024-04-30 10:39 ` [PATCH 5.15 27/80] net: gtp: Fix Use-After-Free in gtp_dellink Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 28/80] ipvs: Fix checksumming on GSO of SCTP packets Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 29/80] net: openvswitch: Fix Use-After-Free in ovs_ct_exit Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 30/80] mlxsw: spectrum_acl_tcam: Fix race during rehash delayed work Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 31/80] mlxsw: spectrum_acl_tcam: Fix possible use-after-free during activity update Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 32/80] mlxsw: spectrum_acl_tcam: Fix possible use-after-free during rehash Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 33/80] mlxsw: spectrum_acl_tcam: Rate limit error message Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 34/80] mlxsw: spectrum_acl_tcam: Fix memory leak during rehash Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 35/80] mlxsw: spectrum_acl_tcam: Fix warning " Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 36/80] mlxsw: spectrum_acl_tcam: Fix incorrect list API usage Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 37/80] mlxsw: spectrum_acl_tcam: Fix memory leak when canceling rehash work Greg Kroah-Hartman
2024-04-30 10:40 ` Greg Kroah-Hartman [this message]
2024-04-30 10:40 ` [PATCH 5.15 39/80] i40e: Do not use WQ_MEM_RECLAIM flag for workqueue Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 40/80] i40e: Report MFS in decimal base instead of hex Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 41/80] iavf: Fix TC config comparison with existing adapter TC config Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 42/80] net: ethernet: ti: am65-cpts: Fix PTPv1 message type on TX packets Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 43/80] af_unix: Suppress false-positive lockdep splat for spin_lock() in __unix_gc() Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 44/80] serial: core: Provide port lock wrappers Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 45/80] serial: mxs-auart: add spinlock around changing cts state Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 46/80] drm-print: add drm_dbg_driver to improve namespace symmetry Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 47/80] drm/vmwgfx: Fix crtcs atomic check conditional Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 48/80] Revert "crypto: api - Disallow identical driver names" Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 49/80] net/mlx5e: Fix a race in command alloc flow Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 50/80] tracing: Show size of requested perf buffer Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 51/80] tracing: Increase PERF_MAX_TRACE_SIZE to handle Sentinel1 and docker together Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 52/80] x86/cpu: Fix check for RDPKRU in __show_regs() Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 53/80] Bluetooth: Fix type of len in {l2cap,sco}_sock_getsockopt_old() Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 54/80] Bluetooth: btusb: Add Realtek RTL8852BE support ID 0x0bda:0x4853 Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 55/80] Bluetooth: qca: fix NULL-deref on non-serdev suspend Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 56/80] mmc: sdhci-msm: pervent access to suspended controller Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 57/80] btrfs: fix information leak in btrfs_ioctl_logical_to_ino() Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 58/80] cpu: Re-enable CPU mitigations by default for !X86 architectures Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 59/80] arm64: dts: rockchip: enable internal pull-up for Q7_THRM# on RK3399 Puma Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 60/80] drm/amdgpu/sdma5.2: use legacy HDP flush for SDMA2/3 Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 61/80] drm/amdgpu: Fix leak when GPU memory allocation fails Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 62/80] irqchip/gic-v3-its: Prevent double free on error Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 63/80] ethernet: Add helper for assigning packet type when dest address does not match device address Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 64/80] net: b44: set pause params only when interface is up Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 65/80] stackdepot: respect __GFP_NOLOCKDEP allocation flag Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 66/80] mtd: diskonchip: work around ubsan link failure Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 67/80] tcp: Clean up kernel listeners reqsk in inet_twsk_purge() Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 68/80] tcp: Fix NEW_SYN_RECV handling " Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 69/80] dmaengine: owl: fix register access functions Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 70/80] idma64: Dont try to serve interrupts when device is powered off Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 71/80] dma: xilinx_dpdma: Fix locking Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 72/80] dmaengine: idxd: Fix oops during rmmod on single-CPU platforms Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 73/80] riscv: fix VMALLOC_START definition Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 74/80] riscv: Fix TASK_SIZE on 64-bit NOMMU Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 75/80] i2c: smbus: fix NULL function pointer dereference Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 76/80] fbdev: fix incorrect address computation in deferred IO Greg Kroah-Hartman
2024-05-02  8:34   ` Harshit Mogalapalli
2024-04-30 10:40 ` [PATCH 5.15 77/80] HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 78/80] bounds: Use the right number of bits for power-of-two CONFIG_NR_CPUS Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 79/80] udp: preserve the connected status if only UDP cmsg Greg Kroah-Hartman
2024-04-30 10:40 ` [PATCH 5.15 80/80] serial: core: fix kernel-doc for uart_port_unlock_irqrestore() Greg Kroah-Hartman
2024-04-30 16:31 ` [PATCH 5.15 00/80] 5.15.158-rc1 review Harshit Mogalapalli
2024-04-30 16:47 ` SeongJae Park
2024-04-30 18:49 ` Florian Fainelli
2024-05-01  8:52 ` Ron Economos
2024-05-01 10:30 ` Naresh Kamboju
2024-05-01 13:38 ` Jon Hunter
2024-05-02  3:05 ` Shuah Khan
2024-05-02  6:38 ` Pascal Ernster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240430103044.543303303@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=pablo@netfilter.org \
    --cc=patches@lists.linux.dev \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).