From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755423AbcFGMHU (ORCPT ); Tue, 7 Jun 2016 08:07:20 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:26391 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751290AbcFGMHO (ORCPT ); Tue, 7 Jun 2016 08:07:14 -0400 Message-Id: <201606071207.u57C5SK3003539@mx0a-001b2d01.pphosted.com> X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: heiko.carstens@de.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org From: Heiko Carstens To: Kees Cook , Ingo Molnar Cc: Martin Schwidefsky , linux-kernel@vger.kernel.org Subject: [PATCH 0/2] Proper ro_after_init implementation on s390 Date: Tue, 7 Jun 2016 14:06:59 +0200 X-Mailer: git-send-email 2.6.6 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16060712-0036-0000-0000-000001E94A1D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16060712-0037-0000-0000-00001140F1BE X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-07_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=9 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606070140 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These two patches allow a proper ro_after_init implementation on s390. The current implementation maps __ro_after_init to __read_mostly, which means that ro_after_init data won't be write protected at all. Reason for this is that s390 write protects rodata very early (before init calls) and therefore adding ro_after_init data to rodata would lead to crashes. Since I don't want to mark the page table entries much later read-only on s390 just to make this work, allow an architecture specific handling which can be used to move the ro_after_init data to a different place which can be marked read-only later when mark_rodata_ro gets executed. Note: these patches require the s390 kernel page table splitting support which currently is only available at git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features (included in linux-next) Therefore, if we can agree on this solution I'd like to add these patches to the s390 tree, so it can be merged during the next merge window. Heiko Carstens (2): vmlinux.lds.h: allow arch specific handling of ro_after_init data section s390/mm: add proper __ro_after_init support arch/s390/include/asm/cache.h | 3 --- arch/s390/include/asm/sections.h | 1 + arch/s390/kernel/vmlinux.lds.S | 12 +++++++++++- arch/s390/mm/init.c | 7 ++++--- arch/s390/mm/vmem.c | 7 +++---- include/asm-generic/vmlinux.lds.h | 10 +++++++++- 6 files changed, 28 insertions(+), 12 deletions(-) -- 2.6.6