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: 12550321 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 78287C433EF for ; Mon, 11 Oct 2021 15:27:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0D0876103C for ; Mon, 11 Oct 2021 15:27:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0D0876103C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0B1848000C; Mon, 11 Oct 2021 11:26:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 05F0180007; Mon, 11 Oct 2021 11:26:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E19998000C; Mon, 11 Oct 2021 11:26:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id D2F8580007 for ; Mon, 11 Oct 2021 11:26:56 -0400 (EDT) Received: from smtpin37.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 9BC4F2A489 for ; Mon, 11 Oct 2021 15:26:56 +0000 (UTC) X-FDA: 78684534432.37.1968617 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf14.hostedemail.com (Postfix) with ESMTP id 3CF776005002 for ; Mon, 11 Oct 2021 15:26:56 +0000 (UTC) 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= X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 3CF776005002 X-Stat-Signature: 9tg653jg51snekwubpc5yazd1apqk7un Authentication-Results: imf14.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf14.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu X-HE-Tag: 1633966016-357752 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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(-)