From patchwork Mon Jan 24 18:46:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 535050 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39A7BC433FE for ; Mon, 24 Jan 2022 23:54:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2365450AbiAXXu5 (ORCPT ); Mon, 24 Jan 2022 18:50:57 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:53904 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573325AbiAXVou (ORCPT ); Mon, 24 Jan 2022 16:44:50 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6D0E3B8105C; Mon, 24 Jan 2022 21:44:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FE1FC340E4; Mon, 24 Jan 2022 21:44:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060687; bh=cMFAZwDQpgjABQ2Q/fX+54tfhOManCJbXO3VeKI8TMU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hmpGdyrx9bwPeeVzRdkFfeYc6fkrVve81IzlTEa7Hy5PBq+16A0kyW5wwLL5wzeGC jJYZlerHqA9JCM2KwjZMGQYPCbMflSzYVOZf9cwyid91GSUtWh8FguePCJM+ocCTCU k4myKoZ23plLH9i8RJaXxfjV+mY/+g/fAS43laL4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jussi Maki , Saeed Mahameed , Gal Pressman , Moshe Tal , Jay Vosburgh , "David S. Miller" Subject: [PATCH 5.16 1030/1039] bonding: Fix extraction of ports from the packet headers Date: Mon, 24 Jan 2022 19:46:59 +0100 Message-Id: <20220124184159.911513508@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Moshe Tal commit 429e3d123d9a50cc9882402e40e0ac912d88cfcf upstream. Wrong hash sends single stream to multiple output interfaces. The offset calculation was relative to skb->head, fix it to be relative to skb->data. Fixes: a815bde56b15 ("net, bonding: Refactor bond_xmit_hash for use with xdp_buff") Reviewed-by: Jussi Maki Reviewed-by: Saeed Mahameed Reviewed-by: Gal Pressman Signed-off-by: Moshe Tal Acked-by: Jay Vosburgh Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/bonding/bond_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -3872,8 +3872,8 @@ u32 bond_xmit_hash(struct bonding *bond, skb->l4_hash) return skb->hash; - return __bond_xmit_hash(bond, skb, skb->head, skb->protocol, - skb->mac_header, skb->network_header, + return __bond_xmit_hash(bond, skb, skb->data, skb->protocol, + skb_mac_offset(skb), skb_network_offset(skb), skb_headlen(skb)); }