Lines Matching refs:skp
283 struct smack_known *skp = NULL;
294 skp = ERR_PTR(rc);
296 skp = NULL;
298 skp = smk_import_entry(buffer, rc);
302 return skp;
308 * @skp: a pointer to the Smack label entry to use in the blob
311 static void init_inode_smack(struct inode *inode, struct smack_known *skp)
315 isp->smk_inode = skp;
480 struct smack_known *skp;
482 skp = smk_of_task_struct(ctp);
484 return smk_ptrace_rule_check(current, skp, mode, __func__);
498 struct smack_known *skp;
500 skp = smk_of_task(smack_cred(current_cred()));
502 rc = smk_ptrace_rule_check(ptp, skp, PTRACE_MODE_ATTACH, __func__);
515 struct smack_known *skp = smk_of_current();
520 if (smack_syslog_label != NULL && smack_syslog_label != skp)
777 struct smack_known *skp;
800 skp = smk_of_current();
801 sp->smk_root = skp;
802 sp->smk_default = skp;
820 skp = smk_import_entry(opts->fsdefault, 0);
821 if (IS_ERR(skp))
822 return PTR_ERR(skp);
823 sp->smk_default = skp;
826 skp = smk_import_entry(opts->fsfloor, 0);
827 if (IS_ERR(skp))
828 return PTR_ERR(skp);
829 sp->smk_floor = skp;
832 skp = smk_import_entry(opts->fshat, 0);
833 if (IS_ERR(skp))
834 return PTR_ERR(skp);
835 sp->smk_hat = skp;
838 skp = smk_import_entry(opts->fsroot, 0);
839 if (IS_ERR(skp))
840 return PTR_ERR(skp);
841 sp->smk_root = skp;
844 skp = smk_import_entry(opts->fstransmute, 0);
845 if (IS_ERR(skp))
846 return PTR_ERR(skp);
847 sp->smk_root = skp;
954 struct smack_known *skp = smk_of_current();
956 init_inode_smack(inode, skp);
977 struct smack_known *skp = smk_of_task(tsp);
992 may = smk_access_entry(skp->smk_known, dsp->smk_known,
993 &skp->smk_rules);
1262 struct smack_known *skp;
1293 skp = size ? smk_import_entry(value, size) : NULL;
1294 if (IS_ERR(skp))
1295 rc = PTR_ERR(skp);
1296 else if (skp == NULL || (check_star &&
1297 (skp == &smack_known_star || skp == &smack_known_web)))
1326 struct smack_known *skp;
1335 skp = smk_import_entry(value, size);
1336 if (!IS_ERR(skp))
1337 isp->smk_inode = skp;
1339 skp = smk_import_entry(value, size);
1340 if (!IS_ERR(skp))
1341 isp->smk_task = skp;
1343 skp = smk_import_entry(value, size);
1344 if (!IS_ERR(skp))
1345 isp->smk_mmap = skp;
1520 struct smack_known *skp = smk_of_inode(inode);
1522 *secid = skp->smk_secid;
1679 struct smack_known *skp;
1707 skp = smk_of_current();
1716 list_for_each_entry_rcu(srp, &skp->smk_rules, list) {
1804 struct smack_known *skp;
1818 skp = *blob;
1819 rc = smk_access(skp, tkp, MAY_DELIVER, NULL);
1820 rc = smk_bu_note("sigiotask", skp, tkp, MAY_DELIVER, rc);
1830 smack_log(skp->smk_known, tkp->smk_known, MAY_DELIVER, rc, &ad);
2009 struct smack_known *skp;
2012 skp = smk_of_task(smack_cred(cred));
2013 *secid = skp->smk_secid;
2063 struct smack_known *skp = smk_of_task_struct(p);
2068 rc = smk_curacc(skp, access, &ad);
2116 struct smack_known *skp = smk_of_task_struct(p);
2118 *secid = skp->smk_secid;
2203 struct smack_known *skp;
2226 skp = smk_of_task(smack_cred(cred));
2227 rc = smk_access(skp, tkp, MAY_DELIVER, &ad);
2228 rc = smk_bu_note("USB signal", skp, tkp, MAY_DELIVER, rc);
2242 struct smack_known *skp = smk_of_task_struct(p);
2244 isp->smk_inode = skp;
2264 struct smack_known *skp = smk_of_current();
2278 ssp->smk_in = skp;
2279 ssp->smk_out = skp;
2425 struct smack_known *skp = ssp->smk_out;
2431 rc = netlbl_sock_setattr(sk, sk->sk_family, &skp->smk_netlabel);
2485 struct smack_known *skp;
2502 skp = ssp->smk_out;
2503 rc = smk_access(skp, hkp, MAY_WRITE, &ad);
2504 rc = smk_bu_note("IPv4 host check", skp, hkp, MAY_WRITE, rc);
2651 struct smack_known *skp = NULL;
2656 skp = smack_ipv6host_label(address);
2659 skp = ssp->smk_out;
2666 if (skp != NULL && object != NULL)
2667 return smk_ipv6_check(skp, object, address, act);
2668 if (skp == NULL)
2669 skp = smack_net_ambient;
2677 return smk_ipv6_check(skp, object, address, act);
2697 return smk_ipv6_check(skp, object, address, act);
2715 struct smack_known *skp;
2724 skp = smk_import_entry(value, size);
2725 if (IS_ERR(skp))
2726 return PTR_ERR(skp);
2729 nsp->smk_inode = skp;
2746 ssp->smk_in = skp;
2748 ssp->smk_out = skp;
3294 struct smack_known *skp;
3438 skp = smk_fetch(XATTR_NAME_SMACK, inode, dp);
3439 if (!IS_ERR_OR_NULL(skp))
3440 final = skp;
3475 skp = smk_fetch(XATTR_NAME_SMACKEXEC, inode, dp);
3476 if (IS_ERR(skp) || skp == &smack_known_star ||
3477 skp == &smack_known_web)
3478 skp = NULL;
3479 isp->smk_task = skp;
3481 skp = smk_fetch(XATTR_NAME_SMACKMMAP, inode, dp);
3482 if (IS_ERR(skp) || skp == &smack_known_star ||
3483 skp == &smack_known_web)
3484 skp = NULL;
3485 isp->smk_mmap = skp;
3513 struct smack_known *skp = smk_of_task_struct(p);
3520 cp = kstrdup(skp->smk_known, GFP_KERNEL);
3544 struct smack_known *skp;
3557 skp = smk_import_entry(value, size);
3558 if (IS_ERR(skp))
3559 return PTR_ERR(skp);
3565 if (skp == &smack_known_web || skp == &smack_known_star)
3571 if (sklep->smk_label == skp) {
3584 tsp->smk_task = skp;
3606 struct smack_known *skp;
3618 skp = ssp->smk_out;
3624 rc = smk_access(skp, okp, MAY_WRITE, &ad);
3625 rc = smk_bu_note("UDS connect", skp, okp, MAY_WRITE, rc);
3628 skp = ssp->smk_in;
3629 rc = smk_access(okp, skp, MAY_WRITE, &ad);
3630 rc = smk_bu_note("UDS connect", okp, skp,
3742 struct smack_known *skp;
3771 list_for_each_entry_rcu(skp, &smack_known_list, list) {
3772 if (sap->attr.mls.lvl != skp->smk_netlabel.attr.mls.lvl)
3778 if ((skp->smk_netlabel.flags &
3787 skp->smk_netlabel.attr.mls.cat,
3800 return skp;
3901 struct smack_known *skp = NULL;
3910 skp = smack_from_secattr(&secattr, ssp);
3912 rc = netlbl_cache_add(skb, family, &skp->smk_netlabel);
3917 return skp;
3930 struct smack_known *skp = NULL;
3952 skp = smack_from_skb(skb);
3953 if (skp == NULL) {
3954 skp = smack_from_netlbl(sk, family, skb);
3955 if (skp == NULL)
3956 skp = smack_net_ambient;
3971 rc = smk_access(skp, ssp->smk_in, MAY_WRITE, &ad);
3972 rc = smk_bu_note("IPv4 delivery", skp, ssp->smk_in,
3984 skp = smack_from_skb(skb);
3985 if (skp == NULL) {
3988 skp = smack_ipv6host_label(&sadd);
3989 if (skp == NULL)
3990 skp = smack_net_ambient;
3998 rc = smk_access(skp, ssp->smk_in, MAY_WRITE, &ad);
3999 rc = smk_bu_note("IPv6 delivery", skp, ssp->smk_in,
4064 struct smack_known *skp;
4086 skp = smack_from_skb(skb);
4087 if (skp) {
4088 s = skp->smk_secid;
4096 skp = smack_from_netlbl(sk, family, skb);
4097 if (skp != NULL)
4098 s = skp->smk_secid;
4102 skp = smack_from_skb(skb);
4103 if (skp)
4104 s = skp->smk_secid;
4125 struct smack_known *skp = smk_of_current();
4132 ssp->smk_in = skp;
4133 ssp->smk_out = skp;
4150 struct smack_known *skp;
4180 skp = smack_from_skb(skb);
4181 if (skp == NULL) {
4182 skp = smack_from_netlbl(sk, family, skb);
4183 if (skp == NULL)
4184 skp = &smack_known_huh;
4197 rc = smk_access(skp, ssp->smk_in, MAY_WRITE, &ad);
4198 rc = smk_bu_note("IPv4 connect", skp, ssp->smk_in, MAY_WRITE, rc);
4206 req->peer_secid = skp->smk_secid;
4220 rc = netlbl_req_setattr(req, &skp->smk_netlabel);
4238 struct smack_known *skp;
4241 skp = smack_from_secid(req->peer_secid);
4242 ssp->smk_packet = skp;
4269 struct smack_known *skp = smk_of_task(smack_cred(cred));
4271 key->security = skp;
4368 struct smack_known *skp = key->security;
4377 copy = kstrdup(skp->smk_known, GFP_KERNEL);
4488 struct smack_known *skp;
4498 skp = smk_import_entry(rulestr, 0);
4499 if (IS_ERR(skp))
4500 return PTR_ERR(skp);
4502 *rule = skp->smk_known;
4542 struct smack_known *skp;
4553 skp = smack_from_secid(secid);
4561 return (rule == skp->smk_known);
4563 return (rule != skp->smk_known);
4595 struct smack_known *skp = smack_from_secid(secid);
4598 *secdata = skp->smk_known;
4599 *seclen = strlen(skp->smk_known);
4613 struct smack_known *skp = smk_find_entry(secdata);
4615 if (skp)
4616 *secid = skp->smk_secid;
4640 struct smack_known *skp = smk_of_inode(inode);
4642 *ctx = skp->smk_known;
4643 *ctxlen = strlen(skp->smk_known);
4651 struct smack_known *skp;
4667 skp = isp->smk_inode;
4668 tsp->smk_task = skp;