Message ID | 20180528100333.440482048@linuxfoundation.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 36470601BE for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 28 May 2018 10:57:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27A7A2895B for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 28 May 2018 10:57:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B9F828C10; Mon, 28 May 2018 10:57:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CABDD28994 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 28 May 2018 10:57:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8ED066B000C; Mon, 28 May 2018 06:57:23 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8565E6B000D; Mon, 28 May 2018 06:57:23 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B5876B000E; Mon, 28 May 2018 06:57:23 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id 15DD26B000C for <linux-mm@kvack.org>; Mon, 28 May 2018 06:57:23 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id d20-v6so7211448pfn.16 for <linux-mm@kvack.org>; Mon, 28 May 2018 03:57:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:user-agent:mime-version; bh=r3Gdw3dKylFqc6PB/G+FvPmyuvx5vJeMeZO8M5lYWUM=; b=rt7+bBEElWJXHiBO5bEWuAt5gnhKNJYxl6wqZCOPpu5XT0souou8cRY6a6rogEP+ev GFLwAewhkWUUe8HMXODHkSpzAip38yDwK9KUGCKujDsh6jZ46lGg932G5HB100Ru8rjM vZYMeJNrVedgFk2iWZSpXGiuDJh7XItjwJdfEetGgZbwqiAz0lqYHlluyX18PkIeY51v iHYeVUxRM2fRXgIQpQP3wrwLx8ZfWytLDavfPysCj9X+nd1mbh0yK9RQyZnuBSkR1qFH 28qgJOCSLT7YeyKw5Wqhp6mB/xkqPNH4Y6gYYOPQFCH/1F8YjmdM+O/YoPeRbNSniqqK lwfg== X-Gm-Message-State: ALKqPwceVqbJ8hnHicBQwOoYoPYuTD6kNRbGnIzwak3uF/M9XD6C31dS 5QG/bzOAEDAXP04NZ/2bArqYb94b5kxoXaCbh+NlEit9iXrsSgy9N+N65SFnzluyggcmhWQc843 cZ1nPHqYeg8AVtDgMR/a1cpMOIrwQrcYUO/rRvdUsaJG7b9JqTg2IOhoq/riTUrM= X-Received: by 2002:a62:3c15:: with SMTP id j21-v6mr5121190pfa.7.1527505042768; Mon, 28 May 2018 03:57:22 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKWqz5go6jzdhdRxy6FFw6jc8i8Z90D8puLGN4CHIMtl8SQZ1zMMT/v9xSks9qkGDFkP8EI X-Received: by 2002:a62:3c15:: with SMTP id j21-v6mr5121159pfa.7.1527505042099; Mon, 28 May 2018 03:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527505042; cv=none; d=google.com; s=arc-20160816; b=IWRQjcP/KuU1bNdAGSn5rGpDVXCZgXJavdXvIfx5UfWhceMmMpqJM6Db0F0fPlopSU jayo7HurBzhjYWrL3miwjNyhuUJpN+iti/YDKwDgJHtvnIBsVQU/We5iC6sM5yNZcsm5 WY6UVUU/MpfM2FW6EqGNoMEcX1ZCfDCnMAVpGvTSn9d+gqNzjYZ2JRdt2nTOieBOwh80 My2wuIOKktkizSZZVfnZFGLBVbjDz4NBrmois3Ea6jGZYi04DdP4GMz7za4A8iAAbZXt Xd1JUpW0+9Fdd38o2roR6wMeKTEoduj7JVcfDicidrH8RwHtc1pufZCzkyaAwTbpGBmd KeNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=r3Gdw3dKylFqc6PB/G+FvPmyuvx5vJeMeZO8M5lYWUM=; b=oRlMUA/DK/K+VSqVMh4Pir2VFNrIMYE/7sdYy7H8cqdqYC19c4DCMelpiS5Mu9CEum +IziKsbZL0BV9lPFJhwMap9KjVw+tZ/uHZzpH9HfJeHSLJYfLPg46fEfA9Gk9uPz4QLY CmF/9pAdJxEjTyNBm84fJ/RRXtxw5ZrJrkV4+CNSFCFDz3Fod0f7zsBMr+L554UeYa6V LH/CaeN9dl5TkxHFUZ9mKC2P23zK57q1IUt8EyPT0LitTNnj7gz9mTCbLHjY+QN3ZQBo SSyH/AYRRsoL9VuplWikwo/BZkFizNjzLSrs1Eow0H5CDqwtB45QhNmY30hSxGaBJeyy 0mOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bxHClAAZ; spf=pass (google.com: domain of srs0=wbis=ip=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=WbIs=IP=linuxfoundation.org=gregkh@kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id d11-v6si30533678pfh.131.2018.05.28.03.57.21 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 May 2018 03:57:22 -0700 (PDT) Received-SPF: pass (google.com: domain of srs0=wbis=ip=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bxHClAAZ; spf=pass (google.com: domain of srs0=wbis=ip=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=WbIs=IP=linuxfoundation.org=gregkh@kernel.org Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 15F1C208A1; Mon, 28 May 2018 10:57:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527505041; bh=GCMaX1HSOCJB4D8rPjc6A2pjG5k5Lenf05Pa1QKODvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bxHClAAZAcIIgC66wVozUuzpn+/MLFYp1oBBX11sMyhzb6aPL5LLxCmisWdkeE0a4 p6M6OKrMA7NH5wI9/Pfd53kRS/+XioMOYs5/WTVYLsWvMIY1Yx7ptbQyxZgXWuk4O+ fn1qCIdQ0xLuHrCNsCCQRbLeKgHwVXAuDoJC5+p8= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Dave Hansen <dave.hansen@linux.intel.com>, Kees Cook <keescook@chromium.org>, Andrea Arcangeli <aarcange@redhat.com>, Andy Lutomirski <luto@kernel.org>, Arjan van de Ven <arjan@linux.intel.com>, Borislav Petkov <bp@alien8.de>, Dan Williams <dan.j.williams@intel.com>, David Woodhouse <dwmw2@infradead.org>, Hugh Dickins <hughd@google.com>, Josh Poimboeuf <jpoimboe@redhat.com>, Juergen Gross <jgross@suse.com>, Linus Torvalds <torvalds@linux-foundation.org>, Nadav Amit <namit@vmware.com>, Peter Zijlstra <peterz@infradead.org>, Thomas Gleixner <tglx@linutronix.de>, linux-mm@kvack.org, Ingo Molnar <mingo@kernel.org>, Sasha Levin <alexander.levin@microsoft.com> Subject: [PATCH 4.14 323/496] x86/mm: Do not forbid _PAGE_RW before init for __ro_after_init Date: Mon, 28 May 2018 12:01:48 +0200 Message-Id: <20180528100333.440482048@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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> X-Virus-Scanned: ClamAV using ClamSMTP |
--- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -298,9 +298,11 @@ static inline pgprot_t static_protection /* * The .rodata section needs to be read-only. Using the pfn - * catches all aliases. + * catches all aliases. This also includes __ro_after_init, + * so do not enforce until kernel_set_to_readonly is true. */ - if (within(pfn, __pa_symbol(__start_rodata) >> PAGE_SHIFT, + if (kernel_set_to_readonly && + within(pfn, __pa_symbol(__start_rodata) >> PAGE_SHIFT, __pa_symbol(__end_rodata) >> PAGE_SHIFT)) pgprot_val(forbidden) |= _PAGE_RW;