Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp160209pxj; Thu, 3 Jun 2021 03:34:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJd+NJBq4h9p8RgLfwo9tvFYwOlJZgvJ5SwLJTxTmDRXpf4zw5yyir4ucVNtmTF8KAESdu X-Received: by 2002:aa7:dc17:: with SMTP id b23mr42691578edu.359.1622716472262; Thu, 03 Jun 2021 03:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622716472; cv=none; d=google.com; s=arc-20160816; b=aAB9KiDkuZ1iBxSOZS1X/d3HlYSXiWImfDX3yqxA9xNEKgLjNn7n8LgiLveEPURNsq Sjez2sW7lYebz7HXdDgHc2BZDUmlelM8nwWAzIQ+YcohAuLbIq/jzCrcxESGwFZg6BYv +V3JokrzDa7LdfiaEh3Vt1IrrX1xCoHARdGEWbhBwxBCImlXe9Q//ITlG/ca63DYB0Rd SmJ7ERE+FCFwPQvcDKNYoVPC/9fE0Gry2c67mxjeuB2ytpY2M5V3tfWOryT5ra8o7uIi 0Lt6V6vBULrX/T0RmyDZAxCijT+IxTItM3TC/kobDPX4yApqBvZbZ1g23Kh3yFND9cm1 bQmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9CYKiNnAzYsbVUPLe79wbwgdSJKy+9HisTKI+GQYOBg=; b=tI7owPdCOBHYmjR3Z6eZwOLVG2+gPJfoPFAXQJeYwoB09y64vbkYZWbJWrJEsjpzBJ EYUAaht2o+vXzQTsqGKXg/IpJVd8ye8AWCHKyw9GXL2eE2Xrjys+G2uAd4IgXNn21TjF OpP7hmVfSIdsHaIlZe+D9aNr5FBGowd2mjM2v4fleSinad2S++Wu5ib8XTG0Kj9UZ48c CU48QiDY+3ogR7ySOT/lBXjqBULoeKYXdBezIbq3+kZaxRgIj11gkQEKMlYjaEYVwfGp qkwTy5zvwqNZ/dQwdRXvL4/wBVIPjGVPo64Nbc9Xrlhy5Rzbnc6ZnG/uDM6XBQY7vaRu MEgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZFiJY4nZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b8si2232913edy.432.2021.06.03.03.34.09; Thu, 03 Jun 2021 03:34:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZFiJY4nZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbhFCKeF (ORCPT + 99 others); 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.