Message ID | 20230121071051.1143058-2-hch@lst.de (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47A57C38141 for <linux-mm@archiver.kernel.org>; Sat, 21 Jan 2023 07:11:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B96BD6B0073; Sat, 21 Jan 2023 02:11:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B46716B0074; Sat, 21 Jan 2023 02:11:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 94B376B0075; Sat, 21 Jan 2023 02:11:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 852946B0073 for <linux-mm@kvack.org>; Sat, 21 Jan 2023 02:11:03 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5C8F640F88 for <linux-mm@kvack.org>; Sat, 21 Jan 2023 07:11:03 +0000 (UTC) X-FDA: 80377934406.21.1126704 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf23.hostedemail.com (Postfix) with ESMTP id BF60F140008 for <linux-mm@kvack.org>; Sat, 21 Jan 2023 07:11:01 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=kCJyVDge; spf=none (imf23.hostedemail.com: domain of BATV+1651c3ebed9361b307e7+7090+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+1651c3ebed9361b307e7+7090+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674285061; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rOVb8YD5fFvB47xecqte18KDPoif4B7pWlksRr6JsfI=; b=8Fi3wfxCOswaPfI3TsIiZo06XwZfKaZK9ilxnlDOe/M3Ij9ZEttyBbjDCSSF46m0Q0TbmG Pn22+0bPwqeA1e4yd9BVEgWpvHOycDvaYQtqi5oWhnIGHkpvT0NLFvRXjMmujk308xPeY0 oXtKMbKhyt7LKEsQlHMegmd8kRhZG5k= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=kCJyVDge; spf=none (imf23.hostedemail.com: domain of BATV+1651c3ebed9361b307e7+7090+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+1651c3ebed9361b307e7+7090+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674285061; a=rsa-sha256; cv=none; b=n3eOqS5/w3cRqEOf1w57Bl4LsSO0d4QkFOWU1VOG3PKaEXTHYWMVtFIsW5qf5krvORekDc 3IA/ZA9enaBqi6Y41C2nx+CG9r3MofzTy7SdBSm60061OMKDKvLw14V4wDjoNUG6YKqQFY GIJ0YORkv9T6SFFsYp83LYxk07EFv8k= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=rOVb8YD5fFvB47xecqte18KDPoif4B7pWlksRr6JsfI=; b=kCJyVDgeQH6z/iZDM/mUN/yxuH l+QJqoyoBYXERE4spfq9xVrIccMlrvxWLdDmz6SZ20FWbzDgbqIS/2ISZ25MOwtK2vT2QJWJg85Co 2AzFXYbwRZ94isPHXSBRu0QMDiWpdEs+sVHCu7hb0s1bZ7LRjSZyuI009/hsZUr30tqLAENh0nh9G o85uxbt6i/pHHPFD3eAZFoTPqhIQl8T2j64qmTGreeJAZ3C2BDYtAbq55T4Gp3VvRIZOVxcTULeo5 CEIrC5nQ5/kkGfV1nX1Y4ykeAqJGN77iRZZbpY2EirgS8Ha3EgtL0FQuriHiLgUl2egJeow3fxDu5 bK+OowQQ==; Received: from [2001:4bb8:19a:2039:6754:cc81:9ace:36fc] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pJ81g-00DTmK-Bn; Sat, 21 Jan 2023 07:10:56 +0000 From: Christoph Hellwig <hch@lst.de> To: Andrew Morton <akpm@linux-foundation.org>, Uladzislau Rezki <urezki@gmail.com> Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>, Alexander Potapenko <glider@google.com>, Andrey Konovalov <andreyknvl@gmail.com>, Dmitry Vyukov <dvyukov@google.com>, Vincenzo Frascino <vincenzo.frascino@arm.com>, kasan-dev@googlegroups.com, linux-mm@kvack.org Subject: [PATCH 01/10] mm: reject vmap with VM_FLUSH_RESET_PERMS Date: Sat, 21 Jan 2023 08:10:42 +0100 Message-Id: <20230121071051.1143058-2-hch@lst.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230121071051.1143058-1-hch@lst.de> References: <20230121071051.1143058-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: BF60F140008 X-Stat-Signature: 9e1uteype9bn6s16pymesgkcxngnrzdx X-Rspam-User: X-HE-Tag: 1674285061-376404 X-HE-Meta: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XJha33SUEX7bVIr08rSfA0R7R05WDi9f0Pua/E6F4hWrpcma+tOTQRvGyp1ZBvytxgumJ0wN4iF7qHShedUWpk8XKLGRkJoG/TaA/UIMoTwv2VdpfpLjpjVOnlho1U1Kd2aIe21FiMBpE8vB2/vqjDwQaxTgQq+BjOdugpoYOhrBIOUgYwwu+47FSmPWprYETnSbXw0oPMsgoKruiNEkNbbQtTbu2IeCcPRTZJrBWhMaTDLZpSKzY1fv9ng/nvipAFd6+0XhQpuj5M4PsSP4S8G3nyJgzctiN2pi6TublJqePNx5tXJtA+0aQyP4GZb6ZC2kfS82TRQMJsg66FZx1V2x+hEK0vjYjLR4B6fD3/qV96ZuY7lulTSQNn7gQLEuxX/K5ec/PI66kSyZWL4jOORx8NWGuRJkulPQtFpt2CZV9P+jmiV6MoOGjQ5mROOIQb7sFD8c5C3YdAlUUAKbB7ZoqiwAjPtH2PA0x6cM1p X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
[01/10] mm: reject vmap with VM_FLUSH_RESET_PERMS
|
expand
|
On 21.01.23 08:10, Christoph Hellwig wrote: > VM_FLUSH_RESET_PERMS is just for use with vmalloc as it is tied to freeing > the underlying pages. > > Signed-off-by: Christoph Hellwig <hch@lst.de> > Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com> > --- Reviewed-by: David Hildenbrand <david@redhat.com>
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 0781c5a8e0e73d..6957d15d526e46 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2883,6 +2883,9 @@ void *vmap(struct page **pages, unsigned int count, might_sleep(); + if (WARN_ON_ONCE(flags & VM_FLUSH_RESET_PERMS)) + return NULL; + /* * Your top guard is someone else's bottom guard. Not having a top * guard compromises someone else's mappings too.