From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752824AbdJUHvl (ORCPT ); Sat, 21 Oct 2017 03:51:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45162 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751131AbdJUHvk (ORCPT ); Sat, 21 Oct 2017 03:51:40 -0400 Date: Sat, 21 Oct 2017 09:51:46 +0200 From: Greg KH To: "Guilherme G. Piccoli" Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, haver@linux.vnet.ibm.com Subject: Re: [PATCH] genwqe: Take R/W permissions into account when dealing with memory pages Message-ID: <20171021075146.GA21399@kroah.com> References: <20171020192749.20194-1-gpiccoli@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171020192749.20194-1-gpiccoli@linux.vnet.ibm.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 20, 2017 at 05:27:49PM -0200, Guilherme G. Piccoli wrote: > Currently we assume userspace pages are always writable when doing > memory pinning. This is not true, specially since userspace applications > may allocate their memory the way they want, we have no control over it. > If a read-only page is set for pinning, currently the driver fails due > to get_user_pages_fast() refusing to map read-only pages as writable. > > This patch changes this behavior, by taking the permission flags of the > pages into account in both pinning/unpinning process, as well as in the > DMA data copy-back to userpace (which we shouldn't try to do blindly, > since it will fail in case of read-only-pages). > > Signed-off-by: Frank Haverkamp > Signed-off-by: Guilherme G. Piccoli > --- > > Arnd/Greg, we found this bug recently, although not critical, > it's really a boring issue affecting driver functionality. > If it's possible to take this patch still on v4.14, we'd be > really thankful! > But we know it's late, so if not possible, v4.15 is cool. Is this a regression? It seems like it's just a "fix something that has always been broken but no one has noticed yet" type of thing, right? thanks, greg k-h