提交 3f96a532 编写于 作者: D Daniel Borkmann 提交者: David S. Miller

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: NDuan Jiong <duanj.fnst@cn.fujitsu.com>
Reported-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
Suggested-by: NVlad Yasevich <vyasevich@gmail.com>
Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d82a7f54
...@@ -634,8 +634,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info) ...@@ -634,8 +634,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
break; break;
case ICMP_REDIRECT: case ICMP_REDIRECT:
sctp_icmp_redirect(sk, transport, skb); sctp_icmp_redirect(sk, transport, skb);
err = 0; /* Fall through to out_unlock. */
break;
default: default:
goto out_unlock; goto out_unlock;
} }
......
...@@ -183,7 +183,7 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -183,7 +183,7 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
break; break;
case NDISC_REDIRECT: case NDISC_REDIRECT:
sctp_icmp_redirect(sk, transport, skb); sctp_icmp_redirect(sk, transport, skb);
break; goto out_unlock;
default: default:
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册