]> git.baikalelectronics.ru Git - kernel.git/commit
[NETFILTER]: Fix possible overflow in netfilters do_replace()
authorKirill Korotaev <dev@openvz.org>
Sat, 4 Feb 2006 10:16:56 +0000 (02:16 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 5 Feb 2006 07:51:25 +0000 (23:51 -0800)
commit67073864baa70fc32241a04b17d1dfb402ba71f1
tree85a6ba60fc5782d77779f466f1ad5f2ec4330914
parent0edf793b4d5f8f9f6df11142db66f9be10c35fad
[NETFILTER]: Fix possible overflow in netfilters do_replace()

netfilter's do_replace() can overflow on addition within SMP_ALIGN()
and/or on multiplication by NR_CPUS, resulting in a buffer overflow on
the copy_from_user().  In practice, the overflow on addition is
triggerable on all systems, whereas the multiplication one might require
much physical memory to be present due to the check above.  Either is
sufficient to overwrite arbitrary amounts of kernel memory.

I really hate adding the same check to all 4 versions of do_replace(),
but the code is duplicate...

Found by Solar Designer during security audit of OpenVZ.org

Signed-Off-By: Kirill Korotaev <dev@openvz.org>
Signed-Off-By: Solar Designer <solar@openwall.com>
Signed-off-by: Patrck McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/netfilter/ebtables.c
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_tables.c
net/ipv6/netfilter/ip6_tables.c