linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xin Long <lucien.xin@gmail.com>
To: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	"linux-sctp @ vger . kernel . org" <linux-sctp@vger.kernel.org>,
	Ben Hutchings <ben@decadent.org.uk>,
	Ilja Van Sprundel <ivansprundel@ioactive.com>,
	Salvatore Bonaccorso <carnil@debian.org>
Subject: Re: [PATCH net] sctp: fix return value check in __sctp_rcv_asconf_lookup
Date: Tue, 27 Jul 2021 22:56:10 -0400	[thread overview]
Message-ID: <CADvbK_c44QfUkW5ZUcNWKuQaagPqdL5_qi7KGbmp4qgorb3X4g@mail.gmail.com> (raw)
In-Reply-To: <599e6c1fdcc50f16597380118c9b3b6790241d50.1627439903.git.marcelo.leitner@gmail.com>

On Tue, Jul 27, 2021 at 10:41 PM Marcelo Ricardo Leitner
<marcelo.leitner@gmail.com> wrote:
>
> As Ben Hutchings noticed, this check should have been inverted: the call
> returns true in case of success.
>
> Reported-by: Ben Hutchings <ben@decadent.org.uk>
> Fixes: 0c5dc070ff3d ("sctp: validate from_addr_param return")
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> ---
>  net/sctp/input.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/sctp/input.c b/net/sctp/input.c
> index eb3c2a34a31c64d5322f326613f4a4a02f8c902e..5ef86fdb11769d9c8a32219c5c7361fc34217b02 100644
> --- a/net/sctp/input.c
> +++ b/net/sctp/input.c
> @@ -1203,7 +1203,7 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(
>         if (unlikely(!af))
>                 return NULL;
>
> -       if (af->from_addr_param(&paddr, param, peer_port, 0))
> +       if (!af->from_addr_param(&paddr, param, peer_port, 0))
>                 return NULL;
>
>         return __sctp_lookup_association(net, laddr, &paddr, transportp);
> --
> 2.31.1
>
Reviewed-by: Xin Long <lucien.xin@gmail.com>

  reply	other threads:[~2021-07-28  2:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28  2:40 [PATCH net] sctp: fix return value check in __sctp_rcv_asconf_lookup Marcelo Ricardo Leitner
2021-07-28  2:56 ` Xin Long [this message]
2021-07-28  8:30 ` patchwork-bot+netdevbpf

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=CADvbK_c44QfUkW5ZUcNWKuQaagPqdL5_qi7KGbmp4qgorb3X4g@mail.gmail.com \
    --to=lucien.xin@gmail.com \
    --cc=ben@decadent.org.uk \
    --cc=carnil@debian.org \
    --cc=ivansprundel@ioactive.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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 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).