From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx1.secunet.com (mx1.secunet.com [62.96.220.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4032219C566; Tue, 5 May 2026 04:33:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.96.220.36 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777955619; cv=none; b=XeZ4CqVy3+jbMVAEQX7bV29UPLc3mAk9uhk6sFJarajoRXTB324ejMPVZlq1o1jlfDdFmxkIvT7tKfDr3G7CY4flchtsOYXa5qvCFHRvhCYckThc9mZbUovChyMTN0mni7cNEAmurMeuKLJydE2mja5LUK28N1ZWE8fsBxVUj4w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777955619; c=relaxed/simple; bh=+A0pHmpKmr7ukU57OfFtTMgWJ/z3IpbQtf5v4jCezrE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ows1nrWXMdhq5FxqZqcwlgshrduu82f/7FHudmb1/kgxqknyVh6gXnrQzFfa2J6dpDku1v2IU05RtrJ3VR6ce0NcQxIK4vzmAjvixCUgaokVTjT340/GL8HmNOxlICFHpqcwiKfMgltKjvey7+wYbjTD20xdPPv93k5o5Qg1oAY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com; spf=pass smtp.mailfrom=secunet.com; dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.b=Dgkpzr9P; arc=none smtp.client-ip=62.96.220.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=secunet.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.b="Dgkpzr9P" Received: from localhost (localhost [127.0.0.1]) by mx1.secunet.com (Postfix) with ESMTP id 0888A206E9; Tue, 5 May 2026 06:33:37 +0200 (CEST) X-Virus-Scanned: by secunet Received: from mx1.secunet.com ([127.0.0.1]) by localhost (mx1.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KydiItjL--5r; Tue, 5 May 2026 06:33:36 +0200 (CEST) Received: from EXCH-02.secunet.de (rl2.secunet.de [10.32.0.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.secunet.com (Postfix) with ESMTPS id 736B0201E4; Tue, 5 May 2026 06:33:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com 736B0201E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com; s=202301; t=1777955616; bh=c8Dc5CWAd/hhYJH7zXEnN9tyHw5JwEFT3yi77BMQmsw=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=Dgkpzr9PimX2BAe83WlN0oho5J8uIPnXG8TPWb7bkJmHxi/uOPv4XfLJyvi0/PzH+ 9VIUwJ+QAtncmA8EV24YbPtpFRtQ9tF7CRnmiF/U2hz7Hqb+KQkT8Te/cbX4KznLA5 ya2EgbVjXasVTFX5XaT3ILK3VfJntutQ7d9K37vvAF7D3ecZ96eZmT51GVM1osh7eF RgA8mXeOiP17GN75el0QPoLjM89M4T9UAZMKM57OSA2ODtFnEL38mYj+KGTtb+M+Sm B3FFlO2AZdGfj2XoZLa9kYEORFg4FRDbphVmcSXiMLkJSfMTBqDOIwTXoVEZ7gvX7U HFYjFbnCW2dBA== Received: from moon.secunet.de (172.18.149.1) by EXCH-02.secunet.de (10.32.0.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Tue, 5 May 2026 06:33:32 +0200 From: Antony Antony To: Antony Antony , Steffen Klassert , Herbert Xu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , David Ahern , Masahide NAKAMURA , Paul Moore , Stephen Smalley , Ondrej Mosnacek , Jonathan Corbet , Shuah Khan CC: Sabrina Dubroca , , , , , Chiachang Wang , Yan Yan , Subject: [PATCH ipsec-next v8 07/14] xfrm: check family before comparing addresses in migrate Date: Tue, 5 May 2026 06:33:18 +0200 Message-ID: X-Mailer: git-send-email 2.39.5 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: b4 0.15-dev Content-Transfer-Encoding: 8bit X-ClientProxiedBy: EXCH-03.secunet.de (10.32.0.183) To EXCH-02.secunet.de (10.32.0.172) When migrating between different address families, xfrm_addr_equal() cannot meaningfully compare addresses, different lengths. Only call xfrm_addr_equal() when families match, and take the xfrm_state_insert() path when addresses are equal. Fixes: 80c9abaabf42 ("[XFRM]: Extension for dynamic update of endpoint address(es)") Signed-off-by: Antony Antony --- v5->v6: added this patch --- net/xfrm/xfrm_state.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 85fd80520184..327a855253e6 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -2159,10 +2159,11 @@ int xfrm_state_migrate_install(const struct xfrm_state *x, struct xfrm_user_offload *xuo, struct netlink_ext_ack *extack) { - if (xfrm_addr_equal(&x->id.daddr, &m->new_daddr, m->new_family)) { + if (m->new_family == m->old_family && + xfrm_addr_equal(&x->id.daddr, &m->new_daddr, m->new_family)) { /* - * Care is needed when the destination address - * of the state is to be updated as it is a part of triplet. + * Care is needed when the destination address of the state is + * to be updated as it is a part of triplet. */ xfrm_state_insert(xc); } else { -- 2.47.3