netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: move ip6_sk_accept_pmtu from generic pmtu update path to ipv6 one
@ 2013-12-19 11:54 Hannes Frederic Sowa
  2013-12-19 12:57 ` Daniel Borkmann
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Frederic Sowa @ 2013-12-19 11:54 UTC (permalink / raw)
  To: netdev; +Cc: fengguang.wu

In commit 93b36cf3425b9b ("ipv6: support IPV6_PMTU_INTERFACE on sockets")
I made a horrible mistake to add ip6_sk_accept_pmtu to the generic
sctp_icmp_frag_needed path. This results in build warnings if IPv6 is
disabled which were luckily caught by Fengguang's kbuild bot. But it
also leads to a kernel panic IPv4 frag-needed packet is received.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 net/sctp/input.c | 3 ---
 net/sctp/ipv6.c  | 3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/sctp/input.c b/net/sctp/input.c
index 042ec6c..2a192a7 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -389,9 +389,6 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,
 	if (!t || (t->pathmtu <= pmtu))
 		return;
 
-	if (!ip6_sk_accept_pmtu(sk))
-		return;
-
 	if (sock_owned_by_user(sk)) {
 		asoc->pmtu_pending = 1;
 		t->pmtu_pending = 1;
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 32db816..00bea3f 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -172,7 +172,8 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 
 	switch (type) {
 	case ICMPV6_PKT_TOOBIG:
-		sctp_icmp_frag_needed(sk, asoc, transport, ntohl(info));
+		if (ip6_sk_accept_pmtu(sk))
+			sctp_icmp_frag_needed(sk, asoc, transport, ntohl(info));
 		goto out_unlock;
 	case ICMPV6_PARAMPROB:
 		if (ICMPV6_UNK_NEXTHDR == code) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] ipv6: move ip6_sk_accept_pmtu from generic pmtu update path to ipv6 one
  2013-12-19 11:54 [PATCH net-next] ipv6: move ip6_sk_accept_pmtu from generic pmtu update path to ipv6 one Hannes Frederic Sowa
@ 2013-12-19 12:57 ` Daniel Borkmann
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Borkmann @ 2013-12-19 12:57 UTC (permalink / raw)
  To: netdev, fengguang.wu; +Cc: linux-sctp@vger.kernel.org, Hannes Frederic Sowa

On 12/19/2013 12:54 PM, Hannes Frederic Sowa wrote:
> In commit 93b36cf3425b9b ("ipv6: support IPV6_PMTU_INTERFACE on sockets")
> I made a horrible mistake to add ip6_sk_accept_pmtu to the generic
> sctp_icmp_frag_needed path. This results in build warnings if IPv6 is
> disabled which were luckily caught by Fengguang's kbuild bot. But it
> also leads to a kernel panic IPv4 frag-needed packet is received.
>
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Thanks, also cc'ing linux-sctp.

Fixes: 93b36cf3425b ("ipv6: support IPV6_PMTU_INTERFACE on sockets")
Acked-by: Daniel Borkmann <dborkman@redhat.com>

> ---
>   net/sctp/input.c | 3 ---
>   net/sctp/ipv6.c  | 3 ++-
>   2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/net/sctp/input.c b/net/sctp/input.c
> index 042ec6c..2a192a7 100644
> --- a/net/sctp/input.c
> +++ b/net/sctp/input.c
> @@ -389,9 +389,6 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,
>   	if (!t || (t->pathmtu <= pmtu))
>   		return;
>
> -	if (!ip6_sk_accept_pmtu(sk))
> -		return;
> -
>   	if (sock_owned_by_user(sk)) {
>   		asoc->pmtu_pending = 1;
>   		t->pmtu_pending = 1;
> diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
> index 32db816..00bea3f 100644
> --- a/net/sctp/ipv6.c
> +++ b/net/sctp/ipv6.c
> @@ -172,7 +172,8 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
>
>   	switch (type) {
>   	case ICMPV6_PKT_TOOBIG:
> -		sctp_icmp_frag_needed(sk, asoc, transport, ntohl(info));
> +		if (ip6_sk_accept_pmtu(sk))
> +			sctp_icmp_frag_needed(sk, asoc, transport, ntohl(info));
>   		goto out_unlock;
>   	case ICMPV6_PARAMPROB:
>   		if (ICMPV6_UNK_NEXTHDR == code) {
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-19 12:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-19 11:54 [PATCH net-next] ipv6: move ip6_sk_accept_pmtu from generic pmtu update path to ipv6 one Hannes Frederic Sowa
2013-12-19 12:57 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).