mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
ipv6: make fragment identifications less predictable
IPv6 fragment identification generation is way beyond what we use for IPv4 : It uses a single generator. Its not scalable and allows DOS attacks. Now inetpeer is IPv6 aware, we can use it to provide a more secure and scalable frag ident generator (per destination, instead of system wide) This patch : 1) defines a new secure_ipv6_id() helper 2) extends inet_getid() to provide 32bit results 3) extends ipv6_select_ident() with a new dest parameter Reported-by: Fernando Gont <fernando@gont.com.ar> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
21efcfa0ff
commit
87c48fa3b4
7 changed files with 64 additions and 22 deletions
|
@ -1523,6 +1523,21 @@ __u32 secure_ip_id(__be32 daddr)
|
|||
return half_md4_transform(hash, keyptr->secret);
|
||||
}
|
||||
|
||||
__u32 secure_ipv6_id(const __be32 daddr[4])
|
||||
{
|
||||
const struct keydata *keyptr;
|
||||
__u32 hash[4];
|
||||
|
||||
keyptr = get_keyptr();
|
||||
|
||||
hash[0] = (__force __u32)daddr[0];
|
||||
hash[1] = (__force __u32)daddr[1];
|
||||
hash[2] = (__force __u32)daddr[2];
|
||||
hash[3] = (__force __u32)daddr[3];
|
||||
|
||||
return half_md4_transform(hash, keyptr->secret);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_INET
|
||||
|
||||
__u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue