MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mls_vnode_create_extattr

Function mls_vnode_create_extattr

freebsd/security/mac_mls/mac_mls.c:3138–3159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3136}
3137
3138static int
3139mls_vnode_create_extattr(struct ucred *cred, struct mount *mp,
3140 struct label *mplabel, struct vnode *dvp, struct label *dvplabel,
3141 struct vnode *vp, struct label *vplabel, struct componentname *cnp)
3142{
3143 struct mac_mls *source, *dest, mm_temp;
3144 size_t buflen;
3145 int error;
3146
3147 buflen = sizeof(mm_temp);
3148 bzero(&mm_temp, buflen);
3149
3150 source = SLOT(cred->cr_label);
3151 dest = SLOT(vplabel);
3152 mls_copy_effective(source, &mm_temp);
3153
3154 error = vn_extattr_set(vp, IO_NODELOCKED, MAC_MLS_EXTATTR_NAMESPACE,
3155 MAC_MLS_EXTATTR_NAME, buflen, (char *) &mm_temp, curthread);
3156 if (error == 0)
3157 mls_copy_effective(source, dest);
3158 return (error);
3159}
3160
3161static void
3162mls_vnode_relabel(struct ucred *cred, struct vnode *vp,

Callers

nothing calls this directly

Calls 3

bzeroFunction · 0.85
mls_copy_effectiveFunction · 0.85
vn_extattr_setFunction · 0.85

Tested by

no test coverage detected