Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4408042pxu; Mon, 12 Oct 2020 19:19:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzKDz7ghmpoCLMOG+feGMFneqWestEIPWo0ieuiLYIbjCwmQYd6GOmQX/FLrZxlv85iV0L X-Received: by 2002:a17:906:c802:: with SMTP id cx2mr819985ejb.298.1602555584894; Mon, 12 Oct 2020 19:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602555584; cv=none; d=google.com; s=arc-20160816; b=yMPjtw+dwxhG+f3vMWy9nDfN+5GoePTSV/BzRMrcCr3EeNnMqXg0/rMnihfx7DKQmB zVk7OjrG+CRDm/HPuW5wb//Yv1l+vlVuTRKKXaWdvZdggztdgBPY+9Gp4TvIHm2ylpav uXcShAhSxfANXsAYSbBfpguIIQG1QGJ8qEX2AD79gDbYCDkmo2HRzOKERWivnwcRhe33 ViGJ1Oy4uufDT5fzkTHg5CuDXsKc+j2CAug2pFSPVCcVjv/c+qTaZu/MCnEKy5r0VBHW xSGz9l21f1iqaXrT3iOKllMS3cpGu069A33960pJAVD8YnpuR7HbalhH45mJxCiLZJfw bplQ== 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=E41mRO2hlNXjZpDie5xsQftJ5jSO1ZVuz/HcaRnKRyo=; b=JsO/l7SRzvQIupiPOeUPmwpPJD7dKVNG8PwVLTLzecsMa+LZedlVBAv0RzFuA0w4q9 eiEEma1XqM9YzrgVuYDr8kBNWgcw0O7U0B4fRiRk21c1ZYFPHXDosncxbqu7LgUKI9ts ljd8L50wmDJ2pe11wkTtVInptkEFyX0dUOo+WlBUHQzoec1EaeE4dCicG4P+ECgFkS0N HG/hVzeAAMebvxWNGd16PoiakmfYxXUmNGWu8PaPw+3HSCtbVx3eo1pYJi7zI3yzKIrz OMY5fK3y6wg3xnvMVKWLcDSrP+YXRmJZtwjZOwiCgddN4jRZ0W2wRhat4ghnDyLAn1dI j19g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=javoQrK5; 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=fail (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 d18si13558653ejz.660.2020.10.12.19.19.22; Mon, 12 Oct 2020 19:19:44 -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=@kernel.org header.s=default header.b=javoQrK5; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731594AbgJLOBM (ORCPT + 99 others); Mon, 12 Oct 2020 10:01:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:40660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731237AbgJLNin (ORCPT ); Mon, 12 Oct 2020 09:38:43 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C68C422203; Mon, 12 Oct 2020 13:38:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602509898; bh=RfuSN0CYEh4oojDPhHRz7Tt45yQDJvi6iWf2+2azS9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=javoQrK5mUlsV7v3oyJ5smGwUi+jSvsk5r8AC1x/nNgoh4EPm7bK+rk6OtTm3u9yR /AUIvOZ/g8vjQRlt4FZsd3UJR+tV2iNp56i6aFM3dNEwJpSjUXcln5J+R7Lpis2t+D yQ9b++OV5rd2SwgczJEVKvuM6UlDg7fe1UukDHL0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Antony Antony , Steffen Klassert , Sasha Levin Subject: [PATCH 4.14 56/70] xfrm: clone whole liftime_cur structure in xfrm_do_migrate Date: Mon, 12 Oct 2020 15:27:12 +0200 Message-Id: <20201012132632.873988755@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132630.201442517@linuxfoundation.org> References: <20201012132630.201442517@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: Antony Antony [ Upstream commit 8366685b2883e523f91e9816d7be371eb1144749 ] When we clone state only add_time was cloned. It missed values like bytes, packets. Now clone the all members of the structure. v1->v3: - use memcpy to copy the entire structure Fixes: 80c9abaabf42 ("[XFRM]: Extension for dynamic update of endpoint address(es)") Signed-off-by: Antony Antony Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin --- net/xfrm/xfrm_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 37104258808a8..3f21d34833cf0 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -1427,7 +1427,7 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, x->tfcpad = orig->tfcpad; x->replay_maxdiff = orig->replay_maxdiff; x->replay_maxage = orig->replay_maxage; - x->curlft.add_time = orig->curlft.add_time; + memcpy(&x->curlft, &orig->curlft, sizeof(x->curlft)); x->km.state = orig->km.state; x->km.seq = orig->km.seq; x->replay = orig->replay; -- 2.25.1