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

Function biba_vnode_setlabel_extattr

freebsd/security/mac_biba/mac_biba.c:3541–3561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3539}
3540
3541static int
3542biba_vnode_setlabel_extattr(struct ucred *cred, struct vnode *vp,
3543 struct label *vplabel, struct label *intlabel)
3544{
3545 struct mac_biba *source, mb_temp;
3546 size_t buflen;
3547 int error;
3548
3549 buflen = sizeof(mb_temp);
3550 bzero(&mb_temp, buflen);
3551
3552 source = SLOT(intlabel);
3553 if ((source->mb_flags & MAC_BIBA_FLAG_EFFECTIVE) == 0)
3554 return (0);
3555
3556 biba_copy_effective(source, &mb_temp);
3557
3558 error = vn_extattr_set(vp, IO_NODELOCKED, MAC_BIBA_EXTATTR_NAMESPACE,
3559 MAC_BIBA_EXTATTR_NAME, buflen, (char *) &mb_temp, curthread);
3560 return (error);
3561}
3562
3563static struct mac_policy_ops mac_biba_ops =
3564{

Callers

nothing calls this directly

Calls 3

bzeroFunction · 0.85
biba_copy_effectiveFunction · 0.85
vn_extattr_setFunction · 0.85

Tested by

no test coverage detected