Commit f15f29f
committed
netfilter: nf_tables: disallow rule removal from chain binding
Chain binding only requires the rule addition/insertion command within
the same transaction. Removal of rules from chain bindings within the
same transaction makes no sense, userspace does not utilize this
feature. Replace nft_chain_is_bound() check to nft_chain_binding() in
rule deletion commands. Replace command implies a rule deletion, reject
this command too.
Rule flush command can also safely rely on this nft_chain_binding()
check because unbound chains are not allowed since 62e1e94
("netfilter: nf_tables: reject unbound chain set before commit phase").
Fixes: d0e2c7d ("netfilter: nf_tables: add NFT_CHAIN_BINDING")
Reported-by: Kevin Rich <kevinrich1337@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>1 parent 1b36955 commit f15f29f
1 file changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1432 | 1432 | | |
1433 | 1433 | | |
1434 | 1434 | | |
1435 | | - | |
| 1435 | + | |
1436 | 1436 | | |
1437 | 1437 | | |
1438 | 1438 | | |
| |||
1477 | 1477 | | |
1478 | 1478 | | |
1479 | 1479 | | |
1480 | | - | |
| 1480 | + | |
1481 | 1481 | | |
1482 | 1482 | | |
1483 | 1483 | | |
| |||
2910 | 2910 | | |
2911 | 2911 | | |
2912 | 2912 | | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
2913 | 2916 | | |
2914 | 2917 | | |
2915 | 2918 | | |
| |||
3971 | 3974 | | |
3972 | 3975 | | |
3973 | 3976 | | |
| 3977 | + | |
| 3978 | + | |
| 3979 | + | |
| 3980 | + | |
| 3981 | + | |
3974 | 3982 | | |
3975 | 3983 | | |
3976 | 3984 | | |
| |||
4078 | 4086 | | |
4079 | 4087 | | |
4080 | 4088 | | |
4081 | | - | |
| 4089 | + | |
4082 | 4090 | | |
4083 | 4091 | | |
4084 | 4092 | | |
| |||
4112 | 4120 | | |
4113 | 4121 | | |
4114 | 4122 | | |
4115 | | - | |
| 4123 | + | |
4116 | 4124 | | |
4117 | 4125 | | |
4118 | 4126 | | |
| |||
11054 | 11062 | | |
11055 | 11063 | | |
11056 | 11064 | | |
11057 | | - | |
| 11065 | + | |
11058 | 11066 | | |
11059 | 11067 | | |
11060 | 11068 | | |
| |||
0 commit comments