]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: reject hook configuration updates on existing chains
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 1 Aug 2016 22:30:38 +0000 (00:30 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 23 Aug 2016 15:44:23 +0000 (17:44 +0200)
commit96f784aabcbd482e7c2bf3877158c596e0db7c00
treeca5b27f8da06607c240090d936f66822e4c4c6c8
parent805c939488fa2b5e32de5266dc1ba2452ea73e8e
netfilter: nf_tables: reject hook configuration updates on existing chains

Currently, if you add a base chain whose name clashes with an existing
non-base chain, nf_tables doesn't complain about this. Similarly, if you
update the chain type, the hook number and priority.

With this patch, nf_tables bails out in case any of this unsupported
operations occur by returning EBUSY.

 # nft add table x
 # nft add chain x y
 # nft add chain x y { type nat hook input priority 0\; }
 <cmdline>:1:1-49: Error: Could not process rule: Device or resource busy
 add chain x y { type nat hook input priority 0; }
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c