aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs3xdr.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-05-12 15:36:49 +0200
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2017-07-13 15:57:57 -0400
commit511e936bf2b3e8be2a3160ace3d86be07962a7a8 (patch)
treeb9eabbc23dbaa937917d01f8f8dc5d8a60124b95 /fs/nfs/nfs3xdr.c
parentnfs: use ARRAY_SIZE() in the nfsacl_version3 declaration (diff)
downloadlinux-dev-511e936bf2b3e8be2a3160ace3d86be07962a7a8.tar.xz
linux-dev-511e936bf2b3e8be2a3160ace3d86be07962a7a8.zip
sunrpc: mark all struct rpc_procinfo instances as const
struct rpc_procinfo contains function pointers, and marking it as constant avoids it being able to be used as an attach vector for code injections. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs3xdr.c')
-rw-r--r--fs/nfs/nfs3xdr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index 85ff1187e637..670eddb3ae36 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -2554,7 +2554,7 @@ static int nfs3_stat_to_errno(enum nfs_stat status)
.p_name = #proc, \
}
-struct rpc_procinfo nfs3_procedures[] = {
+const struct rpc_procinfo nfs3_procedures[] = {
PROC(GETATTR, getattr, getattr, 1),
PROC(SETATTR, setattr, setattr, 0),
PROC(LOOKUP, lookup, lookup, 2),
@@ -2587,7 +2587,7 @@ const struct rpc_version nfs_version3 = {
};
#ifdef CONFIG_NFS_V3_ACL
-static struct rpc_procinfo nfs3_acl_procedures[] = {
+static const struct rpc_procinfo nfs3_acl_procedures[] = {
[ACLPROC3_GETACL] = {
.p_proc = ACLPROC3_GETACL,
.p_encode = nfs3_xdr_enc_getacl3args,