From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 204FCC10F13 for ; Tue, 16 Apr 2019 11:07:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E166A20821 for ; Tue, 16 Apr 2019 11:07:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555412860; bh=lY6zQ2n6i6yVdchUhorGTohEEz/Zr5p4PeVKycExoN8=; h=From:To:Cc:Subject:Date:List-ID:From; b=TUP+7kc7ojsGPuYyxfuBujRLbFa4HIYg8dj7237xplBxxQaQ7VNAW/RUSTaoXvt2h jDC46nGBZjjiP94LEgAcVAvmL4BlKgGnIKBSiVaPl0GbrHMB0Xpyq8HgjpHWxthhXx ycsfbbawzfzZGHnf+7aIfbgRzjiU6O5kpV/GIPOI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728250AbfDPLHi (ORCPT ); Tue, 16 Apr 2019 07:07:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:41890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726672AbfDPLHi (ORCPT ); Tue, 16 Apr 2019 07:07:38 -0400 Received: from localhost (unknown [193.47.165.251]) (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 860292073F; Tue, 16 Apr 2019 11:07:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555412857; bh=lY6zQ2n6i6yVdchUhorGTohEEz/Zr5p4PeVKycExoN8=; h=From:To:Cc:Subject:Date:From; b=smAJSq222gc6NllxG+eyjRNchKPkd1uk6yjebhcaEIQYNvFEHV2Cg4S8P8wqShAzK IASDqWdvws7u1QO4T3h9hwv01m2MTMPhXvmkOlv7KN2AYlus9lChkrnDAH/tDReU0P 9bJ5hawCl72tkdLMAjFxhRBuCavYNoya8erBk7+c= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , RDMA mailing list , Andrea Arcangeli , Feras Daoud , Haggai Eran , Jason Gunthorpe , Saeed Mahameed , linux-netdev Subject: [PATCH rdma-next 0/6] BAR mappings fixes in RDMA Date: Tue, 16 Apr 2019 14:07:24 +0300 Message-Id: <20190416110730.32230-1-leon@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Leon Romanovsky >From Jason, Upon review it turns out there are some long standing problems in BAR mapping area: * BAR pages are being allowed to be executable. * BAR pages intended for read-only can be switched to writable via mprotect. * Missing use of rdma_user_mmap_io for the mlx5 clock BAR page. * Disassociate causes SIGBUS when touching the pages. * CPU pages are being mapped through to the process via remap_pfn_range instead of the more appropriate vm_insert_page, causing weird behaviors during disassociation. This series adds the missing VM_* flag manipulation, adds faulting a zero page for disassociation and revises the CPU page mappings to use vm_insert_page. Thanks Jason Gunthorpe (6): RDMA/mlx5: Do not allow the user to write to the clock page RDMA/mlx5: Use rdma_user_map_io for mapping BAR pages RDMA/ucontext: Do not allow BAR mappings to be executable RDMA/ucontext: Fix regression with disassociate RDMA/mlx5: Use get_zeroed_page() for clock_info RDMA: Remove rdma_user_mmap_page drivers/infiniband/core/uverbs.h | 1 + drivers/infiniband/core/uverbs_main.c | 115 ++++++++++-------- drivers/infiniband/hw/mlx5/main.c | 21 ++-- .../ethernet/mellanox/mlx5/core/lib/clock.c | 30 ++--- include/linux/mlx5/driver.h | 1 - include/rdma/ib_verbs.h | 9 -- 6 files changed, 85 insertions(+), 92 deletions(-) -- 2.20.1