Message ID | 20220428154222.1230793-1-gregkh@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55CE2C433EF for <stable@archiver.kernel.org>; Thu, 28 Apr 2022 15:42:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349437AbiD1Pp6 (ORCPT <rfc822;stable@archiver.kernel.org>); Thu, 28 Apr 2022 11:45:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349380AbiD1Ppr (ORCPT <rfc822;stable@vger.kernel.org>); Thu, 28 Apr 2022 11:45:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F4BEB6E60; Thu, 28 Apr 2022 08:42:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C855D61FAE; Thu, 28 Apr 2022 15:42:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E9D5C385A0; Thu, 28 Apr 2022 15:42:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651160551; bh=LWyqadbMX4amHy8ej3ONoYy1N7Vi21lmkuoAe29epNc=; h=From:To:Cc:Subject:Date:From; b=HjkJLc1wNNAyH1cLytrkHl+dQ+0CBbIjEdE4CoeM/h102Ex1eYwk8wRrXQSeKWc5Q Er2YfUzL6pv2U2BFeAzVhnv8mwjuwPadG/2CJH8LCBnG9MTHbTJEUbfW+O2a/eCWqf kvTTExklafsb3xldxza7H3jcP1ubIyb84nW/Ksgc= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Peter Xu <peterx@redhat.com>, John Hubbard <jhubbard@nvidia.com>, Claudio Imbrenda <imbrenda@linux.ibm.com>, Alex Williamson <alex.williamson@redhat.com>, Christoph Hellwig <hch@lst.de>, Jan Kara <jack@suse.cz>, Andrea Arcangeli <aarcange@redhat.com>, "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>, Jason Gunthorpe <jgg@ziepe.ca>, David Hildenbrand <david@redhat.com>, Lukas Bulwahn <lukas.bulwahn@gmail.com>, Matthew Wilcox <willy@infradead.org>, Jason Gunthorpe <jgg@nvidia.com>, Andrew Morton <akpm@linux-foundation.org>, Linus Torvalds <torvalds@linux-foundation.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Subject: [PATCH AUTOSEL 01/14] mm: fix invalid page pointer returned with FOLL_PIN gups Date: Thu, 28 Apr 2022 17:42:09 +0200 Message-Id: <20220428154222.1230793-1-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3214; i=gregkh@linuxfoundation.org; h=from:subject; bh=gsjByhgD7RsvTzmoVWRKhBN4eOYCQhhmeLufTdnA7Mc=; b=owGbwMvMwCRo6H6F97bub03G02pJDElZW29FJmY1djf5GD/S4WnOtZ+wOlPjvRULg8mm1/8mxfmd OP+nI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACYyZybDPPOTB5bJZ/+L3KwpG7hKKe JjR7RFM8OC7RVxd3YczHl5+do5YQ2eL78eCQmpAgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
[AUTOSEL,01/14] mm: fix invalid page pointer returned with FOLL_PIN gups
|
expand
|
diff --git a/mm/gup.c b/mm/gup.c index 7bc1ba9ce440..41da0bd61bec 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -465,7 +465,7 @@ static int follow_pfn_pte(struct vm_area_struct *vma, unsigned long address, pte_t *pte, unsigned int flags) { /* No page to get reference */ - if (flags & FOLL_GET) + if (flags & (FOLL_GET | FOLL_PIN)) return -EFAULT; if (flags & FOLL_TOUCH) {