sctp: fix return value check in __sctp_rcv_asconf_lookup
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Wed, 28 Jul 2021 02:40:54 +0000 (23:40 -0300)
committerSalvatore Bonaccorso <carnil@debian.org>
Wed, 28 Jul 2021 05:55:40 +0000 (06:55 +0100)
Origin: https://lore.kernel.org/linux-sctp/599e6c1fdcc50f16597380118c9b3b6790241d50.1627439903.git.marcelo.leitner@gmail.com/

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>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name sctp-fix-return-value-check-in-__sctp_rcv_asconf_loo.patch

net/sctp/input.c

index f72bff93745c44be0dbfa29e754f2872a7d874c2..ddb5b5c2550ef74520026f80b68a4b4fb9c59431 100644 (file)
@@ -1175,7 +1175,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);