[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADvbK_c44QfUkW5ZUcNWKuQaagPqdL5_qi7KGbmp4qgorb3X4g@mail.gmail.com>
Date: Tue, 27 Jul 2021 22:56:10 -0400
From: Xin Long <lucien.xin@...il.com>
To: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
Cc: network dev <netdev@...r.kernel.org>,
"linux-sctp @ vger . kernel . org" <linux-sctp@...r.kernel.org>,
Ben Hutchings <ben@...adent.org.uk>,
Ilja Van Sprundel <ivansprundel@...ctive.com>,
Salvatore Bonaccorso <carnil@...ian.org>
Subject: Re: [PATCH net] sctp: fix return value check in __sctp_rcv_asconf_lookup
On Tue, Jul 27, 2021 at 10:41 PM Marcelo Ricardo Leitner
<marcelo.leitner@...il.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@...adent.org.uk>
> Fixes: 0c5dc070ff3d ("sctp: validate from_addr_param return")
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@...il.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@...il.com>
Powered by blists - more mailing lists