mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
ipv6: weaken the v4mapped source check
[ Upstream commit dcc32f4f183ab8479041b23a1525d48233df1d43 ] This reverts commit6af1799aaf. Commit6af1799aaf("ipv6: drop incoming packets having a v4mapped source address") introduced an input check against v4mapped addresses. Use of such addresses on the wire is indeed questionable and not allowed on public Internet. As the commit pointed out https://tools.ietf.org/html/draft-itojun-v6ops-v4mapped-harmful-02 lists potential issues. Unfortunately there are applications which use v4mapped addresses, and breaking them is a clear regression. For example v4mapped addresses (or any semi-valid addresses, really) may be used for uni-direction event streams or packet export. Since the issue which sparked the addition of the check was with TCP and request_socks in particular push the check down to TCPv6 and DCCP. This restores the ability to receive UDPv6 packets with v4mapped address as the source. Keep using the IPSTATS_MIB_INHDRERRORS statistic to minimize the user-visible changes. Fixes:6af1799aaf("ipv6: drop incoming packets having a v4mapped source address") Reported-by: Sunyi Shao <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Acked-by: Mat Martineau <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
1225bb45c8
commit
120589bb09
3 changed files with 10 additions and 10 deletions
|
|
@ -319,6 +319,11 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
|
|||
if (!ipv6_unicast_destination(skb))
|
||||
return 0; /* discard, don't send a reset here */
|
||||
|
||||
if (ipv6_addr_v4mapped(&ipv6_hdr(skb)->saddr)) {
|
||||
__IP6_INC_STATS(sock_net(sk), NULL, IPSTATS_MIB_INHDRERRORS);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dccp_bad_service_code(sk, service)) {
|
||||
dcb->dccpd_reset_code = DCCP_RESET_CODE_BAD_SERVICE_CODE;
|
||||
goto drop;
|
||||
|
|
|
|||
Loading…
Reference in a new issue