Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4633992ybi; Tue, 11 Jun 2019 09:48:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYDqBzufNf/90pNpB0WQK8jjKKZ/eJGKHk0NJo6y1Hj/eqfLnV+pIJfy1IusLbVwUO1oaO X-Received: by 2002:a17:902:e312:: with SMTP id cg18mr9988733plb.212.1560271683997; Tue, 11 Jun 2019 09:48:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560271683; cv=none; d=google.com; s=arc-20160816; b=WmRBXy7nrncA94q3h+MgsFzka+5lOf7Omrh4mM7JhPzXEs4oWWpLe9/2PZ6tphxlxa cALUB5jCsxz8Uxl3MAx39eVeSDA7oAaBg72hov+M+WiofTMO+ZMic+5oFC+pegRA+KJD spkB80TD+BviR4P0ndDGhPrchUUeHtTu9tRngaD3R4o701Y5tcat4N5xgtouzvJh9aE1 GUViBM1WZxPAiI6TjBNlfLy6mUGm2e1GYqI4gpooXYBS1G1jnPr6u0NmNgeP7Ket9M+5 UYqOIVoobDyVnBtPX2box9fHGMV8tDbmUd2Edic5cfcyfMjD6lXdEiR4Y+FCvbRez0z3 2QJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:date:references :in-reply-to:subject:cc:to:from; bh=Fjx5Evpq6NDo6oeZpzA/p50Z6tbO54kkcvQ/Z7oL3fY=; b=V1iJbzdsiPJNM0Ah5LDWkUPXhhE/AEc53ArhRwIeJUpSVNwLRVMXj0WKwDYleM59Yt YExpULBNXzRSW5H9v+v3tjPZbJnhuMiI3kiMXrxHuxk7C6YozGBTz0/f/dwEpla5E6+b aj0Jq1QIb5jH1P3Fn9GrmvchTKOGouDqNiYWDWUWxUkq9nHx5JAGmzmAH2ZNaTF7fXVa qgsHFvdxvqd5z7VPCJxa72cOsrzJ5GiBWmE6Bo8QAJ5LdPT1ZKEyVEq8BIzrV4yNSWqQ ABXw+9exBGE1yh8eGv4AjN4B+4yI2mLYN+4AmBVT1pLkjCpUer6UWgMH//a/VTddHItz pddw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si8026856pgs.261.2019.06.11.09.47.48; Tue, 11 Jun 2019 09:48:03 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405543AbfFKQPo (ORCPT + 99 others); Tue, 11 Jun 2019 12:15:44 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40318 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2404034AbfFKQPn (ORCPT ); Tue, 11 Jun 2019 12:15:43 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5BGBJal054872 for ; Tue, 11 Jun 2019 12:15:42 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2t2fkbr8cu-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 11 Jun 2019 12:15:42 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Jun 2019 17:15:40 +0100 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 11 Jun 2019 17:15:37 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5BGFaNx24576476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Jun 2019 16:15:36 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0E08C42052; Tue, 11 Jun 2019 16:15:36 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BE0C842045; Tue, 11 Jun 2019 16:15:33 +0000 (GMT) Received: from skywalker.linux.ibm.com (unknown [9.85.73.114]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 11 Jun 2019 16:15:33 +0000 (GMT) X-Mailer: emacs 26.2 (via feedmail 11-beta-1 I) From: "Aneesh Kumar K.V" To: Pingfan Liu , linux-mm@kvack.org Cc: Pingfan Liu , Ira Weiny , Andrew Morton , Mike Rapoport , Dan Williams , Matthew Wilcox , John Hubbard , Keith Busch , Christoph Hellwig , linux-kernel@vger.kernel.org Subject: Re: [PATCHv3 1/2] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast() In-Reply-To: <1559725820-26138-1-git-send-email-kernelfans@gmail.com> References: <1559725820-26138-1-git-send-email-kernelfans@gmail.com> Date: Tue, 11 Jun 2019 21:45:31 +0530 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 19061116-0016-0000-0000-000002882CF6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061116-0017-0000-0000-000032E55CB2 Message-Id: <87tvcwhzdo.fsf@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-11_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=461 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906110104 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pingfan Liu writes: > As for FOLL_LONGTERM, it is checked in the slow path > __gup_longterm_unlocked(). But it is not checked in the fast path, which > means a possible leak of CMA page to longterm pinned requirement through > this crack. Shouldn't we disallow FOLL_LONGTERM with get_user_pages fastpath? W.r.t dax check we need vma to ensure whether a long term pin is allowed or not. If FOLL_LONGTERM is specified we should fallback to slow path. -aneesh