Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp374179rdb; Sat, 30 Sep 2023 07:48:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2oa5Ae7gSZ85YdwV8MPoWkDQGLhFADcil6cNJG3OJZFpNQ4L+utk8O0LRXokXXPEmXdds X-Received: by 2002:a05:6870:219c:b0:1d7:1ad1:3f8c with SMTP id l28-20020a056870219c00b001d71ad13f8cmr8549210oae.49.1696085301589; Sat, 30 Sep 2023 07:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696085301; cv=none; d=google.com; s=arc-20160816; b=HdFSyHJ9MnmuKHJXStEdOpj8Q8sGqic4EyJ7k/OgN5a0Jrfdx8EeO2n0YkorRD4lgW cPTncbMdugtQNx5unOVdWze7d3vgMzxN5FMtOFjVeb1dU1vfOE7bwB2Nl51AmbwvYlGt N1/oBXTOMH4F03wZkzeTAHSmB0y//O5YFKrMgjnGaCrrrN7yTenB6b5tE1mgag/ovCAw Jxn60SMhY/KLru+aaa+Wtr5o3+bCt1G1bKcPiEqDHo+M9hNjD/EWHf4bBK296+o9ImPr eUpxsqM4tQlfi7UZJTApE7rPJFxu/CClQMbEdvTMjBBeLfnA5TQzmMb6Q950VtxrR1UN TcuA== 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=Wc3/lDJ0Y70q5wqO7T6IeDRSePuhtOmjFGCpqJDnCH4=; fh=hz331NCuG3bOmGEABlBXKdWALneJ3B2uH53pUjAYPPY=; b=l0D8aX48YowohlE4sMu+Z4nsG267sGqgHlT/Q7jj+1oquDW/vlACww/QnzAkNvTVgh YFpvDNPQMiSpvRQY9jWa0az6qh4nu5l3ZNJgOvN+TpelRkLbXetIL3WoWUpbgzxhyUYK ZyyJVIEz891l+HfO8+smrrZ6ZNzg9jTP1/moXf4dEehThvf4qtJ46sU/kocnqBd/qnHR UtTmsrbnOmbVCtCraHHsZS7QfJMbx7Ve0bVoNYkQE9Ke+6RYYBQ50BhTUuOjMOSeIPTp jquCwBiK+uNDTVAeY015E1yHd4DdaWhflE/3iX0Y69P6hbzKiGQzIhZDeS2Kl1SppuPE 7TmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Kmjejcs6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id ei37-20020a056a0080e500b0068e243a72basi22060357pfb.330.2023.09.30.07.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 07:48:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Kmjejcs6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id E01E48600C69; Fri, 29 Sep 2023 22:03:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234148AbjI3FDc (ORCPT + 99 others); Sat, 30 Sep 2023 01:03:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234172AbjI3FC5 (ORCPT ); Sat, 30 Sep 2023 01:02:57 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1014F1716; Fri, 29 Sep 2023 22:02:01 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-578b4981526so9577018a12.0; Fri, 29 Sep 2023 22:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696050121; x=1696654921; 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=Wc3/lDJ0Y70q5wqO7T6IeDRSePuhtOmjFGCpqJDnCH4=; b=Kmjejcs6cA9AmCbLWbwjDyo5/oq/p4ugr8dzIFKsz7B3OqCJCDkkuqvAGr5nKDo9se yXxv2j5A5Lf9K0MRJanMitul1TQSlh4rmJ/y1FQlWORMFU1iICjYW/aTsW1ey+mYNHIG 4ceorT8CgJVOQSzlJrvyuWGYCN5keizFS+o/RghJLHuTtIAMWBAJzNvEh/L85kH+aXZM Eyq1Q4+4i1fklgTkRVxGGcO6MakyUlzPHlESo5RnMHiooaLYH4z/fcdHCfzo2wQdzrK8 jcH6Q6vDN3jz89vHhALqKW2tozaUdP4jWDPRKdYyhOe/qwEvg8hzEG7RkISbwCAjq514 t5OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696050121; x=1696654921; 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=Wc3/lDJ0Y70q5wqO7T6IeDRSePuhtOmjFGCpqJDnCH4=; b=iRaY03i69y0xYuDvru75+uGODn+wVhQeBmxxxXc5YAfYINqywnHlBTH+G8DhGi1+2P ioWyLte3vW+AQEHhbfl0ztBozxrk/CuEKJj7g1T2uJKJqhA9QF+PY3/VJb1xPe5xAtGJ 8kDbKZfHVMEtHpv+g/AA4tTt2CHPwtENLuwRJhhKPKL7m3erlouPFwkiR4Gob2ItAadn em1P7v+wLgWHdlNnyHpzIYaz3brVPx+WnsuV7nGf3RMP7mSH5N0Sumn+sJHaAVm3KGjW i6cNEzBAR7FwthfyVxH5aFZtcngMrGV2An0HrjUrydYtM/jd5tRWUl2GRndH/NeKKpFE ulfw== X-Gm-Message-State: AOJu0YwhKxySJNNrGz0y11QzVWLoO3tNeUh5c1YT3EOmDGWxVCDhpG9k fa04bmVo5FtHuR3zrHmp8Lc= X-Received: by 2002:a05:6a20:1451:b0:15d:e68d:a855 with SMTP id a17-20020a056a20145100b0015de68da855mr6635638pzi.29.1696050121350; Fri, 29 Sep 2023 22:02:01 -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.01.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 22:02:01 -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 , Konstantin Komarov , ntfs3@lists.linux.dev Subject: [PATCH 19/29] ntfs3: move ntfs_xattr_handlers to .rodata Date: Sat, 30 Sep 2023 02:00:23 -0300 Message-Id: <20230930050033.41174-20-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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Fri, 29 Sep 2023 22:03:50 -0700 (PDT) From: Wedson Almeida Filho This makes it harder for accidental or malicious changes to ntfs_xattr_handlers at runtime. Cc: Konstantin Komarov Cc: ntfs3@lists.linux.dev Signed-off-by: Wedson Almeida Filho --- fs/ntfs3/ntfs_fs.h | 2 +- fs/ntfs3/xattr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index 629403ede6e5..41c1538f8e51 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -872,7 +872,7 @@ int ntfs_init_acl(struct mnt_idmap *idmap, struct inode *inode, int ntfs_acl_chmod(struct mnt_idmap *idmap, struct dentry *dentry); ssize_t ntfs_listxattr(struct dentry *dentry, char *buffer, size_t size); -extern const struct xattr_handler *ntfs_xattr_handlers[]; +extern const struct xattr_handler * const ntfs_xattr_handlers[]; int ntfs_save_wsl_perm(struct inode *inode, __le16 *ea_size); void ntfs_get_wsl_perm(struct inode *inode); diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c index 023f314e8950..a67ff036a251 100644 --- a/fs/ntfs3/xattr.c +++ b/fs/ntfs3/xattr.c @@ -1016,7 +1016,7 @@ static const struct xattr_handler ntfs_other_xattr_handler = { .list = ntfs_xattr_user_list, }; -const struct xattr_handler *ntfs_xattr_handlers[] = { +const struct xattr_handler * const ntfs_xattr_handlers[] = { &ntfs_other_xattr_handler, NULL, }; -- 2.34.1