Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp243854rdb; Sat, 30 Sep 2023 02:51:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKCVSUfQkkRXH5pZ69m6gyYuegwwXQSw5AV4skpuEGVNVz33oXd7e0C3tNYeh1wYLNiOrT X-Received: by 2002:a05:6358:63a8:b0:143:8984:50c2 with SMTP id k40-20020a05635863a800b00143898450c2mr7427470rwh.32.1696067507787; Sat, 30 Sep 2023 02:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696067507; cv=none; d=google.com; s=arc-20160816; b=TcuqRuJpqz9FQf1STlBGSgguTpwa6HbitCYmYwsb3EC68ZFOSsjX3TevgAagPdfm7i gsn7fUM1ov/GeGfU3zrcZ9c/A18/Zu/FYF2K3yzlNG/jm8R+k3oNKIb4xp1mU6ZQSsEU QwLQlFJ0aVcl+L4JsraYvzrJagwX4D2ATm4iQ+DG5WwAnYwZcokKLnkmm/pO+54sZLX+ Q7/mWakn2d2cwAFjqAL4imxKxdBY70z6on9CDyz+8E5AVDOAiMG2nrt85iItbeRJlIpg RMPB6hGkA+5JAwqj5X9pIvexkrlbviArspNoiFWdjNo+WSzwJQ9LK/WDGA+4CTriXdFR 4Ctg== 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=/UA+v7vVQRQxu5MLsOJ6RxWE6x/okoJ8LNf7oCvDbOY=; fh=o9ao+tpQoR2EJBfAPzmA6MlUItBaxiwiV3YDP3FS9jw=; b=oI7ZCRoc+tGMUOBXtHpzLP6gO4U/Yge1nY24S8pfK4rxbf5P7BaNSvUxPHSljtANj1 ukvzeduOBoHSc9nosaocC0CrcFkVL4/8pc+IoGQ/0yp1k1fCNFjE1E5vNqsJTTRyhbpc N4ZO4xN/IlOHTIMV6M5877DBlaBy19PC7XAJJQ9s2NgFHU9xIDcpEkCyLDxFRwdgSh4F /eFhgMijz/G6YHSs7lAI7/AhGHbYsblHaPlu4G94HFhDgImxeBoypk1bbp3mRUO5uZs0 17WbfSGer7DV8dZKbmaF5Pa2ITiYXxrPp5AHOSU780mFZuNKy9cJ5FMIQDJvJu1jFPD7 Crig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="J/Ur7VXN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id b6-20020a17090a6e0600b002597ed3cc4fsi3096389pjk.189.2023.09.30.02.51.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 02:51:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="J/Ur7VXN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4C80082A54CE; Fri, 29 Sep 2023 22:04:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234074AbjI3FDq (ORCPT + 99 others); Sat, 30 Sep 2023 01:03:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234211AbjI3FDD (ORCPT ); Sat, 30 Sep 2023 01:03:03 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EE3F19B2; Fri, 29 Sep 2023 22:02:09 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1c5ff5f858dso87314455ad.2; Fri, 29 Sep 2023 22:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696050129; x=1696654929; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/UA+v7vVQRQxu5MLsOJ6RxWE6x/okoJ8LNf7oCvDbOY=; b=J/Ur7VXNDXSb5TMhCWT6V5Q7cX1BUXmsXlPMi4l/n3vGOR6xfm6p6t6fIGmsusncCP DRyCFL2fS4TvZecx3fDy4AjO4xuRArhrPpR7bmuELUAKaZa/nX/J6F+s/CoEjnGkf6mX Rwxb4i12JRG0Tn+/nP1ln+rxvGJU0KBeiZu7VDfxs+3WKRTmg+3/Q7GCOTvPSCLiJt0p u1K7p07n2GH6gTjzrXIVv/bXk3lli7dMDQHrxQ8giHTIq1oh+4cM45OKdaExrQgjD0wy r9LklzBAX6ivTX0xbAiHBrnotuk5Nstx7c3+Wzu5RuMoBHucpJzplVTyRuGQ+TelXKiZ yKtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696050129; x=1696654929; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/UA+v7vVQRQxu5MLsOJ6RxWE6x/okoJ8LNf7oCvDbOY=; b=uQYArvhS1MrOy6f0eMGnADQ7lEfhXoFr2bKr16E7/oEIDcSRISGBhWDnQznejEzNFx I4bU15W4tra08XKQExNHsiScPiwBg0zXmBu9biB09ycgylal67U2V+u7WpeF4fOoPs87 FYBxqSvD9tqLeK2eZEVdTDHMJIKB5Ec8/F8TQBz4MrvU1sGZcPPN4Qf/Q9IsyfRB2ibI TkP6Q7Bw6Vy++2Nv8WMvH84Bt0lUpar+iyjZvfigChebR2VyUKPJMeu+gD0o8NpJV6bV oU5zIWgLtgvKTOw5AKmoZsf5mzaoqsEt7JLhM3SVoDxtfty0t5y9gAl+MWUAXJX7ON7X gQuQ== X-Gm-Message-State: AOJu0Yyxf2jo1ktKr2dewpgLeZe/ZseYqLBHT+BGqCtS9bI6x76shQGk IrzSQMyaLQ1YQ7bSXY1VVZg= X-Received: by 2002:a17:903:230d:b0:1c0:98fe:3677 with SMTP id d13-20020a170903230d00b001c098fe3677mr6409717plh.56.1696050128820; Fri, 29 Sep 2023 22:02:08 -0700 (PDT) Received: from wedsonaf-dev.home.lan ([189.124.190.154]) by smtp.googlemail.com with ESMTPSA id y10-20020a17090322ca00b001c322a41188sm392136plg.117.2023.09.29.22.02.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 22:02:08 -0700 (PDT) From: Wedson Almeida Filho To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Wedson Almeida Filho , Mike Marshall , Martin Brandenburg , devel@lists.orangefs.org Subject: [PATCH 21/29] orangefs: move orangefs_xattr_handlers to .rodata Date: Sat, 30 Sep 2023 02:00:25 -0300 Message-Id: <20230930050033.41174-22-wedsonaf@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230930050033.41174-1-wedsonaf@gmail.com> References: <20230930050033.41174-1-wedsonaf@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 29 Sep 2023 22:04:33 -0700 (PDT) From: Wedson Almeida Filho This makes it harder for accidental or malicious changes to orangefs_xattr_handlers at runtime. Cc: Mike Marshall Cc: Martin Brandenburg Cc: devel@lists.orangefs.org Signed-off-by: Wedson Almeida Filho --- fs/orangefs/orangefs-kernel.h | 2 +- fs/orangefs/xattr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h index ce20d3443869..e211f29544e5 100644 --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h @@ -103,7 +103,7 @@ enum orangefs_vfs_op_states { #define ORANGEFS_CACHE_CREATE_FLAGS 0 #endif -extern const struct xattr_handler *orangefs_xattr_handlers[]; +extern const struct xattr_handler * const orangefs_xattr_handlers[]; extern struct posix_acl *orangefs_get_acl(struct inode *inode, int type, bool rcu); extern int orangefs_set_acl(struct mnt_idmap *idmap, diff --git a/fs/orangefs/xattr.c b/fs/orangefs/xattr.c index 68b62689a63e..74ef75586f38 100644 --- a/fs/orangefs/xattr.c +++ b/fs/orangefs/xattr.c @@ -554,7 +554,7 @@ static const struct xattr_handler orangefs_xattr_default_handler = { .set = orangefs_xattr_set_default, }; -const struct xattr_handler *orangefs_xattr_handlers[] = { +const struct xattr_handler * const orangefs_xattr_handlers[] = { &orangefs_xattr_default_handler, NULL }; -- 2.34.1