include/linux/sunrpc/svcauth.h
Source file repositories/reference/linux-study-clean/include/linux/sunrpc/svcauth.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/sunrpc/svcauth.h- Extension
.h- Size
- 6186 bytes
- Lines
- 190
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/string.hlinux/sunrpc/msg_prot.hlinux/sunrpc/cache.hlinux/sunrpc/gss_api.hlinux/sunrpc/clnt.hlinux/hash.hlinux/stringhash.hlinux/cred.h
Detected Declarations
struct svc_credstruct svc_rqststruct in6_addrstruct auth_domainstruct auth_opsstruct svc_xprtenum svc_auth_statusfunction init_svc_credfunction free_svc_credfunction hash_strfunction hash_mem
Annotated Snippet
struct svc_cred {
kuid_t cr_uid;
kgid_t cr_gid;
struct group_info *cr_group_info;
u32 cr_flavor; /* pseudoflavor */
/* name of form servicetype/hostname@REALM, passed down by
* gss-proxy: */
char *cr_raw_principal;
/* name of form servicetype@hostname, passed down by
* rpc.svcgssd, or computed from the above: */
char *cr_principal;
char *cr_targ_princ;
struct gss_api_mech *cr_gss_mech;
};
static inline void init_svc_cred(struct svc_cred *cred)
{
cred->cr_group_info = NULL;
cred->cr_raw_principal = NULL;
cred->cr_principal = NULL;
cred->cr_targ_princ = NULL;
cred->cr_gss_mech = NULL;
}
static inline void free_svc_cred(struct svc_cred *cred)
{
if (cred->cr_group_info)
put_group_info(cred->cr_group_info);
kfree(cred->cr_raw_principal);
kfree(cred->cr_principal);
kfree(cred->cr_targ_princ);
gss_mech_put(cred->cr_gss_mech);
init_svc_cred(cred);
}
struct svc_rqst; /* forward decl */
struct in6_addr;
/* Authentication is done in the context of a domain.
*
* Currently, the nfs server uses the auth_domain to stand
* for the "client" listed in /etc/exports.
*
* More generally, a domain might represent a group of clients using
* a common mechanism for authentication and having a common mapping
* between local identity (uid) and network identity. All clients
* in a domain have similar general access rights. Each domain can
* contain multiple principals which will have different specific right
* based on normal Discretionary Access Control.
*
* A domain is created by an authentication flavour module based on name
* only. Userspace then fills in detail on demand.
*
* In the case of auth_unix and auth_null, the auth_domain is also
* associated with entries in another cache representing the mapping
* of ip addresses to the given client.
*/
struct auth_domain {
struct kref ref;
struct hlist_node hash;
char *name;
struct auth_ops *flavour;
struct rcu_head rcu_head;
};
enum svc_auth_status {
SVC_GARBAGE = 1,
SVC_VALID,
SVC_NEGATIVE,
SVC_OK,
SVC_DROP,
SVC_CLOSE,
SVC_DENIED,
SVC_PENDING,
SVC_COMPLETE,
};
/*
* Each authentication flavour registers an auth_ops
* structure.
* name is simply the name.
* flavour gives the auth flavour. It determines where the flavour is registered
* accept() is given a request and should verify it.
* It should inspect the authenticator and verifier, and possibly the data.
* If there is a problem with the authentication *authp should be set.
* The return value of accept() can indicate:
* OK - authorised. client and credential are set in rqstp.
* reqbuf points to arguments
* resbuf points to good place for results. verfier
* is (probably) already in place. Certainly space is
Annotation
- Immediate include surface: `linux/string.h`, `linux/sunrpc/msg_prot.h`, `linux/sunrpc/cache.h`, `linux/sunrpc/gss_api.h`, `linux/sunrpc/clnt.h`, `linux/hash.h`, `linux/stringhash.h`, `linux/cred.h`.
- Detected declarations: `struct svc_cred`, `struct svc_rqst`, `struct in6_addr`, `struct auth_domain`, `struct auth_ops`, `struct svc_xprt`, `enum svc_auth_status`, `function init_svc_cred`, `function free_svc_cred`, `function hash_str`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.