From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752536AbdKVLzO (ORCPT ); Wed, 22 Nov 2017 06:55:14 -0500 Received: from ozlabs.org ([103.22.144.67]:53755 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752483AbdKVLzN (ORCPT ); Wed, 22 Nov 2017 06:55:13 -0500 From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood , Meelis Roos , Balbir Singh Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2] powerpc: fix boot on BOOK3S_32 with CONFIG_STRICT_KERNEL_RWX In-Reply-To: <20171121142820.C744F6BB8F@po15668-vm-win7.idsi0.si.c-s.fr> References: <20171121142820.C744F6BB8F@po15668-vm-win7.idsi0.si.c-s.fr> Date: Wed, 22 Nov 2017 22:55:11 +1100 Message-ID: <87efoq34v4.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > On powerpc32, patch_instruction() is called by apply_feature_fixups() > which is called from early_init() > > There is the following note in front of early_init(): > * Note that the kernel may be running at an address which is different > * from the address that it was linked at, so we must use RELOC/PTRRELOC > * to access static data (including strings). -- paulus > > Therefore, slab_is_available() cannot be called yet, and > text_poke_area must be addressed with PTRRELOC() > > Fixes: 37bc3e5fd764f ("powerpc/lib/code-patching: Use alternate map > for patch_instruction()") I changed this to: Fixes: 95902e6c8864 ("powerpc/mm: Implement STRICT_KERNEL_RWX on PPC32") Cc: stable@vger.kernel.org # v4.14+ Because although the code was added in 37bc3e5fd764f, at that point it couldn't be enabled on 32-bit, so there was no bug. I'm not saying as the author of 95902e6c8864 that the bug is your fault, but that is the first commit where the bug actually existed for someone to hit. cheers