Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: sctp: rfc4443: do not report ICMP redirects to user space

Adapt the same behaviour for SCTP as present in TCP for ICMP redirect
messages. For IPv6, RFC4443, section 2.4. says:

...
(e) An ICMPv6 error message MUST NOT be originated as a result of
receiving the following:
...
(e.2) An ICMPv6 redirect message [IPv6-DISC].
...

Therefore, do not report an error to user space, just invoke dst's redirect
callback and leave, same for IPv4 as done in TCP as well. The implication
w/o having this patch could be that the reception of such packets would
generate a poll notification and in worst case it could even tear down the
whole connection. Therefore, stop updating sk_err on redirects.

Reported-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Suggested-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Daniel Borkmann and committed by
David S. Miller
3f96a532 d82a7f54

+2 -3
+1 -2
net/sctp/input.c
··· 634 634 break; 635 635 case ICMP_REDIRECT: 636 636 sctp_icmp_redirect(sk, transport, skb); 637 - err = 0; 638 - break; 637 + /* Fall through to out_unlock. */ 639 638 default: 640 639 goto out_unlock; 641 640 }
+1 -1
net/sctp/ipv6.c
··· 183 183 break; 184 184 case NDISC_REDIRECT: 185 185 sctp_icmp_redirect(sk, transport, skb); 186 - break; 186 + goto out_unlock; 187 187 default: 188 188 break; 189 189 }