Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4403397pxu; Mon, 12 Oct 2020 19:08:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlAN/LMLHqhO/TF4jHLnxOL2qIgBatXC2f/L525EAwrjwUepTTkJ6F8f7YIcgR6bRrdqJn X-Received: by 2002:a17:906:f8d4:: with SMTP id lh20mr9712866ejb.188.1602554912435; Mon, 12 Oct 2020 19:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602554912; cv=none; d=google.com; s=arc-20160816; b=lAHZt1uoT/IwwiT2YBRO+AK/3GI2AxpaZGkZ05NxRJN1RoMJqE/CIK2TIlSBvkNbK0 lrq5qcqy6yrIII7KZ8Z8TR4lkUXc3x2fY7Mp7o9GBsu2nDZPn7FMnBpte/K7CmTE/ZiW 0//RnrIqsb1Cav1fL9+3dSpS77XND7XfBRb/bvtN/CnTo18bgz7RkoEQHtiF9PmyII7f e0C8Z9VXsK4HX35eFvPwlLyRFkMpzT4S2uJUzJxBy5Qrtb/SlfLrEwSGiohA+ajwHeMw YfR1r5kLCitZ3iIdsjSdhaUVtdvw2+ZCYCa7eBX+5O0bsJA3HS/wTDNtp7JIR8jnOfqz B1hg== 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=7lKhKtFYvY7YCGpaJgVnq2MURLsMQLSrVouOfn9A7XY=; b=m9WIt6nwfT9TLm7fcaNDGCyRCqRGzjp3Ej5LMtogsBfVRDmnd8IRXwG+iSzyX23j6j UEgy6kjUxzaS5b9D2N8TClOa4FfxJaGmZAPxelpTL4gENTMPHqDfZsAY45QeTqeYyIUk bSTPcmm0f0xiCvp0LMnFrPU2K52YmBoi6Odz/kg3Ewl/cSIE9uQLBvGoTwXBa5OBwUJy +Qxv7ggqrRH4Ktcqab3dGejrrW2wzGQNBzHsdRi8P0RGmV0ZseobFi2mj9NoSmiCyfNu 8470SrYTZzSzIBO8UqulO7KxD8GzeSl0b9urcK049qFlrOtL1NiqBGh/dGtSurjE3HAo N9Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a6CpIkZx; 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 cf8si12298452ejb.203.2020.10.12.19.07.42; Mon, 12 Oct 2020 19:08:32 -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=a6CpIkZx; 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 S2390226AbgJLN7c (ORCPT + 99 others); Mon, 12 Oct 2020 09:59:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:44166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388761AbgJLNkH (ORCPT ); Mon, 12 Oct 2020 09:40:07 -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 B0C0521BE5; Mon, 12 Oct 2020 13:40:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510006; bh=NfXlcZDQ9qLIRqmyuPHse2/Kqlno7W2uM7cqye/uhsw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a6CpIkZx3+BR5rJs9XtC0hpWyWiJi9u//K18kxp7o+/BIcXUAc5RH7JGpjG+XrAgO FU6jGxwxGhNQ8/7dQQ4xSrqetJlWIuWbynhOlLDe/TmL5VAR9rZEu7EquACwcbfgzc fsvahGd/rOgnxX03YdEOk24ne1DRXQHrsdJexnqA= 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.19 33/49] xfrm: clone whole liftime_cur structure in xfrm_do_migrate Date: Mon, 12 Oct 2020 15:27:19 +0200 Message-Id: <20201012132630.981421586@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132629.469542486@linuxfoundation.org> References: <20201012132629.469542486@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 c2640875ec757..c68eb587c0efb 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -1450,7 +1450,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