linux/include
Pablo Neira Ayuso eb014de4fd netfilter: nf_tables: autoload modules from the abort path
This patch introduces a list of pending module requests. This new module
list is composed of nft_module_request objects that contain the module
name and one status field that tells if the module has been already
loaded (the 'done' field).

In the first pass, from the preparation phase, the netlink command finds
that a module is missing on this list. Then, a module request is
allocated and added to this list and nft_request_module() returns
-EAGAIN. This triggers the abort path with the autoload parameter set on
from nfnetlink, request_module() is called and the module request enters
the 'done' state. Since the mutex is released when loading modules from
the abort phase, the module list is zapped so this is iteration occurs
over a local list. Therefore, the request_module() calls happen when
object lists are in consistent state (after fulling aborting the
transaction) and the commit list is empty.

On the second pass, the netlink command will find that it already tried
to load the module, so it does not request it again and
nft_request_module() returns 0. Then, there is a look up to find the
object that the command was missing. If the module was successfully
loaded, the command proceeds normally since it finds the missing object
in place, otherwise -ENOENT is reported to userspace.

This patch also updates nfnetlink to include the reason to enter the
abort phase, which is required for this new autoload module rationale.

Fixes: ec7470b834 ("netfilter: nf_tables: store transaction list locally while requesting module")
Reported-by: syzbot+29125d208b3dae9a7019@syzkaller.appspotmail.com
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2020-01-24 20:54:29 +01:00
..
acpi Merge branches 'acpi-utils', 'acpi-platform', 'acpi-video' and 'acpi-doc' 2019-11-26 10:30:49 +01:00
asm-generic powerpc updates for 5.5 #2 2019-12-06 13:36:31 -08:00
clocksource x86/hyperv: Initialize clockevents earlier in CPU onlining 2019-11-15 10:33:49 +01:00
crypto crypto: ablkcipher - remove deprecated and unused ablkcipher support 2019-11-17 09:02:49 +08:00
drm mm + drm coherent memory support for vmwgfx 2019-11-30 09:38:11 -08:00
dt-bindings ARM: Device-tree updates 2019-12-05 12:09:47 -08:00
keys powerpc updates for 5.5 2019-11-30 14:35:43 -08:00
kunit
kvm
linux netfilter: nf_tables: autoload modules from the abort path 2020-01-24 20:54:29 +01:00
math-emu
media drm main pull for 5.5-rc1 2019-11-27 17:45:48 -08:00
misc
net netfilter: nf_tables: autoload modules from the abort path 2020-01-24 20:54:29 +01:00
pcmcia
ras
rdma IB/core: Introduce rdma_user_mmap_entry_insert_range() API 2019-12-12 16:55:36 -05:00
scsi scsi: target: iscsi: Wait for all commands to finish before freeing a session 2019-11-19 21:37:35 -05:00
soc drm msm + fixes for 5.5-rc1 2019-12-06 10:28:09 -08:00
sound ASoC: Fixes for v5.5 2019-12-17 14:18:32 +01:00
target
trace tracing: Change offset type to s32 in preempt/irq tracepoints 2020-01-03 11:34:37 -05:00
uapi kcov: fix struct layout for kcov_remote_arg 2020-01-04 13:55:09 -08:00
vdso
video
xen xen/interface: re-define FRONT/BACK_RING_ATTACH() 2019-12-20 13:44:42 +01:00