Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1065999pxb; Wed, 1 Sep 2021 16:41:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrjudLc4C7ZO9lrYp9slxTsCQNunNjK8oKgl0ZQOtaOqMZP9cRJcFcxrGfLH3tzSjzqdWr X-Received: by 2002:a02:a391:: with SMTP id y17mr351303jak.47.1630539664974; Wed, 01 Sep 2021 16:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630539664; cv=none; d=google.com; s=arc-20160816; b=uJ8D5EAgtbklUCYwuH/rr7iShrCpl+pw/bkSGAuwRjoIvlYd867wg7um54IdtlYypx Abf1tC59TQbcIHGj6YEibBxgzCsOlvU32G+IK1aNliu1V3EHTQrczS5em5YCJodqL4oS DpAsHQxvui7oc8wxR8waqDD8gPe+VOunj9y9EBcNd/xsuBQYQaCtpwLlFcUuM9vtCRes vQ4cg5ajO5rbs5iQNuZh0MBzxjFXk7kjJ3TxtOWNwoEIYoRzBqX4Ladv/MWAM8C+9YCk y+Wo2dx1rQfr3efB6/X6ozazvsuTMGbeCzu4uR3IEX5XgWFLGdDrG9i/M3JepohD93Eu dHmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9ETte6Kips/PnFBmTfas2bMsUhjtMM1DpuPy9sky4cQ=; b=CsqKdR3qpgXpOV7T2vFfy8wQOxQLJiyDDHATH0sAO8qtWrkMLZtQo/HauNvctKBke5 CAD9B8P3JyU3s1hFlkNCxoshrQIhxhGXaSo3kB01UeM9KM7UBJYiAz7cmjSE0QgtZknn qVIVFgahDxwUCR7uP2bkJAjw0NQlMpJJ6zGgdQ6IcjPF7JzlGWpKxQ38UvhScBSi16ub Lm8AzZmQRubwr2eLZvMHob3ZqQdyCfUUbyHyzP+fCMFb1gFZunQ99N6d/CgqlRGgRVmg PRJuQQn0vVnJLez3BpHRmPTrmDVdUEie4tLruGnQtdH6HjqZ3Lnbvkt7GCYm3p4kvDjI 88nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZfscQN12; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h26si109033ioz.60.2021.09.01.16.40.53; Wed, 01 Sep 2021 16:41:04 -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; dkim=pass header.i=@chromium.org header.s=google header.b=ZfscQN12; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234301AbhIAXjA (ORCPT + 99 others); Wed, 1 Sep 2021 19:39:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237831AbhIAXi6 (ORCPT ); Wed, 1 Sep 2021 19:38:58 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0BA2C0613C1 for ; Wed, 1 Sep 2021 16:38:00 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id c17so63913pgc.0 for ; Wed, 01 Sep 2021 16:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9ETte6Kips/PnFBmTfas2bMsUhjtMM1DpuPy9sky4cQ=; b=ZfscQN12kDgZwo+XD7Qpk9FvFCIEXtWXWcFlQXOJkK9ymiVGmdr0/mK6ZXA99ZlcR7 4Nm1lKZ9Ci8k7YmchHIEm/DpVqRzi4aMjyIGBbF+gKldq2J6jxKFjw6RLFMJT8SSr7ed NKJzK+KGcbo8jGV1nCXwuYNW8hL40TfxTGykA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9ETte6Kips/PnFBmTfas2bMsUhjtMM1DpuPy9sky4cQ=; b=RuiUX+82WFie9v3obXBdBnADz2KrmkY5dGGD8sTqYWzpH+3Zo6835GL7Ia9Lc3lf2O Tm4/Ks4D34z1GSeeOa6chMoYLpY9aXDwv8j8qiKSNLWtCPL4ZnCIy+/dfp9r0WG6Lmi1 AzNhHUc7lV2fZ5GBSkKoOUd7yS1XJf72DtlS6BvkBM3bQuZlB9/lQ4fkjVb1jspQjI1K HT1ifKgGxuFPcS3Vj7CeNT3hKm7J34OMmt84qx4C5z79peljWpzbYPgBvbyEdAWYN203 LnNZ+sVkEvs3swieH2p+jx5ho6LaE4hfS9lH9OiXYnNa9XNtnGh+kAdI0xjDPFtfvvR0 Ebhg== X-Gm-Message-State: AOAM531HyURxsA3V9+C8t2yJO358x8omnRMgrtFE3W6C/JIpvCgjALKO KqAjd+CdxFfq4LHOhC7RlOsupQ== X-Received: by 2002:a05:6a00:884:b0:3ef:69c7:1264 with SMTP id q4-20020a056a00088400b003ef69c71264mr367454pfj.4.1630539480468; Wed, 01 Sep 2021 16:38:00 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l18sm84388pff.24.2021.09.01.16.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 16:37:59 -0700 (PDT) From: Kees Cook To: Josh Poimboeuf Cc: Kees Cook , Arnd Bergmann , Peter Zijlstra , linux-arch@vger.kernel.org, Jessica Yu , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Alexander Egorenkov , Sven Schnelle , Ilya Leoshkevich , "Steven Rostedt (VMware)" , Ingo Molnar , Sami Tolvanen , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH 1/4] vmlinux.lds.h: Use regular *RODATA and *RO_AFTER_INIT_DATA suffixes Date: Wed, 1 Sep 2021 16:37:54 -0700 Message-Id: <20210901233757.2571878-2-keescook@chromium.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210901233757.2571878-1-keescook@chromium.org> References: <20210901233757.2571878-1-keescook@chromium.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2506; h=from:subject; bh=jMRkqsYUYC0NP4Qv/R9OaLTgGjgQkzcbh3jh0B2PzXU=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBhMA7ULYltKgeAZ9HyjGCFBRAl7qioF9vacYWKi8nP va25hKaJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCYTAO1AAKCRCJcvTf3G3AJvx/EA CeLXm7a58c122qvl0iZ2rUEVA0aPmh3IH0vAedkHUyG1wZC8ikNmZ9iYbgcQ9qxAABqeDTtRz0bBIk /C8YFJhRiWQObwvTjdaG959SgQb/tXfZQbeD+KPnyIVgoOnNj7rYEn6z8nFFnKw5T1/QdTgGn+CdsZ eQByYvVNXsoYuiGjGDVE1ZbTxeB+pdZe71ihgfhWVx2H8Ej+tPFwEM08nVropvk+HtU2TGe4xIvldA EG4zsL5iJ3jl9f3FU1fchY5RbsVUjGVupbPMBvlp0xN1QMDQU7Hv0kL8seGtOB7E4Of+/I01x0Fqbi /TTxZdLUb0Xqgwt8GGeXkhudNJKk0nIefhKAHUUF+uTxlFBght1Y7K5IhA+oFF5orJKrguQ5723F10 bhroz4zu2doCOOT/wrBdcraGxAfJLwg3ptdaRmGrJ33Hj4x7p/GKYt3F1bHtsJCYwKBZz4++nFrfpa RBLpCq1aegsmh5Z5p3qo6YRN0TQu+Nt5Q1ij5dFttLl2cytkOERXBzQ/xAXDhOKPjYMhRf+FEFcf+d Sx77tcwEKoMfbOruo0jx6hEHOavKZ2kdNIiG7noiStDka6V1WAu81G03XEX6DpCQB85qHUFtdgpEjO bvmY78GolJ2QA0RYL8b/xjUKNadvB3LBuiZz4HB1105G1ikJBWFlihNoj5wg== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rename the various section macros that live in RODATA and RO_AFTER_INIT_DATA. Just being called "DATA" implies they are expected to be writable. Cc: Arnd Bergmann Cc: Josh Poimboeuf Cc: Peter Zijlstra (Intel) Cc: linux-arch@vger.kernel.org Signed-off-by: Kees Cook --- arch/s390/kernel/vmlinux.lds.S | 2 +- include/asm-generic/vmlinux.lds.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S index 63bdb9e1bfc1..93bc74c2a71b 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S @@ -64,7 +64,7 @@ SECTIONS __start_ro_after_init = .; .data..ro_after_init : { *(.data..ro_after_init) - JUMP_TABLE_DATA + JUMP_TABLE_RO_AFTER_INIT_DATA } :data EXCEPTION_TABLE(16) . = ALIGN(PAGE_SIZE); diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 62669b36a772..70c74fdf9c9b 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -128,7 +128,7 @@ * used to determine the order of the priority of each sched class in * relation to each other. */ -#define SCHED_DATA \ +#define SCHED_RODATA \ STRUCT_ALIGN(); \ __begin_sched_classes = .; \ *(__idle_sched_class) \ @@ -396,13 +396,13 @@ . = __start_init_task + THREAD_SIZE; \ __end_init_task = .; -#define JUMP_TABLE_DATA \ +#define JUMP_TABLE_RO_AFTER_INIT_DATA \ . = ALIGN(8); \ __start___jump_table = .; \ KEEP(*(__jump_table)) \ __stop___jump_table = .; -#define STATIC_CALL_DATA \ +#define STATIC_CALL_RO_AFTER_INIT_DATA \ . = ALIGN(8); \ __start_static_call_sites = .; \ KEEP(*(.static_call_sites)) \ @@ -420,8 +420,8 @@ . = ALIGN(8); \ __start_ro_after_init = .; \ *(.data..ro_after_init) \ - JUMP_TABLE_DATA \ - STATIC_CALL_DATA \ + JUMP_TABLE_RO_AFTER_INIT_DATA \ + STATIC_CALL_RO_AFTER_INIT_DATA \ __end_ro_after_init = .; #endif @@ -433,7 +433,7 @@ .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ __start_rodata = .; \ *(.rodata) *(.rodata.*) \ - SCHED_DATA \ + SCHED_RODATA \ RO_AFTER_INIT_DATA /* Read only after init */ \ . = ALIGN(8); \ __start___tracepoints_ptrs = .; \ -- 2.30.2