Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp365110pxj; Thu, 20 May 2021 11:05:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYeqC00vEOb8FycZl8dbcC2SMfB30XWCyraXHkAdxEcLXcGz5O4mwSHj2sDvW/6HVH45Nf X-Received: by 2002:a5e:c744:: with SMTP id g4mr6937575iop.26.1621533905534; Thu, 20 May 2021 11:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621533905; cv=none; d=google.com; s=arc-20160816; b=AT1h8g7HpD2DYU28oBwZOiIDk9KySjH45o3iUuZc+nQgKqFiHU7BiZ9SoZZ8J2BI6V 43ey3ZtzkrQHnjytxocRkQfc1YBXPb9WZMznFEBX15VtR3C8eXutsectBSJRazODZ8a4 9OlJD1/l7P8N5OMlSlB276EH5truyfu0PKWeXBYrGzcxWLoEaOfPCYypAQasNtfgp1OG 3hGHJARAR4qjOk2sRgCcEpfV8+h/73aM/B8Q7ZJ0AUoqpgNdC0LXoVc1EO8CFZPXEzWO HTl4K6gFU1mZYHgzOOfJ3QMPEoSWXlW0/6r36wRuj1Az5eASkHykSE4u69zDJyKcYLzz TDCg== 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=/24znKAP3ps984pazGRY38k1uKd1adsmytwHzduTEnA=; b=KYpozyCdBVMU30Z7U2RWoZrXV0oBCjUlShhk34bqRdxHvwhLoFcg9QkokN7H0nUnG1 oEvKA4ULV9UcU+j78WCEkH1VfnaOZuNz5q9rbQmwC6N/IkSZT1+3WnEauPA5yvv7iyGR 1rU1/vO8imJrFyQDme21MC6ytcza0oD5W52AXryismUB07TMLAtbf7t31wZXaMdaQ+xB ygUQwQOxM8i2hS90nbqNENeU0tz+Z6UZG2GPpOtcXIkIDyCj/mKMGVd4ECbkOaYtg9Wr WgxoukM8r7SdM+dn9QAMUseJTcwPxwHusg17z9n6W3WZ8CZ5khIu1H+AMyBpRp3wmPa9 6nCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MV2IwzqB; 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 w14si2718936iom.23.2021.05.20.11.04.51; Thu, 20 May 2021 11:05:05 -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=MV2IwzqB; 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 S235470AbhETKMj (ORCPT + 99 others); Thu, 20 May 2021 06:12:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:37248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235555AbhETKFV (ORCPT ); Thu, 20 May 2021 06:05:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3B84060BD3; Thu, 20 May 2021 09:41:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503663; bh=gwFZ3agbq/+KuI2F21BntZUnQo0O7Tuqe1YzjqS5MDc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MV2IwzqBH5+73xIrA6IlsM03mFSJUIxH8g6qtSM4JGhGfkwDpz/EjSC2X4k9LofZb vOU5LHmDmOQMNLcD5C34T/PXuZlRoLgoQZYdnCTi6WPfWCCgTfE1PwwtCdG0GD8I5g aVisR4pr+yAIiojlqJpHFrss7QSqF7hL+2msJYic= 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.19 322/425] sctp: Fix out-of-bounds warning in sctp_process_asconf_param() Date: Thu, 20 May 2021 11:21:31 +0200 Message-Id: <20210520092142.004061745@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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 ce6053be60bc..dc51e14f568e 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -3148,7 +3148,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