Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3067461ybt; Mon, 29 Jun 2020 14:25:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjg0e1ULaL7SQY/rcwyQiBnAfm9AA/YNYhD9Y2dWYj7deMQcGBItHqYHyQmfKzTOb+qPV+ X-Received: by 2002:aa7:c656:: with SMTP id z22mr5941694edr.101.1593465938678; Mon, 29 Jun 2020 14:25:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593465938; cv=none; d=google.com; s=arc-20160816; b=gQ4E0TsBGugtZNL0ErOJIu1eIWiVkU75NzZunM9v8StHYmhsGkqDmNRMmXm6RDukRF vE5h7g0SBjibVF47Qj6CDCxlV5b/iW1Yj8mxSeJ5sYfJ6qj6L88ioLpjy/IHhrPYoESA MAPKhIU80cDzyEjhDWEL0WQIjzyhpxan7c/zumMMrewEkki5QZtwRjd+CuR67KYj5E2x gdCYpi2fJESUoYY3Ws4P5yC9liOwM4vd0CcwaKnYtErGbYA4YtDGSERbQpc2YBwRRUGJ /pCvp4VNNpW/ZVb5Z3d8ppf0ZUIQUbn6p5FHaxNhNMFlCaNw7rVjtArY4Xz4slxbNb07 Y+Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id; bh=XeaMKgGslYNU9IDso7F9m+98zA7ZIOaXH2lgkOxkEOo=; b=oXjNLzCiswd7GLP7pIubeqzDyIchZMGiUBT3KgqD3eCIwIDyYm86OABiYKMSTLcJyy zsajoj/nTmxo/hvTscgiQfM+K7ZhBrUIDs3Y72VUKbq9GTtXRFjHvZdQorRiY8MdghD0 KE+qmYJvIOmHxdPw24yIBxl/wlrTXzw5CUcIw7QLpo6Frpyk1KWni34ggszW72CbyFAp QiEP9+L8yEydxfAVnJYEVEkOKG5tydKLeDAqUCZBiz3tpIQQEQt0G5tBjKpOmCnKgvzs H4/iB+SlAG1lpekrjxOpY1IdeXGScl4mIBwIPj8hJYEUWpSUC0A2bjwr++MiySuQcmga d3Pg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gg21si452433ejb.694.2020.06.29.14.25.15; Mon, 29 Jun 2020 14:25:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729567AbgF2VXt (ORCPT + 99 others); Mon, 29 Jun 2020 17:23:49 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:16255 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728868AbgF2SvA (ORCPT ); Mon, 29 Jun 2020 14:51:00 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 49wPzP5LWHz9tyrG; Mon, 29 Jun 2020 13:15:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id OXuXuozMG7Iv; Mon, 29 Jun 2020 13:15:13 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 49wPzP4K8pz9tyqw; Mon, 29 Jun 2020 13:15:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 35C818B79E; Mon, 29 Jun 2020 13:15:20 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 9LehT2Iwe4Is; Mon, 29 Jun 2020 13:15:20 +0200 (CEST) Received: from pc16570vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.230.105]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 0AFBA8B799; Mon, 29 Jun 2020 13:15:20 +0200 (CEST) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id C32AF65B29; Mon, 29 Jun 2020 11:15:19 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH v2 0/6] powerpc/32s: Allocate modules outside of vmalloc space for STRICT_KERNEL_RWX To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 29 Jun 2020 11:15:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On book3s32 (hash), exec protection is set per 256Mb segments with NX bit. Instead of clearing NX bit on vmalloc space when CONFIG_MODULES is selected, allocate modules in a dedicated segment (0xb0000000-0xbfffffff by default). This allows to keep exec protection on vmalloc space while allowing exec on modules. v2: - Removed the two patches that fix ptdump. Will submitted independently - Only changing the user/kernel boundary for PPC32 now. - Reordered the patches inside the series. Christophe Leroy (6): powerpc/lib: Prepare code-patching for modules allocated outside vmalloc space powerpc: Use MODULES_VADDR if defined powerpc/32s: Only leave NX unset on segments used for modules powerpc/32: Set user/kernel boundary at TASK_SIZE instead of PAGE_OFFSET powerpc/32s: Kernel space starts at TASK_SIZE powerpc/32s: Use dedicated segment for modules with STRICT_KERNEL_RWX arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/book3s/32/pgtable.h | 15 +++++---------- arch/powerpc/include/asm/page.h | 4 +++- arch/powerpc/kernel/head_32.S | 12 ++++++------ arch/powerpc/kernel/module.c | 11 +++++++++++ arch/powerpc/lib/code-patching.c | 2 +- arch/powerpc/mm/book3s32/hash_low.S | 2 +- arch/powerpc/mm/book3s32/mmu.c | 17 ++++++++++++++--- arch/powerpc/mm/kasan/kasan_init_32.c | 6 ++++++ arch/powerpc/mm/ptdump/ptdump.c | 16 ++++++++++++++-- 10 files changed, 62 insertions(+), 24 deletions(-) -- 2.25.0