public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Wedson Almeida Filho <wedsonaf@gmail•com>
To: Alexander Viro <viro@zeniv•linux.org.uk>,
	Christian Brauner <brauner@kernel•org>,
	linux-fsdevel@vger•kernel.org
Cc: linux-kernel@vger•kernel.org,
	Wedson Almeida Filho <walmeida@microsoft•com>,
	"David S. Miller" <davem@davemloft•net>,
	Eric Dumazet <edumazet@google•com>,
	Jakub Kicinski <kuba@kernel•org>, Paolo Abeni <pabeni@redhat•com>,
	Richard Cochran <richardcochran@gmail•com>,
	netdev@vger•kernel.org
Subject: [PATCH 29/29] net: move sockfs_xattr_handlers to .rodata
Date: Sat, 30 Sep 2023 02:00:33 -0300	[thread overview]
Message-ID: <20230930050033.41174-30-wedsonaf@gmail.com> (raw)
In-Reply-To: <20230930050033.41174-1-wedsonaf@gmail.com>

From: Wedson Almeida Filho <walmeida@microsoft•com>

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>
---
 include/linux/pseudo_fs.h | 2 +-
 net/socket.c              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/pseudo_fs.h b/include/linux/pseudo_fs.h
index eceda1d1407a..730f77381d55 100644
--- a/include/linux/pseudo_fs.h
+++ b/include/linux/pseudo_fs.h
@@ -5,7 +5,7 @@
 
 struct pseudo_fs_context {
 	const struct super_operations *ops;
-	const struct xattr_handler **xattr;
+	const struct xattr_handler * const *xattr;
 	const struct dentry_operations *dops;
 	unsigned long magic;
 };
diff --git a/net/socket.c b/net/socket.c
index 2b0e54b2405c..0a99fc22641e 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -400,7 +400,7 @@ static const struct xattr_handler sockfs_security_xattr_handler = {
 	.set = sockfs_security_xattr_set,
 };
 
-static const struct xattr_handler *sockfs_xattr_handlers[] = {
+static const struct xattr_handler * const sockfs_xattr_handlers[] = {
 	&sockfs_xattr_handler,
 	&sockfs_security_xattr_handler,
 	NULL
-- 
2.34.1


       reply	other threads:[~2023-09-30  5:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230930050033.41174-1-wedsonaf@gmail.com>
2023-09-30  5:00 ` Wedson Almeida Filho [this message]
2023-10-04 21:24   ` [PATCH 29/29] net: move sockfs_xattr_handlers to .rodata Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230930050033.41174-30-wedsonaf@gmail.com \
    --to=wedsonaf@gmail$(echo .)com \
    --cc=brauner@kernel$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=linux-fsdevel@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=richardcochran@gmail$(echo .)com \
    --cc=viro@zeniv$(echo .)linux.org.uk \
    --cc=walmeida@microsoft$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox