Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp69518pxj; Thu, 20 May 2021 04:47:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrHehPf6K8TY5Hwo2jfa/2D5twrPsw2+3Uz1PluWa9cV1rW5R75sTI+GMkbzgg770/BFy/ X-Received: by 2002:a05:6402:34d5:: with SMTP id w21mr4588762edc.38.1621511270358; Thu, 20 May 2021 04:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621511270; cv=none; d=google.com; s=arc-20160816; b=jJ60tUCunZF+YgCBbukoCH67i2pdh79HeLrmSqrKSxYT4N3stx+e8hZ2/fN95sehv4 Vbr66/XKSc7DDsapRv/yi3luI/D1EEoYjSXwBQesOzdXw1Qum9DIsgqMtlgC7V5x452x wFRJv47RtfqLE3uNH1fuJ+BPEuvwrKw6UHzMMt+Fu5yUJw7TQl6jJjym7dJTLNaQO5/V PGIw6COjMCnqqHbKQ3y963KkbZC289Rtue1/3flv73KNrowOFUqClUFbZPdGoP9hgXPW jKC8sgW4aQWFX5diVL1UKetyCS5hjdyvnYNQ12TQoty12zqef+P1LGuD6Ya17R6rWMxI yXig== 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=SbjDoM7W1soA4Fh9ReP380Mh/eBVhhX9CR2P70Hn9Ko=; b=kgTg+CXNTE6W+Mw5Ku/QwVFg9UvnkyaVd8t6emzgLABjeNeFWSzlnp+pLOqkgR0aAd CWvWXlNprmTfZkca9ZZsfalaVCITcB3Nd7iTqf6ru5mmhcHn4Udw9bIe1zNFZFw4GVeu ebRXzz6Rgc0Jho8vaElWhKDWt/pGkTtaVnPqkQDlr91nO7QrIP+K627dkZ+PpZyt1z4O mDsUHjeZYmGya4Z6mk/gy1tGl5kyL96iocRStw5QOKlU2Gcuqo9NjR2cetQk/FPARqgl RRBMekyoYmSOhHIq26Ud7N7ajtbhEKQ4TAHog/qo5R8G1nl9A3nobFrxnimMUi1j1xpj YXaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q3zLjwPf; 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 w6si156888edd.217.2021.05.20.04.47.21; Thu, 20 May 2021 04:47:50 -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=Q3zLjwPf; 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 S242162AbhETLq3 (ORCPT + 99 others); Thu, 20 May 2021 07:46:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:43346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241171AbhETLWZ (ORCPT ); Thu, 20 May 2021 07:22:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AE10F61438; Thu, 20 May 2021 10:11:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505505; bh=Y/xh6Xavdcp1CPtWYiw5QqH7hCEQh/7VA2kWDA+2bj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q3zLjwPfGJvQqdruoiFpqhmqe1slUpvdXC+da8PADEg+joYXB/sd7uXLKZBcSbKsJ GT2WFqQ78L7peL+Jpf49EXcm6BABf1CEkK2ePRlCen4yvAINnaTDzX3DorhMkhJ2BD EOgBI2kf06RedGfeCZjSg414cT7Lrjlbkic8OL8s= 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.4 148/190] sctp: Fix out-of-bounds warning in sctp_process_asconf_param() Date: Thu, 20 May 2021 11:23:32 +0200 Message-Id: <20210520092107.075901822@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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 e3e44237de1c..9de03d2e5da9 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -3119,7 +3119,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