From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6D32C47098 for ; Thu, 3 Jun 2021 10:32:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9FD3F613D6 for ; Thu, 3 Jun 2021 10:32:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229962AbhFCKeF (ORCPT ); Thu, 3 Jun 2021 06:34:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:56392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbhFCKeE (ORCPT ); Thu, 3 Jun 2021 06:34:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D65BC613B4; Thu, 3 Jun 2021 10:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622716340; bh=X5aLnubKAmnjv11r/M1yhgLc/kSlye6ydJVcueRcSJM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZFiJY4nZsZfw97zIHkBEr3VpNpMUKzlrhETGTbuErOKNsf/bLe+LuyXJXk5EACpKK MZUE7KzGUgKgwe1GiaI40o1kN29hxhkKEknugf+NAqPxGx0S8+0A0QtDAfqTSXBhzZ NVDQIJ2oxYkEBkpO4ZhWhSCNg8wsqUOTT3HRj9PLSbeS5jWRqRKQlVtSISMVZEPsZB CRaspjduFgAQG0PguB9XyA+3cHreOeMFv9tpLn/bnY4YmfgWn/LS6ExOdkYlu4qguU BxSMpkXsv1XZVLcRvR02mvIlfd8BTTGdNmP1ZPmeSV7m5fVMo3pe/F5W157wYxYtti L6n25V+hCu22A== Date: Thu, 3 Jun 2021 13:32:11 +0300 From: Mike Rapoport To: "Russell King (Oracle)" Cc: Mike Rapoport , linux-kernel@vger.kernel.org, Andrew Morton , Catalin Marinas , Christian Borntraeger , David Hildenbrand , Heiko Carstens , Thomas Bogendoerfer , Vasily Gorbik , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-s390@vger.kernel.org Subject: Re: [RFC/RFT PATCH 2/5] memblock: introduce generic memblock_setup_resources() Message-ID: References: <20210531122959.23499-1-rppt@kernel.org> <20210531122959.23499-3-rppt@kernel.org> <20210601135415.GZ30436@shell.armlinux.org.uk> <20210602101521.GD30436@shell.armlinux.org.uk> <20210602155141.GM30436@shell.armlinux.org.uk> <20210602201502.GP30436@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210602201502.GP30436@shell.armlinux.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 02, 2021 at 09:15:02PM +0100, Russell King (Oracle) wrote: > On Wed, Jun 02, 2021 at 09:43:32PM +0300, Mike Rapoport wrote: > > Back then when __ex_table was moved from .data section, _sdata and _edata > > were part of the .data section. Today they are not. So something like the > > patch below will ensure for instance that __ex_table would be a part of > > "Kernel data" in /proc/iomem without moving it to the .data section: > > > This example has undesirable security implications. It moves the > exception table out of the read-only mappings into the read-write > mappings, thereby providing a way for an attacker to bypass the > read-only protection on the kernel and manipulate code pointers at > potentially known addresses for distro built kernels. My point was that __ex_table can be in "Kernel data" or "Kernel rodata" without loosing the ability to sort it. > You seem to be missing the point I've tried to make. The areas in > memblock that are marked "reserved" are the areas of reserved memory > from the firmware _plus_ the areas that the kernel has made during > boot which are of no consequence to userspace. I know what areas are marked "reserved" in memblock. I never suggested to report "ficticious" reserved areas in /proc/iomem unless an architecture already reports them there, like arm64 for example. You are right I should have described better the overall objective, but sill I feel that we keep missing each other points. I'll update the descriptions for the next repost, hopefully it'll help. -- Sincerely yours, Mike. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62CEBC47096 for ; Thu, 3 Jun 2021 10:34:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 34087613B4 for ; Thu, 3 Jun 2021 10:34:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34087613B4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3+8UVwLppc+Yh1pXee7fEJ9A+NjGs2yYCiWyHAuJn1I=; b=a3V6FtTg/pm4fi NcEGRvOqG5k6i5C4Buur93Vgf2jTjt8tSCaQpuYioFB0GDQ2L0HqBPrS6j27bsgxX9YQhuiF/hSrQ lM4t/+alfWPGODPUe52rLEeRvaJXPtRzNEO1wE8D5HwSdOrxh1w7n9bOtGr0Uyn/UmI5K8sXd49IU kX9GnYEr2mA4pN6JPoqwkgn7QNPIr4sBfTVTq39Hx0ysKX55c6C7SFuILSQPu0UMIir0aJZUPi23q 5d/i06vW/YN5avf7GjXyOWDd+DzscNU5dzLwReUvxMQLCtRRNA4TixkMeyyA7OPISsQBAsjkYjNox UNyBv8aPj5WlTFjoHGoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lokeH-0087jR-9i; Thu, 03 Jun 2021 10:32:25 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lokeC-0087hx-Qb for linux-arm-kernel@lists.infradead.org; Thu, 03 Jun 2021 10:32:22 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id D65BC613B4; Thu, 3 Jun 2021 10:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622716340; bh=X5aLnubKAmnjv11r/M1yhgLc/kSlye6ydJVcueRcSJM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZFiJY4nZsZfw97zIHkBEr3VpNpMUKzlrhETGTbuErOKNsf/bLe+LuyXJXk5EACpKK MZUE7KzGUgKgwe1GiaI40o1kN29hxhkKEknugf+NAqPxGx0S8+0A0QtDAfqTSXBhzZ NVDQIJ2oxYkEBkpO4ZhWhSCNg8wsqUOTT3HRj9PLSbeS5jWRqRKQlVtSISMVZEPsZB CRaspjduFgAQG0PguB9XyA+3cHreOeMFv9tpLn/bnY4YmfgWn/LS6ExOdkYlu4qguU BxSMpkXsv1XZVLcRvR02mvIlfd8BTTGdNmP1ZPmeSV7m5fVMo3pe/F5W157wYxYtti L6n25V+hCu22A== Date: Thu, 3 Jun 2021 13:32:11 +0300 From: Mike Rapoport To: "Russell King (Oracle)" Cc: Mike Rapoport , linux-kernel@vger.kernel.org, Andrew Morton , Catalin Marinas , Christian Borntraeger , David Hildenbrand , Heiko Carstens , Thomas Bogendoerfer , Vasily Gorbik , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-s390@vger.kernel.org Subject: Re: [RFC/RFT PATCH 2/5] memblock: introduce generic memblock_setup_resources() Message-ID: References: <20210531122959.23499-1-rppt@kernel.org> <20210531122959.23499-3-rppt@kernel.org> <20210601135415.GZ30436@shell.armlinux.org.uk> <20210602101521.GD30436@shell.armlinux.org.uk> <20210602155141.GM30436@shell.armlinux.org.uk> <20210602201502.GP30436@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210602201502.GP30436@shell.armlinux.org.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210603_033220_905452_A0A79B88 X-CRM114-Status: GOOD ( 16.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 02, 2021 at 09:15:02PM +0100, Russell King (Oracle) wrote: > On Wed, Jun 02, 2021 at 09:43:32PM +0300, Mike Rapoport wrote: > > Back then when __ex_table was moved from .data section, _sdata and _edata > > were part of the .data section. Today they are not. So something like the > > patch below will ensure for instance that __ex_table would be a part of > > "Kernel data" in /proc/iomem without moving it to the .data section: > > > This example has undesirable security implications. It moves the > exception table out of the read-only mappings into the read-write > mappings, thereby providing a way for an attacker to bypass the > read-only protection on the kernel and manipulate code pointers at > potentially known addresses for distro built kernels. My point was that __ex_table can be in "Kernel data" or "Kernel rodata" without loosing the ability to sort it. > You seem to be missing the point I've tried to make. The areas in > memblock that are marked "reserved" are the areas of reserved memory > from the firmware _plus_ the areas that the kernel has made during > boot which are of no consequence to userspace. I know what areas are marked "reserved" in memblock. I never suggested to report "ficticious" reserved areas in /proc/iomem unless an architecture already reports them there, like arm64 for example. You are right I should have described better the overall objective, but sill I feel that we keep missing each other points. I'll update the descriptions for the next repost, hopefully it'll help. -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel