]> www.infradead.org Git - users/jedix/linux-maple.git/commit
netfilter: ipset: forbid family for hash:mac sets
authorFlorent Fourcot <florent.fourcot@wifirst.fr>
Mon, 4 Jun 2018 14:51:19 +0000 (16:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:50:23 +0000 (07:50 +0200)
commit52f072f580e4e5acfc65e40273e1cd4b544fbe63
treec2967bc8713922a84ce60d2391fcccbeaf667ab5
parenta47ece2b17c2e28524f8434857e0deab72ada33e
netfilter: ipset: forbid family for hash:mac sets

[ Upstream commit cbdebe481a14b42c45aa9f4ceb5ff19b55de2c57 ]

Userspace `ipset` command forbids family option for hash:mac type:

ipset create test hash:mac family inet4
ipset v6.30: Unknown argument: `family'

However, this check is not done in kernel itself. When someone use
external netlink applications (pyroute2 python library for example), one
can create hash:mac with invalid family and inconsistant results from
userspace (`ipset` command cannot read set content anymore).

This patch enforce the logic in kernel, and forbids insertion of
hash:mac with a family set.

Since IP_SET_PROTO_UNDEF is defined only for hash:mac, this patch has no
impact on other hash:* sets

Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr>
Signed-off-by: Victorien Molle <victorien.molle@wifirst.fr>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/ipset/ip_set_hash_gen.h