Lines Matching refs:skp
295 struct smack_known *skp = NULL;
306 skp = ERR_PTR(rc);
308 skp = NULL;
310 skp = smk_import_entry(buffer, rc);
314 return skp;
320 * @skp: a pointer to the Smack label entry to use in the blob
323 static void init_inode_smack(struct inode *inode, struct smack_known *skp)
327 isp->smk_inode = skp;
492 struct smack_known *skp;
494 skp = smk_of_task_struct_obj(ctp);
496 return smk_ptrace_rule_check(current, skp, mode, __func__);
509 struct smack_known *skp;
511 skp = smk_of_task(smack_cred(current_cred()));
513 return smk_ptrace_rule_check(ptp, skp, PTRACE_MODE_ATTACH, __func__);
525 struct smack_known *skp = smk_of_current();
530 if (smack_syslog_label != NULL && smack_syslog_label != skp)
577 struct smack_known *skp;
588 skp = smk_import_entry(s, 0);
589 if (IS_ERR(skp))
590 return PTR_ERR(skp);
596 opts->fsdefault = skp->smk_known;
601 opts->fsfloor = skp->smk_known;
606 opts->fshat = skp->smk_known;
611 opts->fsroot = skp->smk_known;
616 opts->fstransmute = skp->smk_known;
804 struct smack_known *skp;
820 skp = smk_of_current();
821 sp->smk_root = skp;
822 sp->smk_default = skp;
840 skp = smk_import_entry(opts->fsdefault, 0);
841 if (IS_ERR(skp))
842 return PTR_ERR(skp);
843 sp->smk_default = skp;
846 skp = smk_import_entry(opts->fsfloor, 0);
847 if (IS_ERR(skp))
848 return PTR_ERR(skp);
849 sp->smk_floor = skp;
852 skp = smk_import_entry(opts->fshat, 0);
853 if (IS_ERR(skp))
854 return PTR_ERR(skp);
855 sp->smk_hat = skp;
858 skp = smk_import_entry(opts->fsroot, 0);
859 if (IS_ERR(skp))
860 return PTR_ERR(skp);
861 sp->smk_root = skp;
864 skp = smk_import_entry(opts->fstransmute, 0);
865 if (IS_ERR(skp))
866 return PTR_ERR(skp);
867 sp->smk_root = skp;
974 struct smack_known *skp = smk_of_current();
976 init_inode_smack(inode, skp);
995 struct smack_known *skp = smk_of_task(tsp);
1008 may = smk_access_entry(skp->smk_known, dsp->smk_known,
1009 &skp->smk_rules);
1294 struct smack_known *skp;
1326 skp = size ? smk_import_entry(value, size) : NULL;
1327 if (IS_ERR(skp))
1328 rc = PTR_ERR(skp);
1329 else if (skp == NULL || (check_star &&
1330 (skp == &smack_known_star || skp == &smack_known_web)))
1359 struct smack_known *skp;
1368 skp = smk_import_entry(value, size);
1369 if (!IS_ERR(skp))
1370 isp->smk_inode = skp;
1372 skp = smk_import_entry(value, size);
1373 if (!IS_ERR(skp))
1374 isp->smk_task = skp;
1376 skp = smk_import_entry(value, size);
1377 if (!IS_ERR(skp))
1378 isp->smk_mmap = skp;
1624 struct smack_known *skp = smk_of_inode(inode);
1626 *secid = skp->smk_secid;
1784 struct smack_known *skp;
1812 skp = smk_of_current();
1821 list_for_each_entry_rcu(srp, &skp->smk_rules, list) {
1909 struct smack_known *skp;
1923 skp = *blob;
1924 rc = smk_access(skp, tkp, MAY_DELIVER, NULL);
1925 rc = smk_bu_note("sigiotask", skp, tkp, MAY_DELIVER, rc);
1935 smack_log(skp->smk_known, tkp->smk_known, MAY_DELIVER, rc, &ad);
2114 struct smack_known *skp;
2117 skp = smk_of_task(smack_cred(cred));
2118 *secid = skp->smk_secid;
2168 struct smack_known *skp = smk_of_task_struct_obj(p);
2173 rc = smk_curacc(skp, access, &ad);
2220 struct smack_known *skp = smk_of_current();
2222 *secid = skp->smk_secid;
2234 struct smack_known *skp = smk_of_task_struct_obj(p);
2236 *secid = skp->smk_secid;
2321 struct smack_known *skp;
2344 skp = smk_of_task(smack_cred(cred));
2345 rc = smk_access(skp, tkp, MAY_DELIVER, &ad);
2346 rc = smk_bu_note("USB signal", skp, tkp, MAY_DELIVER, rc);
2360 struct smack_known *skp = smk_of_task_struct_obj(p);
2362 isp->smk_inode = skp;
2382 struct smack_known *skp = smk_of_current();
2396 ssp->smk_in = skp;
2397 ssp->smk_out = skp;
2558 struct smack_known *skp = ssp->smk_out;
2564 rc = netlbl_sock_setattr(sk, sk->sk_family, &skp->smk_netlabel);
2618 struct smack_known *skp;
2635 skp = ssp->smk_out;
2636 rc = smk_access(skp, hkp, MAY_WRITE, &ad);
2637 rc = smk_bu_note("IPv4 host check", skp, hkp, MAY_WRITE, rc);
2783 struct smack_known *skp = NULL;
2788 skp = smack_ipv6host_label(address);
2791 skp = ssp->smk_out;
2798 if (skp != NULL && object != NULL)
2799 return smk_ipv6_check(skp, object, address, act);
2800 if (skp == NULL)
2801 skp = smack_net_ambient;
2809 return smk_ipv6_check(skp, object, address, act);
2829 return smk_ipv6_check(skp, object, address, act);
2848 struct smack_known *skp;
2866 skp = smk_import_entry(value, size);
2867 if (IS_ERR(skp))
2868 return PTR_ERR(skp);
2871 nsp->smk_inode = skp;
2888 ssp->smk_in = skp;
2890 ssp->smk_out = skp;
3439 struct smack_known *skp;
3583 skp = smk_fetch(XATTR_NAME_SMACK, inode, dp);
3584 if (!IS_ERR_OR_NULL(skp))
3585 final = skp;
3612 skp = smk_fetch(XATTR_NAME_SMACKEXEC, inode, dp);
3613 if (IS_ERR(skp) || skp == &smack_known_star ||
3614 skp == &smack_known_web)
3615 skp = NULL;
3616 isp->smk_task = skp;
3618 skp = smk_fetch(XATTR_NAME_SMACKMMAP, inode, dp);
3619 if (IS_ERR(skp) || skp == &smack_known_star ||
3620 skp == &smack_known_web)
3621 skp = NULL;
3622 isp->smk_mmap = skp;
3650 struct smack_known *skp = smk_of_task_struct_obj(p);
3657 cp = kstrdup(skp->smk_known, GFP_KERNEL);
3681 struct smack_known *skp;
3694 skp = smk_import_entry(value, size);
3695 if (IS_ERR(skp))
3696 return PTR_ERR(skp);
3702 if (skp == &smack_known_web || skp == &smack_known_star)
3708 if (sklep->smk_label == skp) {
3721 tsp->smk_task = skp;
3743 struct smack_known *skp;
3755 skp = ssp->smk_out;
3761 rc = smk_access(skp, okp, MAY_WRITE, &ad);
3762 rc = smk_bu_note("UDS connect", skp, okp, MAY_WRITE, rc);
3765 skp = ssp->smk_in;
3766 rc = smk_access(okp, skp, MAY_WRITE, &ad);
3767 rc = smk_bu_note("UDS connect", okp, skp,
3879 struct smack_known *skp;
3908 list_for_each_entry_rcu(skp, &smack_known_list, list) {
3909 if (sap->attr.mls.lvl != skp->smk_netlabel.attr.mls.lvl)
3915 if ((skp->smk_netlabel.flags &
3924 skp->smk_netlabel.attr.mls.cat,
3937 return skp;
4038 struct smack_known *skp = NULL;
4046 skp = smack_from_secattr(&secattr, ssp);
4048 netlbl_cache_add(skb, family, &skp->smk_netlabel);
4053 return skp;
4066 struct smack_known *skp = NULL;
4088 skp = smack_from_skb(skb);
4089 if (skp == NULL) {
4090 skp = smack_from_netlbl(sk, family, skb);
4091 if (skp == NULL)
4092 skp = smack_net_ambient;
4107 rc = smk_access(skp, ssp->smk_in, MAY_WRITE, &ad);
4108 rc = smk_bu_note("IPv4 delivery", skp, ssp->smk_in,
4120 skp = smack_from_skb(skb);
4121 if (skp == NULL) {
4124 skp = smack_ipv6host_label(&sadd);
4125 if (skp == NULL)
4126 skp = smack_net_ambient;
4134 rc = smk_access(skp, ssp->smk_in, MAY_WRITE, &ad);
4135 rc = smk_bu_note("IPv6 delivery", skp, ssp->smk_in,
4201 struct smack_known *skp;
4223 skp = smack_from_skb(skb);
4224 if (skp) {
4225 s = skp->smk_secid;
4233 skp = smack_from_netlbl(sk, family, skb);
4234 if (skp != NULL)
4235 s = skp->smk_secid;
4239 skp = smack_from_skb(skb);
4240 if (skp)
4241 s = skp->smk_secid;
4262 struct smack_known *skp = smk_of_current();
4269 ssp->smk_in = skp;
4270 ssp->smk_out = skp;
4287 struct smack_known *skp;
4317 skp = smack_from_skb(skb);
4318 if (skp == NULL) {
4319 skp = smack_from_netlbl(sk, family, skb);
4320 if (skp == NULL)
4321 skp = &smack_known_huh;
4334 rc = smk_access(skp, ssp->smk_in, MAY_WRITE, &ad);
4335 rc = smk_bu_note("IPv4 connect", skp, ssp->smk_in, MAY_WRITE, rc);
4343 req->peer_secid = skp->smk_secid;
4357 rc = netlbl_req_setattr(req, &skp->smk_netlabel);
4375 struct smack_known *skp;
4378 skp = smack_from_secid(req->peer_secid);
4379 ssp->smk_packet = skp;
4406 struct smack_known *skp = smk_of_task(smack_cred(cred));
4408 key->security = skp;
4505 struct smack_known *skp = key->security;
4514 copy = kstrdup(skp->smk_known, GFP_KERNEL);
4625 struct smack_known *skp;
4635 skp = smk_import_entry(rulestr, 0);
4636 if (IS_ERR(skp))
4637 return PTR_ERR(skp);
4639 *rule = skp->smk_known;
4679 struct smack_known *skp;
4690 skp = smack_from_secid(secid);
4698 return (rule == skp->smk_known);
4700 return (rule != skp->smk_known);
4732 struct smack_known *skp = smack_from_secid(secid);
4735 *secdata = skp->smk_known;
4736 *seclen = strlen(skp->smk_known);
4750 struct smack_known *skp = smk_find_entry(secdata);
4752 if (skp)
4753 *secid = skp->smk_secid;
4779 struct smack_known *skp = smk_of_inode(inode);
4781 *ctx = skp->smk_known;
4782 *ctxlen = strlen(skp->smk_known);
4790 struct smack_known *skp;
4806 skp = isp->smk_inode;
4807 tsp->smk_task = skp;