Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp558381pxj; Thu, 20 May 2021 16:11:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN0AFfMh6HKSGlW2TcmB33Fp4Dq9aw+xHfgvvmAHbd4jNLPiwVQNQfFjP54mGtEtZvvvrC X-Received: by 2002:a17:906:b0c:: with SMTP id u12mr6975565ejg.37.1621552303067; Thu, 20 May 2021 16:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621552303; cv=none; d=google.com; s=arc-20160816; b=QtBNTRrtF8DVueVZvmhWWEP39uhq10pLXCpgk3v7kJWAStnKBnz+p3EMOC7NlfPSP8 wlwyTIBPyh3uqDI5YUeeDp0Vpd3fuoTNKllWjR6/qj/Evxy2wqsP/lMBctcIO0a5kcyL frLEF93HfIlVX1NTDviAIkifB7kI439gze8Iw+MwD6Hf6MYykQExBOx88Nsmt6iRbt1S kF0XZ7HLz1hYXNMgK2C44VYhVywA/0of4rIvueNfH1dlB3WuGCLUhcW1zLLeKTWS44sG 9VeDfku2G84AUZztji3r+mc7rJ4+ZJSmvKXyWwechYDPcy1wbz5N6wBtSdhtZ50u+FUq nTtg== 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=FUmCHv1eMK2Q2rSuDuTGYzTnUmyyCNWKQhFDBAC2gr0=; b=UOkYNi68fz6uOCuBKEjNHsamfHA0l7J11LPFb7mnbJTikFoqJlC0bKkHrR0GsfN/lJ nswc8hV9mMicHAW4T3IQBb/aIH68GiIf3VpZoSeXT6F29VXXAmTKSEsWugOTaXHfHM1H tJ0Fack7NltNLjH/nothLmwC48EH4FTvXyA/uIeRy+Fw8nUL3INRMAuJArglN/rSXJAL pIy/PkF6orQRptK14w2YY7V30BTcvMPt7k77yTrKoDseWepb2u8651iRu0lYJiXGgroi hciDVfWVfTLLBgRS3c3dLbrqpKnz2Uln9CI3g64xt7Ww2ze1XzDe1ZHmT9qoeN7tycW0 ieJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ktjqvsWt; 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 hs23si3999461ejc.454.2021.05.20.16.11.19; Thu, 20 May 2021 16:11:43 -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=ktjqvsWt; 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 S241445AbhETLYb (ORCPT + 99 others); Thu, 20 May 2021 07:24:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:40076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239838AbhETLEL (ORCPT ); Thu, 20 May 2021 07:04:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 43A136192E; Thu, 20 May 2021 10:04:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505088; bh=I1dKAXDrlgwd23mPxYMBal13a1O7mdsg0UdBO80a/5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ktjqvsWtELlY9h8TjbNHS36Jt6dGR8JIPxW83dJdy37LE6KpJZoeBpk8F0zvzcyOF ePeGyv2xXv9el5bxzneJBkUYkwallyZAQFJp6nRL6ORxPaOeUvWzaTsZlwSnZre0rW SCjSWm/jn7kEEfhTmyy020KXDFOr5D1SEoFNPcAA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , "Gustavo A. R. Silva" , Kees Cook , Marcelo Ricardo Leitner , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 183/240] sctp: Fix out-of-bounds warning in sctp_process_asconf_param() Date: Thu, 20 May 2021 11:22:55 +0200 Message-Id: <20210520092114.801228174@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092108.587553970@linuxfoundation.org> References: <20210520092108.587553970@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: Gustavo A. R. Silva [ Upstream commit e5272ad4aab347dde5610c0aedb786219e3ff793 ] Fix the following out-of-bounds warning: net/sctp/sm_make_chunk.c:3150:4: warning: 'memcpy' offset [17, 28] from the object at 'addr' is out of the bounds of referenced subobject 'v4' with type 'struct sockaddr_in' at offset 0 [-Warray-bounds] This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy(). Link: https://github.com/KSPP/linux/issues/109 Reported-by: kernel test robot Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/sctp/sm_make_chunk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index acb0c2631c79..0c5aff3bb539 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -3129,7 +3129,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc, * primary. */ if (af->is_any(&addr)) - memcpy(&addr.v4, sctp_source(asconf), sizeof(addr)); + memcpy(&addr, sctp_source(asconf), sizeof(addr)); peer = sctp_assoc_lookup_paddr(asoc, &addr); if (!peer) -- 2.30.2