All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: Vlad Yasevich <vyasevich@gmail.com>
Cc: netdev@vger.kernel.org, linux-sctp@vger.kernel.org,
	Mark Thomas <Mark.Thomas@metaswitch.com>,
	Neil Horman <nhorman@tuxdriver.com>
Subject: Re: [PATCH] sctp: Do not trigger BUG_ON when deleting assoc without primary path
Date: Thu, 17 Oct 2013 18:01:22 +0000	[thread overview]
Message-ID: <526025F2.2040304@redhat.com> (raw)
In-Reply-To: <1382031042-27339-1-git-send-email-vyasevich@gmail.com>

On 10/17/2013 07:30 PM, Vlad Yasevich wrote:
> It is possible to enter sctp_cmd_delete_tcb() without having a
> primary path.  The situations this most often happens in is
> when duplication cookie processing is triggered.  In this
> case, we are deleting a temporarily created association that
> is not fully populated.   Additially, at the time we
> are deleting the offending association, it is really too
> late to issue a BUG!
>
> This was introduced by:
> commit f9e42b853523cda0732022c2e0473c183f7aec65
> 	net: sctp: sideeffect: throw BUG if primary_path is NULL

Sure, lets remove it, but then we could still get a WARN() [sure,
better than BUG], if the user at the very same time checks procfs
through sctp_seq_dump_local_addrs(), see discussion we had here [1]:

  It may trigger the crash later if the user performs some action on the
  association that touches the primary. That's the reason why I was
  proposing the checks below.

  With the checks in command interpreter, we are only left with the
  possibility that primary_path changes to NULL during the association
  lifetime, which code audit doesn't support right now.  If that ever
  changes we would at least have a bit more information to go on.

  [1] http://patchwork.ozlabs.org/patch/251099/

> diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
> index 666c668..1a6eef3 100644
> --- a/net/sctp/sm_sideeffect.c
> +++ b/net/sctp/sm_sideeffect.c
> @@ -860,7 +860,6 @@ static void sctp_cmd_delete_tcb(sctp_cmd_seq_t *cmds,
>   	    (!asoc->temp) && (sk->sk_shutdown != SHUTDOWN_MASK))
>   		return;
>
> -	BUG_ON(asoc->peer.primary_path = NULL);
>   	sctp_unhash_established(asoc);
>   	sctp_association_free(asoc);
>   }
>

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Borkmann <dborkman@redhat.com>
To: Vlad Yasevich <vyasevich@gmail.com>
Cc: netdev@vger.kernel.org, linux-sctp@vger.kernel.org,
	Mark Thomas <Mark.Thomas@metaswitch.com>,
	Neil Horman <nhorman@tuxdriver.com>
Subject: Re: [PATCH] sctp: Do not trigger BUG_ON when deleting assoc without primary path
Date: Thu, 17 Oct 2013 20:01:22 +0200	[thread overview]
Message-ID: <526025F2.2040304@redhat.com> (raw)
In-Reply-To: <1382031042-27339-1-git-send-email-vyasevich@gmail.com>

On 10/17/2013 07:30 PM, Vlad Yasevich wrote:
> It is possible to enter sctp_cmd_delete_tcb() without having a
> primary path.  The situations this most often happens in is
> when duplication cookie processing is triggered.  In this
> case, we are deleting a temporarily created association that
> is not fully populated.   Additially, at the time we
> are deleting the offending association, it is really too
> late to issue a BUG!
>
> This was introduced by:
> commit f9e42b853523cda0732022c2e0473c183f7aec65
> 	net: sctp: sideeffect: throw BUG if primary_path is NULL

Sure, lets remove it, but then we could still get a WARN() [sure,
better than BUG], if the user at the very same time checks procfs
through sctp_seq_dump_local_addrs(), see discussion we had here [1]:

  It may trigger the crash later if the user performs some action on the
  association that touches the primary. That's the reason why I was
  proposing the checks below.

  With the checks in command interpreter, we are only left with the
  possibility that primary_path changes to NULL during the association
  lifetime, which code audit doesn't support right now.  If that ever
  changes we would at least have a bit more information to go on.

  [1] http://patchwork.ozlabs.org/patch/251099/

> diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
> index 666c668..1a6eef3 100644
> --- a/net/sctp/sm_sideeffect.c
> +++ b/net/sctp/sm_sideeffect.c
> @@ -860,7 +860,6 @@ static void sctp_cmd_delete_tcb(sctp_cmd_seq_t *cmds,
>   	    (!asoc->temp) && (sk->sk_shutdown != SHUTDOWN_MASK))
>   		return;
>
> -	BUG_ON(asoc->peer.primary_path == NULL);
>   	sctp_unhash_established(asoc);
>   	sctp_association_free(asoc);
>   }
>

  reply	other threads:[~2013-10-17 18:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-17 17:30 [PATCH] sctp: Do not trigger BUG_ON when deleting assoc without primary path Vlad Yasevich
2013-10-17 17:30 ` Vlad Yasevich
2013-10-17 18:01 ` Daniel Borkmann [this message]
2013-10-17 18:01   ` Daniel Borkmann
2013-10-17 18:25   ` Daniel Borkmann
2013-10-17 18:25     ` Daniel Borkmann
2013-10-17 18:35     ` Vlad Yasevich
2013-10-17 18:35       ` Vlad Yasevich
2013-10-17 18:52       ` Daniel Borkmann
2013-10-17 18:52         ` Daniel Borkmann
2013-10-18 20:38 ` David Miller
2013-10-18 20:38   ` David Miller
2013-10-19 17:31   ` Vlad Yasevich
2013-10-19 17:31     ` Vlad Yasevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=526025F2.2040304@redhat.com \
    --to=dborkman@redhat.com \
    --cc=Mark.Thomas@metaswitch.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=vyasevich@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.