From patchwork Sat Sep 30 05:00:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wedson Almeida Filho X-Patchwork-Id: 146904 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp298608vqb; Sat, 30 Sep 2023 03:07:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEN063TXM0rI2iT6FchYoRFrMvte5gzYUo10N0i4TJTgzwFqVKNyAoepwJ+qbLJfWM2Q1tv X-Received: by 2002:a05:6870:8287:b0:1dc:a055:8587 with SMTP id q7-20020a056870828700b001dca0558587mr7720529oae.6.1696068475903; Sat, 30 Sep 2023 03:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696068475; cv=none; d=google.com; s=arc-20160816; b=rLTpjkE2Gf7Ku3iAaIORefih88kxFz4wYxZIgnKyPmyyfxKCwmBn0HunHakekMD+gE 6aQJHZvbTiFI9NCBcA/PiQNtoS2ouAj06IFAn4vkoEKL/EENDP5Ftw9fBavEnPW234r0 ZvPP6wWnL8QbRdEAAg0kM+vipFYSV38n3fwp+L0bYk30xFBr1EKUq1UcrcI7ccp6XplE grb0bQUlJ4zZfIDwQryXT5HXkWbkkSTU9HzzkJ8nj+6x6p+pD42Wtvhzxh73Lx4Np0cM cG9Cye5Uxr91MsSb6G+XjnKFAIrsroMn3vn6O+PeP2xt6pfFVfjUbKEwPNv9h6l/bcP6 XP2A== 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 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id h11-20020a65480b000000b00584a5cd69basi1423660pgs.177.2023.09.30.03.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 03:07:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; 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 23.128.96.34 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 A5CAF8600C75; Fri, 29 Sep 2023 22:03:57 -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 S234192AbjI3FDc (ORCPT + 19 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 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:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778456698068611917 X-GMAIL-MSGID: 1778456698068611917 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, };