Commit f342de4
netfilter: nf_tables: reject QUEUE/DROP verdict parameters
This reverts commit e0abdad.
core.c:nf_hook_slow assumes that the upper 16 bits of NF_DROP
verdicts contain a valid errno, i.e. -EPERM, -EHOSTUNREACH or similar,
or 0.
Due to the reverted commit, its possible to provide a positive
value, e.g. NF_ACCEPT (1), which results in use-after-free.
Its not clear to me why this commit was made.
NF_QUEUE is not used by nftables; "queue" rules in nftables
will result in use of "nft_queue" expression.
If we later need to allow specifiying errno values from userspace
(do not know why), this has to call NF_DROP_GETERR and check that
"err <= 0" holds true.
Fixes: e0abdad ("netfilter: nf_tables: accept QUEUE/DROP verdict parameters")
Cc: stable@vger.kernel.org
Reported-by: Notselwyn <notselwyn@pwning.tech>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>1 parent b462579 commit f342de4
1 file changed
Lines changed: 6 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10992 | 10992 | | |
10993 | 10993 | | |
10994 | 10994 | | |
10995 | | - | |
10996 | | - | |
10997 | | - | |
10998 | | - | |
10999 | | - | |
11000 | | - | |
11001 | | - | |
11002 | | - | |
11003 | | - | |
11004 | | - | |
| 10995 | + | |
| 10996 | + | |
| 10997 | + | |
| 10998 | + | |
11005 | 10999 | | |
11006 | 11000 | | |
11007 | 11001 | | |
| |||
11036 | 11030 | | |
11037 | 11031 | | |
11038 | 11032 | | |
| 11033 | + | |
| 11034 | + | |
11039 | 11035 | | |
11040 | 11036 | | |
11041 | 11037 | | |
| |||
0 commit comments