Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp406841pxb; Wed, 3 Mar 2021 06:22:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+evKyZ+iFeCfCUsWVOa26A5EG6CD1fz1eJGVy1ZUAOhsGr2iqT7nUviPbGSKl/v3JXxd4 X-Received: by 2002:aa7:c3c4:: with SMTP id l4mr16061212edr.335.1614781360644; Wed, 03 Mar 2021 06:22:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614781360; cv=none; d=google.com; s=arc-20160816; b=O72PPVXr3A5y4KZXbm8mr35J42BIPLIghu9glNUJyMVPmGjqJL1nDt0u6V7QvMI6+1 Z0OD7Z6dcA5E8fCEc7yjx5dykKKFZpg1N9TlUylEzuj4Bo/cdYPYulJwszQ4gt6AGHpT ZbM2/YiNDx1CJ99Y7FqHpgsxDhNn/3cIcnUvSIdmN9e8x4j4/2pqwmVzoX7ALGXnYuM+ D4pNbF+aPxmD7ihBVl1bJP3GGMYap0KCbS6JhAVPQDdZmwIVgTNbYtfgNJAVzBn+X2Za vcJw9Sx2oQN36ATxcGyfK1CqbEzWtfc3j8JaG9q54kJBZo4QFhSPue9IebdQXZG0LCFS vk+w== 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=3ck/BV/wiVmFSqt55iHqmtdrQbZPxk8e2PsLpzi0Plk=; b=jrkHWN8/9/T+4zIuAOMWPliR8Y92kYvvfqoNxJ4mhiX24Gki8G3d2IawBud49SnYzl pm/ult8Su+gNR2QZ8G8L79PQsn4HfT8zp8Llk90y8TB8LWGONhrW+N2e9Qg7R+7r9kEh cW9Pj2NRZlGRCLBignA1Lb8+vikrZ50j4KAWPXaitafj20nSU1m3f/8xHODRsuPUVxXY cv0yAypjKs+IfMIhJPBs8SQzcRXpoWVTP+HdYEopd1OIiC/cGg1t+DMJMQmyCmlXoVb9 cbZw1RW+NyllEr8n9vL799L6fJs9eOhaCLJ99c+38K93sFtgic8jRk/htaKUcgwkzR+8 Pwlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Hy3iYTJZ; 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 z1si15221188edp.254.2021.03.03.06.21.45; Wed, 03 Mar 2021 06:22:40 -0800 (PST) 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=Hy3iYTJZ; 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 S243767AbhCAUsJ (ORCPT + 99 others); Mon, 1 Mar 2021 15:48:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:37782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236684AbhCARIk (ORCPT ); Mon, 1 Mar 2021 12:08:40 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5953465016; Mon, 1 Mar 2021 16:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616925; bh=K98Xo5Lpmx5cL/9oGyD0a9cOvzfxByJ1hmiICAqCcj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hy3iYTJZVCDtMca4EBs0iyB3quXmIruvX/qYUs6BQzG1T/Svcj4ngqTfiBXs7f2Q5 tLW27ffgYO8UWsYo7ajOcJy/J8pgIWqajlzq7e54JtQS0ndpgeFb9Mtd8eu8SRwFmZ 2yVNK7gbHbKjwvvctuws/rBQ7zJFuocOhmM1PGN0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bob Pearson , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.19 142/247] RDMA/rxe: Correct skb on loopback path Date: Mon, 1 Mar 2021 17:12:42 +0100 Message-Id: <20210301161038.622620163@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@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: Bob Pearson [ Upstream commit 5120bf0a5fc15dec210a0fe0f39e4a256bb6e349 ] rxe_net.c sends packets at the IP layer with skb->data pointing at the IP header but receives packets from a UDP tunnel with skb->data pointing at the UDP header. On the loopback path this was not correctly accounted for. This patch corrects for this by using sbk_pull() to strip the IP header from the skb on received packets. Fixes: 8700e3e7c485 ("Soft RoCE driver") Link: https://lore.kernel.org/r/20210128182301.16859-1-rpearson@hpe.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/sw/rxe/rxe_net.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c index 7903bd5c639ea..04bfc36cc8d76 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.c +++ b/drivers/infiniband/sw/rxe/rxe_net.c @@ -500,6 +500,11 @@ int rxe_send(struct rxe_pkt_info *pkt, struct sk_buff *skb) void rxe_loopback(struct sk_buff *skb) { + if (skb->protocol == htons(ETH_P_IP)) + skb_pull(skb, sizeof(struct iphdr)); + else + skb_pull(skb, sizeof(struct ipv6hdr)); + rxe_rcv(skb); } -- 2.27.0