Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1644208pxy; Mon, 2 Aug 2021 06:59:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2AZO7nrulnF6o2NfmfOEeb9BeexwsXQQOCabMtqfkzprqTAI/ycnbMoXJkG4WgiBUt0IC X-Received: by 2002:a5d:914b:: with SMTP id y11mr1141842ioq.6.1627912751631; Mon, 02 Aug 2021 06:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627912751; cv=none; d=google.com; s=arc-20160816; b=x5dlCsL30ZFTYRG6NLTU2q5flN0m9t8OIGkKhfeamvyYpeHCtNO5gxMfOXGX3LqIDI QoNEB70chD14hyaPxDryDTDCFgfZh64bOf2w769ZUFD87EcRmcDUY0iMy+GpvQugSLDn HQPuR8TsO0UB4WaNupZeTu3VgVCAGIA2WWwRNQLBxZn+K6hff/0HpBAlQgY6OYCyUcUn b85gUKfG5mDsO5faMbao/22uXlI1eRIKcUyJaVLOjdoygGnfnxm4LevYZhW/hEQ3kcgL Uwu3fosFIfmzwv2ZdAxA4MaS5PMmsUT7LOpxjliRD+rsV3BQMSMkyIeUd8/2WEqwoIb6 mvEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cbnUmkVvOrl+OVx9eLK4WQui8JfjnU8M3WId971/RNc=; b=X5414uMdMX4mUdZgnCDtt+O4sw6CuFfcDaD941BrBJF9CeT+Yvaj/VjjQzf9Y9SS5a BOF1E2BErAG6MWjbo5DBjdkzckpuADPBbA2+oL/Xycw8lcLrmUmx5ZE3R7//+ZWfwa6e 34dn8eY+y18zT5rIsi/5P0lPQOHwPPwRa6iQot8/ogCKLF1Jlib2J5lWr0W975evwH23 wAfdmS+83VRcYUa0zXmvyjWML/HC/GL50V/TcA6F0iCSeP9p/tzOiLgMlRUKq3Jd8Ylb acDNWLjBOb9DH5etLF/g70DjcIZXgmIJKMi4PHqNasVgzf9aXWLaOdgnySPLsr8sXmhD HutQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bNyoDlOX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t15si11961077ilg.47.2021.08.02.06.59.00; Mon, 02 Aug 2021 06:59:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bNyoDlOX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236065AbhHBN6a (ORCPT + 99 others); Mon, 2 Aug 2021 09:58:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:33012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234145AbhHBNv5 (ORCPT ); Mon, 2 Aug 2021 09:51:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B499A60FF2; Mon, 2 Aug 2021 13:51:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627912289; bh=qPNFw5uvkJs4IwC2cWsmY9VclsZe5EvYEaO2ou+uPBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bNyoDlOXLN+mCSNHO8WfFz46qFCDYJWpCsVptxYxMoStyoDKcu8ZMXJLA4e1zCauB KEd8l3+mgcrwo0p/E6kQI+5O/J/W2ukVA17s4fu75G2UOpCUBPtOU3B8sclJrTAWfh pjhV/id2HVK0Btmtphpm6K4QCnfO14iesur1dzHU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Hutchings , Marcelo Ricardo Leitner , Xin Long , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 32/40] sctp: fix return value check in __sctp_rcv_asconf_lookup Date: Mon, 2 Aug 2021 15:45:12 +0200 Message-Id: <20210802134336.412456941@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210802134335.408294521@linuxfoundation.org> References: <20210802134335.408294521@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marcelo Ricardo Leitner [ Upstream commit 557fb5862c9272ad9b21407afe1da8acfd9b53eb ] As Ben Hutchings noticed, this check should have been inverted: the call returns true in case of success. Reported-by: Ben Hutchings Fixes: 0c5dc070ff3d ("sctp: validate from_addr_param return") Signed-off-by: Marcelo Ricardo Leitner Reviewed-by: Xin Long Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 ab84ebf1af4a..db4f917aafd9 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -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); -- 2.30.2