From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev, Phil Sutter <phil@nwl.cc>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.1 30/83] netfilter: ipset: Fix for recursive locking warning
Date: Mon, 23 Dec 2024 16:59:09 +0100 [thread overview]
Message-ID: <20241223155354.818610026@linuxfoundation.org> (raw)
In-Reply-To: <20241223155353.641267612@linuxfoundation.org>
6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Phil Sutter <phil@nwl.cc>
[ Upstream commit 70b6f46a4ed8bd56c85ffff22df91e20e8c85e33 ]
With CONFIG_PROVE_LOCKING, when creating a set of type bitmap:ip, adding
it to a set of type list:set and populating it from iptables SET target
triggers a kernel warning:
| WARNING: possible recursive locking detected
| 6.12.0-rc7-01692-g5e9a28f41134-dirty #594 Not tainted
| --------------------------------------------
| ping/4018 is trying to acquire lock:
| ffff8881094a6848 (&set->lock){+.-.}-{2:2}, at: ip_set_add+0x28c/0x360 [ip_set]
|
| but task is already holding lock:
| ffff88811034c048 (&set->lock){+.-.}-{2:2}, at: ip_set_add+0x28c/0x360 [ip_set]
This is a false alarm: ipset does not allow nested list:set type, so the
loop in list_set_kadd() can never encounter the outer set itself. No
other set type supports embedded sets, so this is the only case to
consider.
To avoid the false report, create a distinct lock class for list:set
type ipset locks.
Fixes: f830837f0eed ("netfilter: ipset: list:set set type support")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netfilter/ipset/ip_set_list_set.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c
index 902ff2f3bc72..5cc35b553a04 100644
--- a/net/netfilter/ipset/ip_set_list_set.c
+++ b/net/netfilter/ipset/ip_set_list_set.c
@@ -611,6 +611,8 @@ init_list_set(struct net *net, struct ip_set *set, u32 size)
return true;
}
+static struct lock_class_key list_set_lockdep_key;
+
static int
list_set_create(struct net *net, struct ip_set *set, struct nlattr *tb[],
u32 flags)
@@ -627,6 +629,7 @@ list_set_create(struct net *net, struct ip_set *set, struct nlattr *tb[],
if (size < IP_SET_LIST_MIN_SIZE)
size = IP_SET_LIST_MIN_SIZE;
+ lockdep_set_class(&set->lock, &list_set_lockdep_key);
set->variant = &set_variant;
set->dsize = ip_set_elem_len(set, tb, sizeof(struct set_elem),
__alignof__(struct set_elem));
--
2.39.5
next prev parent reply other threads:[~2024-12-23 16:19 UTC|newest]
Thread overview: 96+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-23 15:58 [PATCH 6.1 00/83] 6.1.122-rc1 review Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 01/83] net: sched: fix ordering of qlen adjustment Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 02/83] PCI/AER: Disable AER service on suspend Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 03/83] PCI: Use preserve_config in place of pci_flags Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 04/83] PCI: vmd: Create domain symlink before pci_bus_add_devices() Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 05/83] usb: cdns3: Add quirk flag to enable suspend residency Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 06/83] ASoC: Intel: sof_sdw: fix jack detection on ADL-N variant RVP Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 07/83] ASoC: Intel: sof_sdw: add quirk for Dell SKU 0B8C Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 08/83] PCI: Add ACS quirk for Broadcom BCM5760X NIC Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 09/83] MIPS: Loongson64: DTS: Fix msi node for ls7a Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 10/83] usb: dwc2: gadget: Dont write invalid mapped sg entries into dma_desc with iommu enabled Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 11/83] PCI: Introduce pci_resource_n() Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 12/83] platform/x86: p2sb: Make p2sb_get_devfn() return void Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 13/83] p2sb: Factor out p2sb_read_from_cache() Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 14/83] p2sb: Introduce the global flag p2sb_hidden_by_bios Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 15/83] p2sb: Move P2SB hide and unhide code to p2sb_scan_and_cache() Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 16/83] p2sb: Do not scan and remove the P2SB device when it is unhidden Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 17/83] i2c: pnx: Fix timeout in wait functions Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 18/83] cxl/region: Fix region creation for greater than x2 switches Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 19/83] net/smc: protect link down work from execute after lgr freed Greg Kroah-Hartman
2024-12-23 15:58 ` [PATCH 6.1 20/83] net/smc: check sndbuf_space again after NOSPACE flag is set in smc_poll Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 21/83] net/smc: check iparea_offset and ipv6_prefixes_cnt when receiving proposal msg Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 22/83] net/smc: check smcd_v2_ext_offset " Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 23/83] net/smc: check return value of sock_recvmsg when draining clc data Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 24/83] net: mscc: ocelot: fix incorrect IFH SRC_PORT field in ocelot_ifh_set_basic() Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 25/83] netdevsim: prevent bad user input in nsim_dev_health_break_write() Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 26/83] ionic: Fix netdev notifier unregister on failure Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 27/83] ionic: use ee->offset when returning sprom data Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 28/83] net: hinic: Fix cleanup in create_rxqs/txqs() Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 29/83] net: ethernet: bgmac-platform: fix an OF node reference leak Greg Kroah-Hartman
2024-12-23 15:59 ` Greg Kroah-Hartman [this message]
2024-12-23 15:59 ` [PATCH 6.1 31/83] net: mdiobus: " Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 32/83] mmc: sdhci-tegra: Remove SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC quirk Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 33/83] KVM: x86: Cache CPUID.0xD XSTATE offsets+sizes during module init Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 34/83] chelsio/chtls: prevent potential integer overflow on 32bit Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 35/83] i2c: riic: Always round-up when calculating bus period Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 36/83] efivarfs: Fix error on non-existent file Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 37/83] hexagon: Disable constant extender optimization for LLVM prior to 19.1.0 Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 38/83] USB: serial: option: add TCL IK512 MBIM & ECM Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 39/83] USB: serial: option: add MeiG Smart SLM770A Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 40/83] USB: serial: option: add Netprisma LCUK54 modules for WWAN Ready Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 41/83] USB: serial: option: add MediaTek T7XX compositions Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 42/83] USB: serial: option: add Telit FE910C04 rmnet compositions Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 43/83] thunderbolt: Improve redrive mode handling Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 44/83] drm/modes: Avoid divide by zero harder in drm_mode_vrefresh() Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 45/83] drm/panel: novatek-nt35950: fix return value check in nt35950_probe() Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 46/83] i915/guc: Reset engine utilization buffer before registration Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 47/83] i915/guc: Ensure busyness counter increases motonically Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 48/83] i915/guc: Accumulate active runtime on gt reset Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 49/83] drm/amdgpu: dont access invalid sched Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 50/83] hwmon: (tmp513) Dont use "proxy" headers Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 51/83] hwmon: (tmp513) Simplify with dev_err_probe() Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 52/83] hwmon: (tmp513) Use SI constants from units.h Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 53/83] hwmon: (tmp513) Fix interpretation of values of Shunt Voltage and Limit Registers Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 54/83] hwmon: (tmp513) Fix Current Register value interpretation Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 55/83] hwmon: (tmp513) Fix interpretation of values of Temperature Result and Limit Registers Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 56/83] sh: clk: Fix clk_enable() to return 0 on NULL clk Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 57/83] zram: refuse to use zero sized block device as backing device Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 58/83] zram: fix uninitialized ZRAM not releasing " Greg Kroah-Hartman
2025-01-08 3:57 ` Sergey Senozhatsky
2024-12-23 15:59 ` [PATCH 6.1 59/83] btrfs: tree-checker: reject inline extent items with 0 ref count Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 60/83] Drivers: hv: util: Avoid accessing a ringbuffer not initialized yet Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 61/83] KVM: x86: Play nice with protected guests in complete_hypercall_exit() Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 62/83] tracing: Fix test_event_printk() to process entire print argument Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 63/83] tracing: Add missing helper functions in event pointer dereference check Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 64/83] tracing: Add "%s" check in test_event_printk() Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 65/83] selftests/bpf: Use asm constraint "m" for LoongArch Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 66/83] io_uring: Fix registered ring file refcount leak Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 67/83] io_uring: check if iowq is killed before queuing Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 68/83] NFS/pnfs: Fix a live lock between recalled layouts and layoutget Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 69/83] of/irq: Fix interrupt-map cell length check in of_irq_parse_imap_parent() Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 70/83] of/irq: Fix using uninitialized variable @addr_len in API of_irq_parse_one() Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 71/83] nilfs2: fix buffer head leaks in calls to truncate_inode_pages() Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 72/83] nilfs2: prevent use of deleted inode Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 73/83] udmabuf: also check for F_SEAL_FUTURE_WRITE Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 74/83] of: Fix error path in of_parse_phandle_with_args_map() Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 75/83] of: Fix refcount leakage for OF node returned by __of_get_dma_parent() Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 76/83] ceph: validate snapdirname option length when mounting Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 77/83] udf: Fix directory iteration for longer tail extents Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 78/83] epoll: Add synchronous wakeup support for ep_poll_callback Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 79/83] io_uring/rw: split io_read() into a helper Greg Kroah-Hartman
2024-12-23 15:59 ` [PATCH 6.1 80/83] io_uring/rw: treat -EOPNOTSUPP for IOCB_NOWAIT like -EAGAIN Greg Kroah-Hartman
2024-12-23 16:00 ` [PATCH 6.1 81/83] io_uring/rw: avoid punting to io-wq directly Greg Kroah-Hartman
2024-12-23 16:00 ` [PATCH 6.1 82/83] dt-bindings: net: fec: add pps channel property Greg Kroah-Hartman
2024-12-23 16:00 ` [PATCH 6.1 83/83] drm/amdgpu: Handle NULL bo->tbo.resource (again) in amdgpu_vm_bo_update Greg Kroah-Hartman
2024-12-23 21:14 ` [PATCH 6.1 00/83] 6.1.122-rc1 review SeongJae Park
2024-12-23 22:45 ` Shuah Khan
2024-12-24 10:24 ` Peter Schneider
2024-12-24 10:30 ` Ron Economos
2024-12-24 13:26 ` Jon Hunter
2024-12-24 19:49 ` Naresh Kamboju
2024-12-25 1:50 ` Zhao Mengmeng
2024-12-26 10:20 ` Muhammad Usama Anjum
2024-12-26 16:49 ` Florian Fainelli
2024-12-26 19:25 ` [PATCH 6.1] " Hardik Garg
2024-12-26 20:20 ` [PATCH 6.1 00/83] " Pavel Machek
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=20241223155354.818610026@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=pablo@netfilter.org \
--cc=patches@lists.linux.dev \
--cc=phil@nwl.cc \
--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