Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp2119681lkv; Thu, 20 May 2021 03:53:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFnsnlId+Z+ELdgrh7GZq/bia+u6OL/N1ggnK5v8VHYpiS6Q6/ouyrrxZCAZW4/NomPOnb X-Received: by 2002:a17:906:3883:: with SMTP id q3mr4067481ejd.4.1621507983890; Thu, 20 May 2021 03:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621507983; cv=none; d=google.com; s=arc-20160816; b=ZaCm1dUYQuAfP7ThgS8l4CpJ/TfLQSzMazpltFmrXN3WuoSDGKqWnbRZVHA1fWzu1c yPflf9vwn3gMv+Y7qEwgLjXLJ8jv13if0rXlPgUhEb/TmowsCKiw9KLnwVj3k2IDhr6V mSvyDsxq/zmslZeeOhkSAbtcpxRqTeuiCI3RSWGSi9KLXyOV17v6tdaWQT97zMXy84Wx gp7BxizVoeh+OVro/Tp0W8YbTlcXuadk2QnzZzCWLTIvv15k9NE5+dEPJZfqSDf7EKyG DIPw/6HffHdU9rsKrb8n/XrDZn0h2OTInxGPWBWf7lW5JXtC3B3jIrObBVaJXRyNt89H ryaw== 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=7VesoO2Cuf3jTP1iVpBuv/w0pnLXJelPaNEef7u6pJw=; b=x/DtHQpV5G+DsHb2j0xmPkqpCcsoYJ5WclFa43URDIb89z/4le5XIKMyAZrdwJlBDM 8jSTWU8lvby4wwTHAeYV6eJKmPtz0HL/4GSykYsBIk1taRIB6DTuI5R5YpNSU4ML6uug owB1hfu2NV/ix77UHhyybkGauslmh9o04r85kqBtaOwR7we0/5fkrN6QueB4TlshLQip hI+GxcSqncCQL7ByjW0WUs0wmedsPXJddCkzpcvvJ/X4XdDbC1/c4N9KdpooyOOhvj5C saeVbHqcC8mmvydHW2FtH2MZPQYHRCIboMqAeXpiN4RZS5rI6ETyG8jw4f4gfblJ2OYL gEfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HP6vruu0; 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 du20si2586149ejc.738.2021.05.20.03.52.39; Thu, 20 May 2021 03:53:03 -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=HP6vruu0; 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 S234178AbhETKv5 (ORCPT + 99 others); Thu, 20 May 2021 06:51:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:40014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237895AbhETKf7 (ORCPT ); Thu, 20 May 2021 06:35:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 18C6261C65; Thu, 20 May 2021 09:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504444; bh=EHvLyATiwv4EdYTMj6qm+X9ydCmJNiK4K4TBnVzu/x0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HP6vruu0AE8UyVlP7iAqUIM6XUVx88n/FYL8Bch1z0fjuTKDcRgv8xppT70lbBqF4 +zNxlNN1BJ3CKAGypZM+G2JxVSc4hHOKNdfTCuKba/Tqu20Fmk5Dq2znl2wTbh2kCT BRAsJ7PULa0GcRzylzRVnzTlWis5SOASXvnMCnCA= 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.14 249/323] sctp: Fix out-of-bounds warning in sctp_process_asconf_param() Date: Thu, 20 May 2021 11:22:21 +0200 Message-Id: <20210520092128.726584410@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 e698edd56bd5..1cd22a38fe42 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -3128,7 +3128,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