From mboxrd@z Thu Jan 1 00:00:00 1970 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 E0BABC433F5 for ; Thu, 14 Oct 2021 21:36:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 806BD6105A for ; Thu, 14 Oct 2021 21:36:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 806BD6105A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=axtens.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0D3E16B006C; Thu, 14 Oct 2021 17:36:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 083BA900003; Thu, 14 Oct 2021 17:36:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB4B5900002; Thu, 14 Oct 2021 17:36:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0041.hostedemail.com [216.40.44.41]) by kanga.kvack.org (Postfix) with ESMTP id DE0BD6B006C for ; Thu, 14 Oct 2021 17:36:01 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A1C302BC3F for ; Thu, 14 Oct 2021 21:36:01 +0000 (UTC) X-FDA: 78696350922.35.7077263 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by imf18.hostedemail.com (Postfix) with ESMTP id 5A42E4002092 for ; Thu, 14 Oct 2021 21:36:00 +0000 (UTC) Received: by mail-pj1-f47.google.com with SMTP id np13so5736463pjb.4 for ; Thu, 14 Oct 2021 14:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=ucthCVLQbHs9EV1Uw1Bv+F6lYLHxvFpuoWX8HwMgpt8=; b=VQQ5XftKFdJxIqUHw8qRFJat71Dbqr2AD8qwnlFgMvFJilatzmha8I6vmL6yvrzpkP hvXQ2mD6ttiO3AiCefR9vWjBp4Q7T/wGfxf4JQjnzp3eY+AnFAfleMbYmsvVYJNrXhMf F+Jl/P5vsIdt4melRbvlQ+FV9+ngeKkjBbp7w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=ucthCVLQbHs9EV1Uw1Bv+F6lYLHxvFpuoWX8HwMgpt8=; b=gI/SOSs7LOy4yn032zCF3vR8Z0Ip1KG0kANGBp4EYF9FlI6ZH1dBoDUhNHBBb8//Lf ytD7udbcuEb9Q5g7e4yUah7xI3DYTnW0ifkHJXkq+oUYQqi6CpF1Avyewbk9X2lu454g X1ndxohTnIGgRuxXV10MhRG/r28+c0AfewwUn6HbhVU2UqjW7+EhXSqpfocNeIXMTh/+ 05o8BMSoAokzc+6wq5qOSsVgYEk+Qy1bX3UsuOZPnBIlJKdCAMIoyPW1JisbzUUGhOad e1KnR8nDwHlu7xk3zdZ5S4AdtDzLM53An0vf4/p/cvv87GO5z7EuRe+se2plNqrh5Rhe wCVQ== X-Gm-Message-State: AOAM531mczS3MT1MDxUJB2DD69EIILpkqF2xkpKyhICDI3uFnTzKDTJo 0Z2oeTrb2XlW4pSZaXObtqlorg== X-Google-Smtp-Source: ABdhPJw1rTBhUzGBU+OCQNwxLaPgrU3yVEgNpct3REqnkn5dEyRgg6pBD5Hi+HUutoGMqi2zC8/tfg== X-Received: by 2002:a17:90b:4ac1:: with SMTP id mh1mr8767562pjb.144.1634247360274; Thu, 14 Oct 2021 14:36:00 -0700 (PDT) Received: from localhost ([2001:4479:e300:600:4901:2fb9:ed97:3a3e]) by smtp.gmail.com with ESMTPSA id k7sm3292676pfk.59.2021.10.14.14.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 14:35:59 -0700 (PDT) From: Daniel Axtens To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Andrew Morton , "James E.J. Bottomley" , Helge Deller , Arnd Bergmann , Kees Cook , Greg Kroah-Hartman Cc: linux-arch@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2 00/13] Fix LKDTM for PPC64/IA64/PARISC In-Reply-To: References: Date: Fri, 15 Oct 2021 08:35:56 +1100 Message-ID: <87a6jb47cz.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=axtens.net header.s=google header.b=VQQ5XftK; dmarc=none; spf=pass (imf18.hostedemail.com: domain of dja@axtens.net designates 209.85.216.47 as permitted sender) smtp.mailfrom=dja@axtens.net X-Stat-Signature: q556bkweu6a8yrh1ju7w5tiiux775ppc X-Rspamd-Queue-Id: 5A42E4002092 X-Rspamd-Server: rspam01 X-HE-Tag: 1634247360-286611 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: Christophe Leroy writes: > PPC64/IA64/PARISC have function descriptors. LKDTM doesn't work > on those three architectures because LKDTM messes up function > descriptors with functions. Just to nitpick, it's powerpc 64-bit using the ELFv1 ABI. [1] The ELFv2 ABI [2] doesn't use function descriptors. (ELFv2 is used primarily for ppc64le, but some people like musl support it for BE as well.) This doesn't affect the correctness or desirability of your changes, it was just bugging me when I was reading the commit messages :-) Kind regards, Daniel [1] See e.g. https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html [2] https://openpowerfoundation.org/wp-content/uploads/2016/03/ABI64BitOpenPOWERv1.1_16July2015_pub4.pdf > 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 8 is not absolutely necessary but it is a good trivial cleanup. > > Changes in v2: > - Addressed received comments > - Moved dereference_[kernel]_function_descriptor() out of line > - Added patches to remove func_descr_t and func_desc_t in powerpc > - Using func_desc_t instead of funct_descr_t > - Renamed HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR to HAVE_FUNCTION_DESCRIPTORS > - Added a new lkdtm test to check protection of function descriptors > > Christophe Leroy (13): > powerpc: Move 'struct ppc64_opd_entry' back into asm/elf.h > powerpc: Rename 'funcaddr' to 'addr' in 'struct ppc64_opd_entry' > powerpc: Remove func_descr_t > powerpc: Prepare func_desc_t for refactorisation > ia64: Rename 'ip' to 'addr' in 'struct fdesc' > asm-generic: Use HAVE_FUNCTION_DESCRIPTORS to define associated stubs > asm-generic: Define 'func_desc_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() > lkdtm: Add a test for function descriptors protection > > arch/ia64/include/asm/elf.h | 2 +- > arch/ia64/include/asm/sections.h | 25 ++------- > arch/ia64/kernel/module.c | 6 +-- > arch/parisc/include/asm/sections.h | 17 +++--- > arch/parisc/kernel/process.c | 21 -------- > arch/powerpc/include/asm/code-patching.h | 2 +- > arch/powerpc/include/asm/elf.h | 6 +++ > arch/powerpc/include/asm/sections.h | 30 ++--------- > arch/powerpc/include/asm/types.h | 6 --- > arch/powerpc/include/uapi/asm/elf.h | 8 --- > arch/powerpc/kernel/module_64.c | 38 +++++-------- > arch/powerpc/kernel/signal_64.c | 8 +-- > drivers/misc/lkdtm/core.c | 1 + > drivers/misc/lkdtm/lkdtm.h | 1 + > drivers/misc/lkdtm/perms.c | 68 ++++++++++++++++++++---- > include/asm-generic/sections.h | 13 ++++- > include/linux/kallsyms.h | 2 +- > kernel/extable.c | 23 +++++++- > 18 files changed, 138 insertions(+), 139 deletions(-) > > -- > 2.31.1