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=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT 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 A2766C10F11 for ; Wed, 24 Apr 2019 19:24:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7205320652 for ; Wed, 24 Apr 2019 19:24:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="ltYOUtqm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731106AbfDXTYc (ORCPT ); Wed, 24 Apr 2019 15:24:32 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:36139 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731062AbfDXTYb (ORCPT ); Wed, 24 Apr 2019 15:24:31 -0400 Received: by mail-qt1-f196.google.com with SMTP id c35so6941211qtk.3 for ; Wed, 24 Apr 2019 12:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HOw6B0h6synvYhCiga4RpCUrnS/WMzxK48wF/fo8/V0=; b=ltYOUtqmH66gpTf7+7L+AlQfmDZJwxEcTkSDb7Wm+Cdr8CpuYetoSyh6DMgYHHlkre TftQPTuK0jfakgrjJbLxMzE7atFuucIzJoj6MiK8dOq1wYOJ0FYQyfkhmu5mDJZ333uv PBUiBu/UlXFAB8np/YB5Oe9jXEX9ek0b8+vAZrQ4XJt+R6M4pbbbFu6ZdEbJBQORnAH6 HWOgJ3so9ylsYskfqHb79g71VzQksYmJmfKppU5HjauJbXc4tVPbh6GHy7G+TKIf7FNt nGG2s93z2VfqD7xrcsfdD4WSds8RorqJRJqlMKzUQyRnhRt8CE3yyKX0I78uSdH/Rt3Q zNSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HOw6B0h6synvYhCiga4RpCUrnS/WMzxK48wF/fo8/V0=; b=bqfxABXdcP7DAfmVrtpICkj6UMSm3jA43+nt6X5P0gEH98PK80Rm0BMvbDO17N4Z/7 p7DxpuL952udq2uxDmghld6LdsX6Vj8S3YIYm6gTr8QIP0NHYya7uMfvyaT2Wb3JaZzP cuJ+1yK4NMGyTirvpACYArpwCihh0oc6OuYRbC5qrLx1ZuCzSOkxm3Q1zptpilrRnWIv CP3MaNeU85z2L3VYqE8g9NvJDOZ5TWTw4puSQhLOInxPX9EstPvuWOq7HDg6sma0XCuL OS+HYLvfYacREbAysLiBN04gezvKUidOM6qNiPFxyOt1Z72hsr5lSXq1Ye22Mtx+xOwu eNKA== X-Gm-Message-State: APjAAAUMxiy/nQnZfULVxNzYkpAc9ZFqTAEK1AyeD1j/L5oiGjNtieOA Rns6ZEl1zC3GLf3Qe6CVTSZAGA== X-Google-Smtp-Source: APXvYqz5AS6sLXMl66qmZSHHFG0pl+h8Y3kf+5WAoJ9qxTasdjYtxdW/nNA0I/y2ckIUgtgUnC+AnQ== X-Received: by 2002:a0c:d905:: with SMTP id p5mr562585qvj.53.1556133870801; Wed, 24 Apr 2019 12:24:30 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id t129sm9648557qkc.24.2019.04.24.12.24.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2019 12:24:30 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hJNVN-00087r-8s; Wed, 24 Apr 2019 16:24:29 -0300 Date: Wed, 24 Apr 2019 16:24:29 -0300 From: Jason Gunthorpe To: Leon Romanovsky Cc: Doug Ledford , Leon Romanovsky , RDMA mailing list , Andrea Arcangeli , Feras Daoud , Haggai Eran , Saeed Mahameed , linux-netdev Subject: Re: [PATCH rdma-next 0/6] BAR mappings fixes in RDMA Message-ID: <20190424192429.GA31203@ziepe.ca> References: <20190416110730.32230-1-leon@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190416110730.32230-1-leon@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Apr 16, 2019 at 02:07:24PM +0300, Leon Romanovsky wrote: > 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: Fix regression with disassociate Applied to for-rc > RDMA/mlx5: Use get_zeroed_page() for clock_info > RDMA: Remove rdma_user_mmap_page Applied to for-next I dropped this patch: > RDMA/ucontext: Do not allow BAR mappings to be executable Jason