#include <linux/slab.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/pagemap.h>
#include <linux/user_namespace.h>
#include <linux/sunrpc/auth_gss.h>
#include <linux/sunrpc/gss_err.h>
#include <linux/sunrpc/svcauth.h>
#include <linux/sunrpc/svcauth_gss.h>
#include <linux/sunrpc/cache.h>
#include <linux/sunrpc/gss_krb5.h>
#include <trace/events/rpcgss.h>
#include "gss_rpc_upcall.h"
#define GSS_MAX_CKSUMSIZE …
#define GSS_SCRATCH_SIZE …
struct gss_svc_data { … };
static int netobj_equal(struct xdr_netobj *a, struct xdr_netobj *b)
{ … }
#define RSI_HASHBITS …
#define RSI_HASHMAX …
struct rsi { … };
static struct rsi *rsi_update(struct cache_detail *cd, struct rsi *new, struct rsi *old);
static struct rsi *rsi_lookup(struct cache_detail *cd, struct rsi *item);
static void rsi_free(struct rsi *rsii)
{ … }
static void rsi_free_rcu(struct rcu_head *head)
{ … }
static void rsi_put(struct kref *ref)
{ … }
static inline int rsi_hash(struct rsi *item)
{ … }
static int rsi_match(struct cache_head *a, struct cache_head *b)
{ … }
static int dup_to_netobj(struct xdr_netobj *dst, char *src, int len)
{ … }
static inline int dup_netobj(struct xdr_netobj *dst, struct xdr_netobj *src)
{ … }
static void rsi_init(struct cache_head *cnew, struct cache_head *citem)
{ … }
static void update_rsi(struct cache_head *cnew, struct cache_head *citem)
{ … }
static struct cache_head *rsi_alloc(void)
{ … }
static int rsi_upcall(struct cache_detail *cd, struct cache_head *h)
{ … }
static void rsi_request(struct cache_detail *cd,
struct cache_head *h,
char **bpp, int *blen)
{ … }
static int rsi_parse(struct cache_detail *cd,
char *mesg, int mlen)
{ … }
static const struct cache_detail rsi_cache_template = …;
static struct rsi *rsi_lookup(struct cache_detail *cd, struct rsi *item)
{ … }
static struct rsi *rsi_update(struct cache_detail *cd, struct rsi *new, struct rsi *old)
{ … }
#define RSC_HASHBITS …
#define RSC_HASHMAX …
#define GSS_SEQ_WIN …
struct gss_svc_seq_data { … };
struct rsc { … };
static struct rsc *rsc_update(struct cache_detail *cd, struct rsc *new, struct rsc *old);
static struct rsc *rsc_lookup(struct cache_detail *cd, struct rsc *item);
static void rsc_free(struct rsc *rsci)
{ … }
static void rsc_free_rcu(struct rcu_head *head)
{ … }
static void rsc_put(struct kref *ref)
{ … }
static inline int
rsc_hash(struct rsc *rsci)
{ … }
static int
rsc_match(struct cache_head *a, struct cache_head *b)
{ … }
static void
rsc_init(struct cache_head *cnew, struct cache_head *ctmp)
{ … }
static void
update_rsc(struct cache_head *cnew, struct cache_head *ctmp)
{ … }
static struct cache_head *
rsc_alloc(void)
{ … }
static int rsc_upcall(struct cache_detail *cd, struct cache_head *h)
{ … }
static int rsc_parse(struct cache_detail *cd,
char *mesg, int mlen)
{ … }
static const struct cache_detail rsc_cache_template = …;
static struct rsc *rsc_lookup(struct cache_detail *cd, struct rsc *item)
{ … }
static struct rsc *rsc_update(struct cache_detail *cd, struct rsc *new, struct rsc *old)
{ … }
static struct rsc *
gss_svc_searchbyctx(struct cache_detail *cd, struct xdr_netobj *handle)
{ … }
static bool gss_check_seq_num(const struct svc_rqst *rqstp, struct rsc *rsci,
u32 seq_num)
{ … }
static int
svcauth_gss_verify_header(struct svc_rqst *rqstp, struct rsc *rsci,
__be32 *rpcstart, struct rpc_gss_wire_cred *gc)
{ … }
static bool
svcauth_gss_encode_verf(struct svc_rqst *rqstp, struct gss_ctx *ctx_id, u32 seq)
{ … }
struct gss_domain { … };
static struct auth_domain *
find_gss_auth_domain(struct gss_ctx *ctx, u32 svc)
{ … }
static struct auth_ops svcauthops_gss;
u32 svcauth_gss_flavor(struct auth_domain *dom)
{ … }
EXPORT_SYMBOL_GPL(…);
struct auth_domain *
svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name)
{ … }
EXPORT_SYMBOL_GPL(…);
static noinline_for_stack int
svcauth_gss_unwrap_integ(struct svc_rqst *rqstp, u32 seq, struct gss_ctx *ctx)
{ … }
static noinline_for_stack int
svcauth_gss_unwrap_priv(struct svc_rqst *rqstp, u32 seq, struct gss_ctx *ctx)
{ … }
static enum svc_auth_status
svcauth_gss_set_client(struct svc_rqst *rqstp)
{ … }
static bool
svcauth_gss_proc_init_verf(struct cache_detail *cd, struct svc_rqst *rqstp,
struct xdr_netobj *out_handle, int *major_status,
u32 seq_num)
{ … }
static void gss_free_in_token_pages(struct gssp_in_token *in_token)
{ … }
static int gss_read_proxy_verf(struct svc_rqst *rqstp,
struct rpc_gss_wire_cred *gc,
struct xdr_netobj *in_handle,
struct gssp_in_token *in_token)
{ … }
static bool
svcxdr_encode_gss_init_res(struct xdr_stream *xdr,
struct xdr_netobj *handle,
struct xdr_netobj *gss_token,
unsigned int major_status,
unsigned int minor_status, u32 seq_num)
{ … }
static int
svcauth_gss_legacy_init(struct svc_rqst *rqstp,
struct rpc_gss_wire_cred *gc)
{ … }
static int gss_proxy_save_rsc(struct cache_detail *cd,
struct gssp_upcall_data *ud,
uint64_t *handle)
{ … }
static int svcauth_gss_proxy_init(struct svc_rqst *rqstp,
struct rpc_gss_wire_cred *gc)
{ … }
static int set_gss_proxy(struct net *net, int type)
{ … }
static bool use_gss_proxy(struct net *net)
{ … }
static noinline_for_stack int
svcauth_gss_proc_init(struct svc_rqst *rqstp, struct rpc_gss_wire_cred *gc)
{ … }
#ifdef CONFIG_PROC_FS
static ssize_t write_gssp(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t read_gssp(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
static const struct proc_ops use_gss_proxy_proc_ops = …;
static int create_use_gss_proxy_proc_entry(struct net *net)
{ … }
static void destroy_use_gss_proxy_proc_entry(struct net *net)
{ … }
static ssize_t read_gss_krb5_enctypes(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
static const struct proc_ops gss_krb5_enctypes_proc_ops = …;
static int create_krb5_enctypes_proc_entry(struct net *net)
{ … }
static void destroy_krb5_enctypes_proc_entry(struct net *net)
{ … }
#else
static int create_use_gss_proxy_proc_entry(struct net *net)
{
return 0;
}
static void destroy_use_gss_proxy_proc_entry(struct net *net) {}
static int create_krb5_enctypes_proc_entry(struct net *net)
{
return 0;
}
static void destroy_krb5_enctypes_proc_entry(struct net *net) {}
#endif
static bool
svcauth_gss_decode_credbody(struct xdr_stream *xdr,
struct rpc_gss_wire_cred *gc,
__be32 **rpcstart)
{ … }
static enum svc_auth_status
svcauth_gss_accept(struct svc_rqst *rqstp)
{ … }
static u32
svcauth_gss_prepare_to_wrap(struct svc_rqst *rqstp, struct gss_svc_data *gsd)
{ … }
static int svcauth_gss_wrap_integ(struct svc_rqst *rqstp)
{ … }
static int svcauth_gss_wrap_priv(struct svc_rqst *rqstp)
{ … }
static int
svcauth_gss_release(struct svc_rqst *rqstp)
{ … }
static void
svcauth_gss_domain_release_rcu(struct rcu_head *head)
{ … }
static void
svcauth_gss_domain_release(struct auth_domain *dom)
{ … }
static rpc_authflavor_t svcauth_gss_pseudoflavor(struct svc_rqst *rqstp)
{ … }
static struct auth_ops svcauthops_gss = …;
static int rsi_cache_create_net(struct net *net)
{ … }
static void rsi_cache_destroy_net(struct net *net)
{ … }
static int rsc_cache_create_net(struct net *net)
{ … }
static void rsc_cache_destroy_net(struct net *net)
{ … }
int
gss_svc_init_net(struct net *net)
{ … }
void
gss_svc_shutdown_net(struct net *net)
{ … }
int
gss_svc_init(void)
{ … }
void
gss_svc_shutdown(void)
{ … }