Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp326730pxj; Tue, 18 May 2021 04:26:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhuyZ5QDtx66zuTl3c5uVWtTmt+X3Kn3RylUpjrC4Fj4Cw0DkDEL6ZPjmhc2BlyAeaB2Sw X-Received: by 2002:a05:6602:189:: with SMTP id m9mr3785306ioo.88.1621337166764; Tue, 18 May 2021 04:26:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621337166; cv=none; d=google.com; s=arc-20160816; b=VFoGdT2iw3riZodurdoBN/VG72BbiJBJVWl+k05o4v/8eOrbr1KOdNAYGgtDBgAEeb OXCxtC2HwADcnL1XRbBGBJW+3R6h8rgHZjqD41A1M6P8izLU+vpmo2KZiiNN1b8nbiK6 tVo1J372xcp7XoijxaA5M8/lUYiPmggZXOs9CnxKyozQOYRe4H7JDmC+dg9rIWS0Kw4G 8RIi2wRLxY4uRix3lIWz1kA3QkYbnWbjnh6ro7vuxiA+kIsnBDushEyrVBV/XLhx+FvU UPUgtO5LSTN4IEj3UvGWeah7WHgHtmjGxP5S71Se/05VeOGG5TkCJjKFtznd9XyL9WQC NfcA== 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=+NOUyUQS+4HeMbPl0O4BIfMuqP0KSP7+2v1Y633Slp0=; b=fbdOMmcWCywBtPbiKg5ILdmoDBP+F9G4o/lJEj0m1U3Cbao1alBw4ht7qxLeEdsOd2 YXEYWaChhnzDxGXPRv0eP4BVk0sxjUgxrPi7fbNNYdlCSppxyKEPp4asEmLYBTlJEOkb tJRRE4IlM428Z9SBwXvMNkzzmc7L+ucrOsRacSLcILeOBga+kKPYyNI4s4j53jaDBdE8 OLkmsGn0HTlekXyB4HwgNvPEebissiHJodK0PqFrl6upBJN0a6MmwFtBrfo2DSzH3PG9 ws7wYeds24FbqbqCCTZRGytmuCyOTTPBBJgzeEouBfWbFL1xRdHT9UbfndqMrjex5sIr 5DOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LzON36rq; 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 n6si23441568jal.41.2021.05.18.04.25.53; Tue, 18 May 2021 04:26:06 -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=LzON36rq; 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 S244355AbhEQPUU (ORCPT + 99 others); Mon, 17 May 2021 11:20:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:52138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242802AbhEQPIM (ORCPT ); Mon, 17 May 2021 11:08:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB2A561C3C; Mon, 17 May 2021 14:29:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261783; bh=1HjC/k5i0BI0a2v026BL5CiQ24teuEMz303WlF0h9yQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LzON36rq6qrhOmYrlmtgkwYM00+S6uzkh73MW/1JpJYyfXm0RPpR8afHxNnK2vu2a nPtiQhuNJRqfORwCcX83r2D/fYPfiXSx7YLfFl/giFKSIDohwJN8cgNpyYRvV7Kkj0 9gsjfRVJ/GoAHLboKfIfHh+m0Z+P+3hXdozVmaWg= 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 5.10 065/289] sctp: Fix out-of-bounds warning in sctp_process_asconf_param() Date: Mon, 17 May 2021 15:59:50 +0200 Message-Id: <20210517140307.383293011@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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 9a56ae2f3651..b9d6babe2870 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -3126,7 +3126,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)); if (security_sctp_bind_connect(asoc->ep->base.sk, SCTP_PARAM_SET_PRIMARY, -- 2.30.2