From patchwork Mon Oct 11 15:25:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12550337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B524CC433EF for ; Mon, 11 Oct 2021 15:27:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D8AD60F23 for ; Mon, 11 Oct 2021 15:27:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238936AbhJKP31 (ORCPT ); Mon, 11 Oct 2021 11:29:27 -0400 Received: from pegase2.c-s.fr ([93.17.235.10]:59181 "EHLO pegase2.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238436AbhJKP3S (ORCPT ); Mon, 11 Oct 2021 11:29:18 -0400 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4HSjM93d1Fz9sTx; Mon, 11 Oct 2021 17:26:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OBrFabSRDoDz; Mon, 11 Oct 2021 17:26:45 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4HSjM30nH1z9sTy; Mon, 11 Oct 2021 17:26:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id DB9278B770; Mon, 11 Oct 2021 17:26:38 +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 bFxN6KuiUkIq; Mon, 11 Oct 2021 17:26:38 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [172.25.230.103]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4347A8B778; Mon, 11 Oct 2021 17:26:38 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.16.1/8.16.1) with ESMTPS id 19BFQUHh1585003 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 11 Oct 2021 17:26:30 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.16.1/8.16.1/Submit) id 19BFQSSf1585000; Mon, 11 Oct 2021 17:26:28 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Andrew Morton , "James E.J. Bottomley" , Helge Deller , Arnd Bergmann , Kees Cook , Greg Kroah-Hartman Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v1 00/10] Fix LKDTM for PPC64/IA64/PARISC Date: Mon, 11 Oct 2021 17:25:27 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1633965928; l=1657; s=20211009; h=from:subject:message-id; bh=MyFDI59OB41sshcY3FFNfcB1XZ95MMaqIC4x67qjzAw=; b=fIPiVnVnK4XA3MURNNuFAFMUTrsms/nTkjiJtAFhRT/WhoLrPGf+hhxLE8wJ4jP/uibuvVcQFHfG hom3CpU3BH7rSi6TGaCUsgEbvS6ttQ2X5/5MDETSsvzVKkGDd5xO X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org PPC64/IA64/PARISC have function descriptors. LKDTM doesn't work on those three architectures because LKDTM messes up function descriptors with functions. This series does some cleanup in the three architectures and refactors function descriptors so that it can then easily use it in a generic way in LKDTM. Patch 6 is not absolutely necessary but it is a good trivial cleanup. Christophe Leroy (10): powerpc: Move 'struct ppc64_opd_entry' back into asm/elf.h powerpc: Rename 'funcaddr' to 'addr' in 'struct ppc64_opd_entry' ia64: Rename 'ip' to 'addr' in 'struct fdesc' asm-generic: Use HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR to define associated stubs asm-generic: Define 'funct_descr_t' to commonly describe function descriptors asm-generic: Refactor dereference_[kernel]_function_descriptor() lkdtm: Force do_nothing() out of line lkdtm: Really write into kernel text in WRITE_KERN lkdtm: Fix lkdtm_EXEC_RODATA() lkdtm: Fix execute_[user]_location() arch/ia64/include/asm/elf.h | 2 +- arch/ia64/include/asm/sections.h | 24 ++--------- arch/ia64/kernel/module.c | 6 +-- arch/parisc/include/asm/sections.h | 16 +++---- arch/parisc/kernel/process.c | 21 --------- arch/powerpc/include/asm/elf.h | 7 +++ arch/powerpc/include/asm/sections.h | 30 +++---------- arch/powerpc/include/uapi/asm/elf.h | 8 ---- arch/powerpc/kernel/module_64.c | 6 +-- drivers/misc/lkdtm/perms.c | 66 +++++++++++++++++++++++------ include/asm-generic/sections.h | 24 ++++++++++- 11 files changed, 102 insertions(+), 108 deletions(-)