Commit f796f8b3 authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust

NFS: Introduce new-style XDR decoding functions for NFSv2

We'd like to prevent local buffer overflows caused by malicious or
broken servers.  New xdr_stream style decoders can do that.

For efficiency, we also eventually want to be able to pass xdr_streams
from call_decode() to all XDR decoding functions, rather than building
an xdr_stream in every XDR decoding function in the kernel.

nfs_decode_dirent() is renamed to follow the naming convention of the
other two dirent decoders.

Static helper functions are left without the "inline" directive.  This
allows the compiler to choose automatically how to optimize these for
size or speed.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Tested-by: default avatarJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 85828493
...@@ -187,7 +187,7 @@ extern void nfs_destroy_directcache(void); ...@@ -187,7 +187,7 @@ extern void nfs_destroy_directcache(void);
/* nfs2xdr.c */ /* nfs2xdr.c */
extern int nfs_stat_to_errno(enum nfs_stat); extern int nfs_stat_to_errno(enum nfs_stat);
extern struct rpc_procinfo nfs_procedures[]; extern struct rpc_procinfo nfs_procedures[];
extern __be32 *nfs_decode_dirent(struct xdr_stream *, struct nfs_entry *, struct nfs_server *, int); extern __be32 *nfs2_decode_dirent(struct xdr_stream *, struct nfs_entry *, struct nfs_server *, int);
/* nfs3xdr.c */ /* nfs3xdr.c */
extern struct rpc_procinfo nfs3_procedures[]; extern struct rpc_procinfo nfs3_procedures[];
......
This diff is collapsed.
...@@ -731,7 +731,7 @@ const struct nfs_rpc_ops nfs_v2_clientops = { ...@@ -731,7 +731,7 @@ const struct nfs_rpc_ops nfs_v2_clientops = {
.statfs = nfs_proc_statfs, .statfs = nfs_proc_statfs,
.fsinfo = nfs_proc_fsinfo, .fsinfo = nfs_proc_fsinfo,
.pathconf = nfs_proc_pathconf, .pathconf = nfs_proc_pathconf,
.decode_dirent = nfs_decode_dirent, .decode_dirent = nfs2_decode_dirent,
.read_setup = nfs_proc_read_setup, .read_setup = nfs_proc_read_setup,
.read_done = nfs_read_done, .read_done = nfs_read_done,
.write_setup = nfs_proc_write_setup, .write_setup = nfs_proc_write_setup,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment