Received: by 10.223.185.116 with SMTP id b49csp5207357wrg; Tue, 27 Feb 2018 09:26:47 -0800 (PST) X-Google-Smtp-Source: AG47ELsDRfoSORxBimdEAS/GHZbxNLUsCPBgnZ+3oSzsf9wZ2ICoHM4o5VadTeFFekSJCOTCs6W9 X-Received: by 2002:a17:902:1c5:: with SMTP id b63-v6mr8537549plb.311.1519752407027; Tue, 27 Feb 2018 09:26:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519752406; cv=none; d=google.com; s=arc-20160816; b=T5isGXP/7qN4slUE5TqCcYECfK6kf+RhjV3UmYga5wtzOR5UFOYkGYFtHY33JjvhjS df8f7h8cevSJpjoc7uk7QI8mCDotVfmDCZC8Cib0cv5F5DO3UClzQs+kx2hvvnSRUkIY OJAaX9SQ2ecVSsr93iw9bBI5H8QKDMl4fhk943cHUhrb7x2q/W+PH2yhqteioAld5zUh QhHasBWI2uWaYw8Pdm4845RFDaXd8eL0+j607pnthuFHi0oh76Th5wO9ePYYymhcBKYz BluJvO0M4VV2DZwcBtRh6kX8soGm4SdufAJ5M+QwIEWpfnKlPVHkFBx+eg2ZclYnaxTX C/Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=flZZkkww7Gsn/lboq7dZdoR+O7LT4KEsvOv8aFf6W/c=; b=MvxC24izvB2Efo3k/BoevC/Us1VDQa5JG6eFQahVv8mRN+0X7RSW5tQkTtXZnJeWwm O4/e5JQRowIruICgXDN4Peem4e3W4aXV0funGljR8uk7woWeiSqu9haLHNrg0uklOmHM wuRG4GTokcibzMpNKTTe1Vip1YA2ShPFhZKrfIfYKZKjZiS7pZzE1JZZheuYR+lehuVf 6tKo8vAcP6Mo6PoZciQTkCne5Hn8xj/x5LeOBeFMM/mhnBKVdGl3uxQ+sQiyt7uEIh0S 7eaSGKVDpLz9ivorcGyEgA8Pb5mxQuwHlYo4aNq15ZPxI3JwUD1UP72f3cV80IcTmPrP C/mA== ARC-Authentication-Results: i=1; mx.google.com; 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 i7-v6si9166966plk.139.2018.02.27.09.26.30; Tue, 27 Feb 2018 09:26:46 -0800 (PST) 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; 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 S1751521AbeB0RZm (ORCPT + 99 others); Tue, 27 Feb 2018 12:25:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:49122 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750919AbeB0RZl (ORCPT ); Tue, 27 Feb 2018 12:25:41 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9F415ACE5; Tue, 27 Feb 2018 17:25:39 +0000 (UTC) Date: Tue, 27 Feb 2018 09:16:09 -0800 From: Davidlohr Bueso To: akpm@linux-foundation.org, tony.luck@intel.com, fenghua.yu@intel.com Cc: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH] ia64/err-inject: Use get_user_pages_fast() Message-ID: <20180227171609.jdt73iqx56kmybrl@linux-n805> References: <20180122172137.26849-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180122172137.26849-1-dave@stgolabs.net> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrew, if you're ok with the patch below, could it be routed your way? Thanks, Davidlohr On Mon, 22 Jan 2018, Davidlohr Bueso wrote: >At the point of sysfs callback, the call to gup is >done without mmap_sem (or any lock for that matter). >This is racy. As such, use the get_user_pages_fast() >alternative and safely avoid taking the lock, if possible. > >Signed-off-by: Davidlohr Bueso >--- > arch/ia64/kernel/err_inject.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/arch/ia64/kernel/err_inject.c b/arch/ia64/kernel/err_inject.c >index 85bba43e7d5d..658a8e06a69b 100644 >--- a/arch/ia64/kernel/err_inject.c >+++ b/arch/ia64/kernel/err_inject.c >@@ -142,7 +142,7 @@ store_virtual_to_phys(struct device *dev, struct device_attribute *attr, > u64 virt_addr=simple_strtoull(buf, NULL, 16); > int ret; > >- ret = get_user_pages(virt_addr, 1, FOLL_WRITE, NULL, NULL); >+ ret = get_user_pages_fast(virt_addr, 1, FOLL_WRITE, NULL); > if (ret<=0) { > #ifdef ERR_INJ_DEBUG > printk("Virtual address %lx is not existing.\n",virt_addr); >-- >2.13.6 >