linux-stable/include
Jozsef Kadlecsik 8964cc36ba netfilter: ipset: Rework long task execution when adding/deleting entries
[ Upstream commit 5e29dc36bd ]

When adding/deleting large number of elements in one step in ipset, it can
take a reasonable amount of time and can result in soft lockup errors. The
patch 5f7b51bf09 ("netfilter: ipset: Limit the maximal range of
consecutive elements to add/delete") tried to fix it by limiting the max
elements to process at all. However it was not enough, it is still possible
that we get hung tasks. Lowering the limit is not reasonable, so the
approach in this patch is as follows: rely on the method used at resizing
sets and save the state when we reach a smaller internal batch limit,
unlock/lock and proceed from the saved state. Thus we can avoid long
continuous tasks and at the same time removed the limit to add/delete large
number of elements in one step.

The nfnl mutex is held during the whole operation which prevents one to
issue other ipset commands in parallel.

Fixes: 5f7b51bf09 ("netfilter: ipset: Limit the maximal range of consecutive elements to add/delete")
Reported-by: syzbot+9204e7399656300bf271@syzkaller.appspotmail.com
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-12 12:02:26 +01:00
..
acpi ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() 2022-10-13 20:40:09 +02:00
asm-generic 15 hotfixes. 11 marked cc:stable. Only three or four of the latter 2022-12-02 13:39:38 -08:00
clocksource
crypto
drm drm/edid: add a quirk for two LG monitors to get them to work on 10bpc 2022-12-31 13:32:59 +01:00
dt-bindings dt-bindings: clocks: imx8mp: Add ID for usb suspend clock 2022-12-31 13:33:09 +01:00
keys
kunit kunit: declare kunit_assert structs as const 2022-10-07 10:19:18 -06:00
kvm
linux netfilter: ipset: Rework long task execution when adding/deleting entries 2023-01-12 12:02:26 +01:00
math-emu
media media: dvbdev: fix build warning due to comments 2022-12-31 13:33:12 +01:00
memory
misc
net tcp: Add TIME_WAIT sockets in bhash2. 2023-01-12 12:02:15 +01:00
pcmcia
ras
rdma
rv
scsi SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
soc ARM: at91: pm: avoid soft resetting AC DLL 2022-11-01 12:25:19 +02:00
sound ALSA: hda/hdmi: fix stream-id config keep-alive for rt suspend 2022-12-31 13:33:07 +01:00
target
trace ext4: disable fast-commit of encrypted dir operations 2023-01-07 11:12:00 +01:00
uapi eventpoll: add EPOLL_URING_WAKE poll wakeup flag 2023-01-04 11:28:47 +01:00
ufs SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
vdso
video
xen xen/virtio: enable grant based virtio on x86 2022-10-10 14:31:26 +02:00