Skip to content

Commit 7352a67

Browse files
committed
Merge tag 'vfs-6.7.xattr' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs
Pull vfs xattr updates from Christian Brauner: "The 's_xattr' field of 'struct super_block' currently requires a mutable table of 'struct xattr_handler' entries (although each handler itself is const). However, no code in vfs actually modifies the tables. This changes the type of 's_xattr' to allow const tables, and modifies existing file systems to move their tables to .rodata. This is desirable because these tables contain entries with function pointers in them; moving them to .rodata makes it considerably less likely to be modified accidentally or maliciously at runtime" * tag 'vfs-6.7.xattr' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs: (30 commits) const_structs.checkpatch: add xattr_handler net: move sockfs_xattr_handlers to .rodata shmem: move shmem_xattr_handlers to .rodata overlayfs: move xattr tables to .rodata xfs: move xfs_xattr_handlers to .rodata ubifs: move ubifs_xattr_handlers to .rodata squashfs: move squashfs_xattr_handlers to .rodata smb: move cifs_xattr_handlers to .rodata reiserfs: move reiserfs_xattr_handlers to .rodata orangefs: move orangefs_xattr_handlers to .rodata ocfs2: move ocfs2_xattr_handlers and ocfs2_xattr_handler_map to .rodata ntfs3: move ntfs_xattr_handlers to .rodata nfs: move nfs4_xattr_handlers to .rodata kernfs: move kernfs_xattr_handlers to .rodata jfs: move jfs_xattr_handlers to .rodata jffs2: move jffs2_xattr_handlers to .rodata hfsplus: move hfsplus_xattr_handlers to .rodata hfs: move hfs_xattr_handlers to .rodata gfs2: move gfs2_xattr_handlers_max to .rodata fuse: move fuse_xattr_handlers to .rodata ...
2 parents df9c65b + a640d88 commit 7352a67

58 files changed

Lines changed: 71 additions & 70 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

fs/9p/xattr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,27 +162,27 @@ static int v9fs_xattr_handler_set(const struct xattr_handler *handler,
162162
return v9fs_xattr_set(dentry, full_name, value, size, flags);
163163
}
164164

