Skip to content

Commit 295d3c4

Browse files
wedsonafbrauner
authored andcommitted
net: move sockfs_xattr_handlers to .rodata
This makes it harder for accidental or malicious changes to sockfs_xattr_handlers at runtime. Cc: "David S. Miller" <davem@davemloft.net> Cc: Eric Dumazet <edumazet@google.com> Cc: Jakub Kicinski <kuba@kernel.org> Cc: Paolo Abeni <pabeni@redhat.com> Cc: Richard Cochran <richardcochran@gmail.com> Cc: netdev@vger.kernel.org Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Link: https://lore.kernel.org/r/20230930050033.41174-30-wedsonaf@gmail.com Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 2f50286 commit 295d3c4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

include/linux/pseudo_fs.h

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

66
struct pseudo_fs_context {
77
const struct super_operations *ops;
8-
const struct xattr_handler **xattr;
8+
const struct xattr_handler * const *xattr;
99
const struct dentry_operations *dops;
1010
unsigned long magic;
1111
};

net/socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ static const struct xattr_handler sockfs_security_xattr_handler = {
403403
.set = sockfs_security_xattr_set,
404404
};
405405

406-
static const struct xattr_handler *sockfs_xattr_handlers[] = {
406+
static const struct xattr_handler * const sockfs_xattr_handlers[] = {
407407
&sockfs_xattr_handler,
408408
&sockfs_security_xattr_handler,
409409
NULL

0 commit comments

Comments
 (0)