Skip to content

Commit da10739

Browse files
committed
netfilter: nf_tables: reject immediate NF_QUEUE verdict
nft_queue is always used from userspace nftables to deliver the NF_QUEUE verdict. Immediately emitting an NF_QUEUE verdict is never used by the userspace nft tools, so reject immediate NF_QUEUE verdicts. The arp family does not provide queue support, but such an immediate verdict is still reachable. Globally reject NF_QUEUE immediate verdicts to address this issue. Fixes: f342de4 ("netfilter: nf_tables: reject QUEUE/DROP verdict parameters") Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 3d5d488 commit da10739

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

net/netfilter/nf_tables_api.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11667,8 +11667,6 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data,
1166711667
switch (data->verdict.code) {
1166811668
case NF_ACCEPT:
1166911669
case NF_DROP:
11670-
case NF_QUEUE:
11671-
break;
1167211670
case NFT_CONTINUE:
1167311671
case NFT_BREAK:
1167411672
case NFT_RETURN:
@@ -11703,6 +11701,11 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data,
1170311701

1170411702
data->verdict.chain = chain;
1170511703
break;
11704+
case NF_QUEUE:
11705+
/* The nft_queue expression is used for this purpose, an
11706+
* immediate NF_QUEUE verdict should not ever be seen here.
11707+
*/
11708+
fallthrough;
1170611709
default:
1170711710
return -EINVAL;
1170811711
}

0 commit comments

Comments
 (0)