165-
static struct xattr_handler v9fs_xattr_user_handler = {
165+
static const struct xattr_handler v9fs_xattr_user_handler = {
166166
.prefix = XATTR_USER_PREFIX,
167167
.get = v9fs_xattr_handler_get,
168168
.set = v9fs_xattr_handler_set,
169169
};
170170

171-
static struct xattr_handler v9fs_xattr_trusted_handler = {
171+
static const struct xattr_handler v9fs_xattr_trusted_handler = {
172172
.prefix = XATTR_TRUSTED_PREFIX,
173173
.get = v9fs_xattr_handler_get,
174174
.set = v9fs_xattr_handler_set,
175175
};
176176

177177
#ifdef CONFIG_9P_FS_SECURITY
178-
static struct xattr_handler v9fs_xattr_security_handler = {
178+
static const struct xattr_handler v9fs_xattr_security_handler = {
179179
.prefix = XATTR_SECURITY_PREFIX,
180180
.get = v9fs_xattr_handler_get,
181181
.set = v9fs_xattr_handler_set,
182182
};
183183
#endif
184184

185-
const struct xattr_handler *v9fs_xattr_handlers[] = {
185+
const struct xattr_handler * const v9fs_xattr_handlers[] = {
186186
&v9fs_xattr_user_handler,
187187
&v9fs_xattr_trusted_handler,
188188
#ifdef CONFIG_9P_FS_SECURITY

fs/9p/xattr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <net/9p/9p.h>
1111
#include <net/9p/client.h>
1212

13-
extern const struct xattr_handler *v9fs_xattr_handlers[];
13+
extern const struct xattr_handler * const v9fs_xattr_handlers[];
1414

1515
ssize_t v9fs_fid_xattr_get(struct p9_fid *fid, const char *name,
1616
void *buffer, size_t buffer_size);

fs/afs/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ int afs_launder_folio(struct folio *);
15411541
/*
15421542
* xattr.c
15431543
*/
1544-
extern const struct xattr_handler *afs_xattr_handlers[];
1544+
extern const struct xattr_handler * const afs_xattr_handlers[];
15451545

15461546
/*
15471547
* yfsclient.c

fs/afs/xattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static const struct xattr_handler afs_xattr_afs_volume_handler = {
353353
.get = afs_xattr_get_volume,
354354
};
355355

356-
const struct xattr_handler *afs_xattr_handlers[] = {
356+
const struct xattr_handler * const afs_xattr_handlers[] = {
357357
&afs_xattr_afs_acl_handler,
358358
&afs_xattr_afs_cell_handler,
359359
&afs_xattr_afs_fid_handler,

fs/btrfs/xattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ static const struct xattr_handler btrfs_btrfs_xattr_handler = {
442442
.set = btrfs_xattr_handler_set_prop,
443443
};
444444

445-
const struct xattr_handler *btrfs_xattr_handlers[] = {
445+
const struct xattr_handler * const btrfs_xattr_handlers[] = {
446446
&btrfs_security_xattr_handler,
447447
&btrfs_trusted_xattr_handler,
448448
&btrfs_user_xattr_handler,

fs/btrfs/xattr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <linux/xattr.h>
1010

11-
extern const struct xattr_handler *btrfs_xattr_handlers[];
11+
extern const struct xattr_handler * const btrfs_xattr_handlers[];
1212

1313
int btrfs_getxattr(struct inode *inode, const char *name,
1414
void *buffer, size_t size);

fs/ceph/super.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ ssize_t __ceph_getxattr(struct inode *, const char *, void *, size_t);
11191119
extern ssize_t ceph_listxattr(struct dentry *, char *, size_t);
11201120
extern struct ceph_buffer *__ceph_build_xattrs_blob(struct ceph_inode_info *ci);
11211121
extern void __ceph_destroy_xattrs(struct ceph_inode_info *ci);
1122-
extern const struct xattr_handler *ceph_xattr_handlers[];
1122+
extern const struct xattr_handler * const ceph_xattr_handlers[];
11231123

11241124
struct ceph_acl_sec_ctx {
11251125
#ifdef CONFIG_CEPH_FS_POSIX_ACL

fs/ceph/xattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@ void ceph_release_acl_sec_ctx(struct ceph_acl_sec_ctx *as_ctx)
14461446
* List of handlers for synthetic system.* attributes. Other
14471447
* attributes are handled directly.
14481448
*/
1449-
const struct xattr_handler *ceph_xattr_handlers[] = {
1449+
const struct xattr_handler * const ceph_xattr_handlers[] = {
14501450
&ceph_other_xattr_handler,
14511451
NULL,
14521452
};

fs/ecryptfs/ecryptfs_kernel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,6 @@ int ecryptfs_set_f_namelen(long *namelen, long lower_namelen,
702702
int ecryptfs_derive_iv(char *iv, struct ecryptfs_crypt_stat *crypt_stat,
703703
loff_t offset);
704704

705-
extern const struct xattr_handler *ecryptfs_xattr_handlers[];
705+
extern const struct xattr_handler * const ecryptfs_xattr_handlers[];
706706

707707
#endif /* #ifndef ECRYPTFS_KERNEL_H */

fs/ecryptfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ static const struct xattr_handler ecryptfs_xattr_handler = {
12101210
.set = ecryptfs_xattr_set,
12111211
};
12121212

1213-
const struct xattr_handler *ecryptfs_xattr_handlers[] = {
1213+
const struct xattr_handler * const ecryptfs_xattr_handlers[] = {
12141214
&ecryptfs_xattr_handler,
12151215
NULL
12161216
};

0 commit comments

Comments
 (0)