From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932697AbcFHFmE (ORCPT ); Wed, 8 Jun 2016 01:42:04 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42800 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752222AbcFHFmC (ORCPT ); Wed, 8 Jun 2016 01:42:02 -0400 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: heiko.carstens@de.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Wed, 8 Jun 2016 07:41:53 +0200 From: Heiko Carstens To: Kees Cook Cc: Ingo Molnar , Martin Schwidefsky , LKML Subject: Re: [PATCH 0/2] Proper ro_after_init implementation on s390 References: <201606071207.u57C5SK3003539@mx0a-001b2d01.pphosted.com> <20160607180748.GA4280@osiris> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16060805-0004-0000-0000-0000032D5BDE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16060805-0005-0000-0000-00001A3D0636 Message-Id: <20160608054153.GB3311@osiris> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-08_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606080069 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 07, 2016 at 11:11:17AM -0700, Kees Cook wrote: > On Tue, Jun 7, 2016 at 11:07 AM, Heiko Carstens > wrote: > > On Tue, Jun 07, 2016 at 08:49:14AM -0700, Kees Cook wrote: > >> > 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(-) > >> > >> Awesome! This looks great to me! Have you had a chance to look through > >> any of the arch/s390/ __init code for variables that should be marked > >> __ro_after_init? > > > > Not yet, and actually this I'm a bit reluctant to do that, since any wrong > > annotation will lead to kernel crashes sooner or later ;) > > However I'll look into this as well. > > Yup, though the good news is it's usually discovered very quickly. :) Eventually it might make sense to add something like DEBUG_SECTION_MISMATCH, which would only report on _write_ accesses from non-init sections. Not sure if this can be done easily and without the need of a new compiler feature. The new problem class I'm afraid of is more or less the same that we had when non-init code referenced (already freed) initdata objects.