alistair23-linux/include/linux/netfilter
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
..
ipset netfilter: ipset: use bitmap infrastructure completely 2020-01-20 17:41:45 +01:00
nf_conntrack_amanda.h netfilter: add missing includes to a number of header-files. 2019-08-13 12:14:39 +02:00
nf_conntrack_common.h netfilter: conntrack: move code to linux/nf_conntrack_common.h. 2019-09-13 12:47:11 +02:00
nf_conntrack_dccp.h netfilter: remove "#ifdef __KERNEL__" guards from some headers. 2019-08-13 12:15:28 +02:00
nf_conntrack_ftp.h netfilter: add missing includes to a number of header-files. 2019-08-13 12:14:39 +02:00
nf_conntrack_h323.h netfilter: remove "#ifdef __KERNEL__" guards from some headers. 2019-08-13 12:15:28 +02:00
nf_conntrack_h323_asn1.h netfilter: add missing includes to a number of header-files. 2019-08-13 12:14:39 +02:00
nf_conntrack_h323_types.h netfilter: add include guard to nf_conntrack_h323_types.h 2019-08-19 13:59:57 +02:00
nf_conntrack_irc.h netfilter: remove "#ifdef __KERNEL__" guards from some headers. 2019-08-13 12:15:28 +02:00
nf_conntrack_pptp.h netfilter: remove "#ifdef __KERNEL__" guards from some headers. 2019-08-13 12:15:28 +02:00
nf_conntrack_proto_gre.h netfilter: remove "#ifdef __KERNEL__" guards from some headers. 2019-08-13 12:15:28 +02:00
nf_conntrack_sane.h netfilter: remove "#ifdef __KERNEL__" guards from some headers. 2019-08-13 12:15:28 +02:00
nf_conntrack_sctp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nf_conntrack_sip.h netfilter: remove "#ifdef __KERNEL__" guards from some headers. 2019-08-13 12:15:28 +02:00
nf_conntrack_snmp.h netfilter: add missing includes to a number of header-files. 2019-08-13 12:14:39 +02:00
nf_conntrack_tcp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nf_conntrack_tftp.h netfilter: add missing includes to a number of header-files. 2019-08-13 12:14:39 +02:00
nf_conntrack_zones_common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfnetlink.h netfilter: nf_tables: autoload modules from the abort path 2020-01-24 20:54:29 +01:00
nfnetlink_acct.h netfilter: nfnetlink_acct: remove useless parameter 2018-03-05 23:15:43 +01:00
nfnetlink_osf.h netfilter: nft_osf: Add version option support 2019-04-08 23:27:12 +02:00
x_tables.h netfilter: remove CONFIG_NETFILTER checks from headers. 2019-09-13 12:47:36 +02:00