Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191020050322.2634-1-mayhs11saini@gmail.com>
Date: Sun, 20 Oct 2019 10:33:22 +0530
From: Shyam Saini <mayhs11saini@...il.com>
To: kernel-hardening@...ts.openwall.com
Cc: iommu@...ts.linux-foundation.org,
	linux-kernel@...r.kernel.org,
	linux-mm@...ck.org,
	Shyam Saini <mayhs11saini@...il.com>,
	Christoph Hellwig <hch@....de>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	Robin Murphy <robin.murphy@....com>,
	Matthew Wilcox <willy@...radead.org>,
	Christopher Lameter <cl@...ux.com>,
	Kees Cook <keescook@...omium.org>
Subject: [PATCH V2] kernel: dma: contigous: Make CMA parameters __initdata/__initconst

These parameters are only referenced by __init routine calls during early
boot so they should be marked as __initdata and __initconst accordingly.

Cc: Christoph Hellwig <hch@....de>
Cc: Marek Szyprowski <m.szyprowski@...sung.com>
Cc: Robin Murphy <robin.murphy@....com>
Cc: Matthew Wilcox <willy@...radead.org>
Cc: Christopher Lameter <cl@...ux.com>
Cc: Kees Cook <keescook@...omium.org>
Signed-off-by: Shyam Saini <mayhs11saini@...il.com>
---
V1->V2:
	mark cma parameters as __initdata/__initconst
	instead of __ro_after_init. As these parameters
	are only used by __init calls and never used afterwards
	which contrast the __ro_after_init usage.
---
 kernel/dma/contiguous.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c
index 69cfb4345388..10bfc8c44c54 100644
--- a/kernel/dma/contiguous.c
+++ b/kernel/dma/contiguous.c
@@ -42,10 +42,10 @@ struct cma *dma_contiguous_default_area;
  * Users, who want to set the size of global CMA area for their system
  * should use cma= kernel parameter.
  */
-static const phys_addr_t size_bytes = (phys_addr_t)CMA_SIZE_MBYTES * SZ_1M;
-static phys_addr_t size_cmdline = -1;
-static phys_addr_t base_cmdline;
-static phys_addr_t limit_cmdline;
+static const phys_addr_t size_bytes __initconst = (phys_addr_t)CMA_SIZE_MBYTES * SZ_1M;
+static phys_addr_t  size_cmdline __initdata = -1;
+static phys_addr_t base_cmdline __initdata;
+static phys_addr_t limit_cmdline __initdata;
 
 static int __init early_cma(char *p)
 {
-- 
2.20.1

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.