Lines Matching defs:length

127 	ssize_t length;
129 length = scnprintf(tmpbuf, TMPBUFLEN, "%d",
131 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
140 ssize_t length;
155 length = -EINVAL;
163 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
166 if (length)
184 length = count;
187 return length;
203 ssize_t length;
209 length = scnprintf(tmpbuf, TMPBUFLEN, "%d", handle_unknown);
210 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
276 ssize_t length;
291 length = -EINVAL;
294 length = count;
303 return length;
315 ssize_t length;
317 length = scnprintf(tmpbuf, TMPBUFLEN, "%u", POLICYDB_VERSION_MAX);
318 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
346 ssize_t length;
348 length = scnprintf(tmpbuf, TMPBUFLEN, "%d",
350 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
576 ssize_t length;
588 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
590 if (length)
595 length = -ENOMEM;
599 length = -EFAULT;
603 length = security_load_policy(data, count, &load_state);
604 if (length) {
609 length = sel_make_policy_nodes(fsi, load_state.policy);
610 if (length) {
617 length = count;
626 return length;
638 ssize_t length;
640 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
642 if (length)
645 length = security_context_to_sid(buf, size, &sid, GFP_KERNEL);
646 if (length)
649 length = security_sid_to_context(sid, &canon, &len);
650 if (length)
653 length = -ERANGE;
661 length = len;
664 return length;
671 ssize_t length;
673 length = scnprintf(tmpbuf, TMPBUFLEN, "%u",
675 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
682 ssize_t length;
685 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
688 if (length)
689 return length;
703 length = -EINVAL;
706 length = count;
720 return length;
853 * and the length returned. Otherwise return 0 or and -error.
862 ssize_t length;
864 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
866 if (length)
869 length = -ENOMEM;
874 length = -ENOMEM;
879 length = -EINVAL;
883 length = security_context_str_to_sid(scon, &ssid, GFP_KERNEL);
884 if (length)
887 length = security_context_str_to_sid(tcon, &tsid, GFP_KERNEL);
888 if (length)
893 length = scnprintf(buf, SIMPLE_TRANSACTION_LIMIT,
901 return length;
910 ssize_t length;
915 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
918 if (length)
921 length = -ENOMEM;
926 length = -ENOMEM;
931 length = -ENOMEM;
936 length = -EINVAL;
971 length = security_context_str_to_sid(scon, &ssid, GFP_KERNEL);
972 if (length)
975 length = security_context_str_to_sid(tcon, &tsid, GFP_KERNEL);
976 if (length)
979 length = security_transition_sid_user(ssid, tsid, tclass,
981 if (length)
984 length = security_sid_to_context(newsid, &newcon, &len);
985 if (length)
988 length = -ERANGE;
996 length = len;
1002 return length;
1010 ssize_t length;
1014 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
1017 if (length)
1020 length = -ENOMEM;
1025 length = -ENOMEM;
1030 length = -EINVAL;
1034 length = security_context_str_to_sid(scon, &ssid, GFP_KERNEL);
1035 if (length)
1038 length = security_context_str_to_sid(tcon, &tsid, GFP_KERNEL);
1039 if (length)
1042 length = security_change_sid(ssid, tsid, tclass, &newsid);
1043 if (length)
1046 length = security_sid_to_context(newsid, &newcon, &len);
1047 if (length)
1050 length = -ERANGE;
1055 length = len;
1060 return length;
1067 ssize_t length;
1076 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
1079 if (length)
1082 length = -ENOMEM;
1087 length = -ENOMEM;
1092 length = -EINVAL;
1096 length = security_context_str_to_sid(con, &sid, GFP_KERNEL);
1097 if (length)
1100 length = security_get_user_sids(sid, user, &sids, &nsids);
1101 if (length)
1104 length = sprintf(buf, "%u", nsids) + 1;
1105 ptr = buf + length;
1109 length = rc;
1112 if ((length + len) >= SIMPLE_TRANSACTION_LIMIT) {
1114 length = -ERANGE;
1120 length += len;
1126 return length;
1134 ssize_t length;
1138 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
1141 if (length)
1144 length = -ENOMEM;
1149 length = -ENOMEM;
1154 length = -EINVAL;
1158 length = security_context_str_to_sid(scon, &ssid, GFP_KERNEL);
1159 if (length)
1162 length = security_context_str_to_sid(tcon, &tsid, GFP_KERNEL);
1163 if (length)
1166 length = security_member_sid(ssid, tsid, tclass, &newsid);
1167 if (length)
1170 length = security_sid_to_context(newsid, &newcon, &len);
1171 if (length)
1174 length = -ERANGE;
1182 length = len;
1187 return length;
1206 ssize_t length;
1229 length = scnprintf(page, PAGE_SIZE, "%d %d", cur_enforcing,
1232 ret = simple_read_from_buffer(buf, count, ppos, page, length);
1247 ssize_t length;
1265 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
1268 if (length)
1271 length = -EINVAL;
1276 length = -EINVAL;
1284 length = count;
1289 return length;
1304 ssize_t length;
1320 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
1323 if (length)
1326 length = -EINVAL;
1330 length = 0;
1332 length = security_set_bools(fsi->bool_num,
1335 if (!length)
1336 length = count;
1341 return length;
1417 ssize_t length;
1419 length = scnprintf(tmpbuf, TMPBUFLEN, "%u",
1421 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
1466 ssize_t length;
1472 length = avc_get_hash_stats(page);
1473 if (length >= 0)
1474 length = simple_read_from_buffer(buf, count, ppos, page, length);
1477 return length;
1484 ssize_t length;
1490 length = security_sidtab_hash_stats(page);
1491 if (length >= 0)
1492 length = simple_read_from_buffer(buf, count, ppos, page,
1493 length);
1496 return length;
1757 ssize_t length;
1761 length = scnprintf(tmpbuf, TMPBUFLEN, "%d", value);
1763 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);