diff options
author | 2016-03-24 21:29:53 +0100 | |
---|---|---|
committer | 2016-03-28 17:59:24 +0200 | |
commit | b301f2538759933cf9ff1f7c4f968da72e3f0757 (patch) | |
tree | 72abfa9ac2ab4f4b5c189834fdc9a7452b8edd26 /net/ipv6 | |
parent | netfilter: nfnetlink_queue: honor NFQA_CFG_F_FAIL_OPEN when netlink unicast f... (diff) | |
download | linux-b301f2538759933cf9ff1f7c4f968da72e3f0757.tar.gz linux-b301f2538759933cf9ff1f7c4f968da72e3f0757.tar.bz2 linux-b301f2538759933cf9ff1f7c4f968da72e3f0757.zip |
netfilter: x_tables: enforce nul-terminated table name from getsockopt GET_ENTRIES
Make sure the table names via getsockopt GET_ENTRIES is nul-terminated
in ebtables and all the x_tables variants and their respective compat
code. Uncovered by KASAN.
Reported-by: Baozeng Ding <sploving1@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 541b59f83595..86b67b70b626 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -1168,6 +1168,7 @@ get_entries(struct net *net, struct ip6t_get_entries __user *uptr, *len, sizeof(get) + get.size); return -EINVAL; } + get.name[sizeof(get.name) - 1] = '\0'; t = xt_find_table_lock(net, AF_INET6, get.name); if (!IS_ERR_OR_NULL(t)) { @@ -1944,6 +1945,7 @@ compat_get_entries(struct net *net, struct compat_ip6t_get_entries __user *uptr, *len, sizeof(get) + get.size); return -EINVAL; } + get.name[sizeof(get.name) - 1] = '\0'; xt_compat_lock(AF_INET6); t = xt_find_table_lock(net, AF_INET6, get.name); |