ipv6: remove max_addresses check from ipv6_create_tempaddr
ipv6: remove max_addresses check from ipv6_create_tempaddr

Because of the max_addresses check attackers were able to disable privacy
extensions on an interface by creating enough autoconfigured addresses:

<http://seclists.org/oss-sec/2012/q4/292>

But the check is not actually needed: max_addresses protects the
kernel to install too many ipv6 addresses on an interface and guards
addrconf_prefix_rcv to install further addresses as soon as this limit
is reached. We only generate temporary addresses in direct response of
a new address showing up. As soon as we filled up the maximum number of
addresses of an interface, we stop installing more addresses and thus
also stop generating more temp addresses.

Even if the attacker tries to generate a lot of temporary addresses
by announcing a prefix and removing it again (lifetime == 0) we won't
install more temp addresses, because the temporary addresses do count
to the maximum number of addresses, thus we would stop installing new
autoconfigured addresses when the limit is reached.

This patch fixes CVE-2013-0343 (but other layer-2 attacks are still
possible).

Thanks to Ding Tianhong to bring this topic up again.

Cc: Ding Tianhong <6319509b12a56ad4c8f781f7750eb8df2374d4fd@huawei.com>
Cc: George Kargiotakis <ffb15996fbc13fa6b09ea106c56839bf095707ba@void.gr>
Cc: P J P <585c0bc855c02f2056a33cd71c7dba0870c26e8e@redhat.com>
Cc: YOSHIFUJI Hideaki <948b80da4254122ea1e8973dd9930d46b7654cf3@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <331be22c6b63ca3e0a03d408c2d906b1b02cd5f2@stressinduktion.org>
Acked-by: Ding Tianhong <6319509b12a56ad4c8f781f7750eb8df2374d4fd@huawei.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs