Skip to content

Commit 6cfa28e

Browse files
author
Alex Shi
committed
Merge branch 'v4.4/topic/ro-vdso' into linux-linaro-lsk-v4.4
2 parents 11d2c48 + a34cb23 commit 6cfa28e

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

arch/s390/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ config PCI_QUIRKS
6262
config ARCH_SUPPORTS_UPROBES
6363
def_bool y
6464

65+
config DEBUG_RODATA
66+
def_bool y
67+
6568
config S390
6669
def_bool y
6770
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE

arch/s390/mm/init.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ void __init paging_init(void)
109109
free_area_init_nodes(max_zone_pfns);
110110
}
111111

112+
void mark_rodata_ro(void)
113+
{
114+
/* Text and rodata are already protected. Nothing to do here. */
115+
pr_info("Write protecting the kernel read-only data: %luk\n",
116+
((unsigned long)&_eshared - (unsigned long)&_stext) >> 10);
117+
}
118+
112119
void __init mem_init(void)
113120
{
114121
if (MACHINE_HAS_TLB_LC)
@@ -127,9 +134,6 @@ void __init mem_init(void)
127134
setup_zero_pages(); /* Setup zeroed pages. */
128135

129136
mem_init_print_info(NULL);
130-
printk("Write protected kernel read-only data: %#lx - %#lx\n",
131-
(unsigned long)&_stext,
132-
PFN_ALIGN((unsigned long)&_eshared) - 1);
133137
}
134138

135139
void free_initmem(void)

include/asm-generic/vmlinux.lds.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,14 @@
248248
. = ALIGN(align); \
249249
*(.data..init_task)
250250

251+
/*
252+
* Allow architectures to handle ro_after_init data on their
253+
* own by defining an empty RO_AFTER_INIT_DATA.
254+
*/
255+
#ifndef RO_AFTER_INIT_DATA
256+
#define RO_AFTER_INIT_DATA *(.data..ro_after_init)
257+
#endif
258+
251259
/*
252260
* Read only Data
253261
*/
@@ -256,7 +264,7 @@
256264
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
257265
VMLINUX_SYMBOL(__start_rodata) = .; \
258266
*(.rodata) *(.rodata.*) \
259-
*(.data..ro_after_init) /* Read only after init */ \
267+
RO_AFTER_INIT_DATA /* Read only after init */ \
260268
*(__vermagic) /* Kernel version magic */ \
261269
. = ALIGN(8); \
262270
VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \

0 commit comments

Comments
 (0)