netfilter: nft_dynset: report EOPNOTSUPP on missing set feature
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 27 Dec 2020 11:33:44 +0000 (12:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 19:18:26 +0000 (20:18 +0100)
commit8b109f4cd1dc2224f900702483be81d61beab864
tree669c7820bb67be7f771e3d0a6a014658960c493a
parent810bc977f8a4ae5c68aa35d75ae52c45ae6db0c7
netfilter: nft_dynset: report EOPNOTSUPP on missing set feature

commit 95cd4bca7b1f4a25810f3ddfc5e767fb46931789 upstream.

If userspace requests a feature which is not available the original set
definition, then bail out with EOPNOTSUPP. If userspace sends
unsupported dynset flags (new feature not supported by this kernel),
then report EOPNOTSUPP to userspace. EINVAL should be only used to
report malformed netlink messages from userspace.

Fixes: 22fe54d5fefc ("netfilter: nf_tables: add support for dynamic set updates")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nft_dynset.c