Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2331282imm; Mon, 28 May 2018 06:12:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpTbBRBclmIZqzeviinHYOLI6Eadm62g/0k/ssSHP+tSAgakXaTU7QX5zuaV6KQ4ir/MSFn X-Received: by 2002:a63:b91b:: with SMTP id z27-v6mr10552367pge.240.1527513140752; Mon, 28 May 2018 06:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527513140; cv=none; d=google.com; s=arc-20160816; b=SupenJsDJvkvYVSp/sBmncHm9KDNXqlYzp3ZjrE3vwsJZU+aEYVwo/SrzXWImUSYpj BSkpWjEgcmlYS3Ehv/BJL8tVUleznr/Nn0dbVDxnsosC9xeO1SPXVJpBffQKd7X14HWe CGcG2sjj+esMYyWOJQ8SyB8vP63TEnHROS6WIBEi6dHDppm7gyeWSHaiy2JS2OizVw2i w5trQc198qcXH1PH0YkrcnIZtUVYAITTvdwv6kGyH9crelNJg7/Gxp8Ul+yWe1sV8otA mAW4gWaNp7mmiGNZ4nxF4UF13arE5Ac6cEwmYTPMnfNqJuCN5+DYsJuPMuitNiNJXxDv WdDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=R/lszjP88hlVgbbALUvndlCF1ajMOTmgqiaY0l5PPeE=; b=DxzcKt4bg0RxYWMmnnScFPLO7W9loeD48uqDOING8gj+s1nWs8jVM1jbtIMvhX2+xD 8dgN1CvezFN90x6LnUIMSzvyALyguyrosqM7t5LLd15ITw4km/ONbwNBBlLVzHyqTccA BUt80bhQp4mkwJsxeR4RDgW+xd4DiUg1INRY6tcfd/tX2zjddGrKCzhWZgYveQjzEnAV 6v4qZrmrmZ3yPnB+FEqS/8R8TmRCmnBKrMVDRExly/rQ+wKOa558fiLTUCZvKfLLwO3f 18/IPwi+6O7nFsFYn0dS4tYSobyfzwYxzT6h2fOJv5oh1I5qV7qNOIlz2pc/BbX8I2e2 OdNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=r4Wo86Qk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a23-v6si29617181pls.571.2018.05.28.06.12.05; Mon, 28 May 2018 06:12:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=r4Wo86Qk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163788AbeE1KvN (ORCPT + 99 others); Mon, 28 May 2018 06:51:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:40610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163763AbeE1KvI (ORCPT ); Mon, 28 May 2018 06:51:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 BBE4A204EE; Mon, 28 May 2018 10:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504668; bh=6+IS90718i8BHM05NrsZ1PrS9h9wZj8ffvsQ7c+zQsk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r4Wo86QkG25AU3Nm2g5rOWCyb1E+dXLcOeyIjbtPwCAgZU0fB5V5uPG1DVuCYowdv b+jqZdFk7UDjBgIeGrnZADL7xmpqNgu5R5GKeQSmEzLm89RFY2+yVUucjtdkvLW1Qt fyBJV1jfN+A1UIIUQ5AvoGkD6+gi0C42FhRK/BFA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Moni Shoua , Jack Morgenstein , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 222/496] IB/mlx4: Fix corruption of RoCEv2 IPv4 GIDs Date: Mon, 28 May 2018 12:00:07 +0200 Message-Id: <20180528100329.268326981@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jack Morgenstein [ Upstream commit 0077416a3d529baccbe07ab3242e8db541cfadf6 ] When using IPv4 addresses in RoCEv2, the GID format for the mapped IPv4 address should be: ::ffff:<4-byte IPv4 address>. In the cited commit, IPv4 mapped IPV6 addresses had the 3 upper dwords zeroed out by memset, which resulted in deleting the ffff field. However, since procedure ipv6_addr_v4mapped() already verifies that the gid has format ::ffff:, no change is needed for the gid, and the memset can simply be removed. Fixes: 7e57b85c444c ("IB/mlx4: Add support for setting RoCEv2 gids in hardware") Reviewed-by: Moni Shoua Signed-off-by: Jack Morgenstein Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/mlx4/main.c | 2 -- 1 file changed, 2 deletions(-) --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -219,8 +219,6 @@ static int mlx4_ib_update_gids_v1_v2(str gid_tbl[i].version = 2; if (!ipv6_addr_v4mapped((struct in6_addr *)&gids[i].gid)) gid_tbl[i].type = 1; - else - memset(&gid_tbl[i].gid, 0, 12); } }