Lines Matching refs: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);
349 ssize_t length;
351 length = scnprintf(tmpbuf, TMPBUFLEN, "%d",
353 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
587 ssize_t length;
592 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
594 if (length)
598 length = -EINVAL;
602 length = -ENOMEM;
607 length = -EFAULT;
611 length = security_load_policy(data, count, &load_state);
612 if (length) {
617 length = sel_make_policy_nodes(fsi, load_state.policy);
618 if (length) {
626 length = count;
635 return length;
647 ssize_t length;
649 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
651 if (length)
654 length = security_context_to_sid(buf, size, &sid, GFP_KERNEL);
655 if (length)
658 length = security_sid_to_context(sid, &canon, &len);
659 if (length)
662 length = -ERANGE;
670 length = len;
673 return length;
680 ssize_t length;
682 length = scnprintf(tmpbuf, TMPBUFLEN, "%u",
684 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
691 ssize_t length;
694 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
697 if (length)
698 return length;
712 length = -EINVAL;
715 length = count;
729 return length;
862 * and the length returned. Otherwise return 0 or and -error.
871 ssize_t length;
873 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
875 if (length)
878 length = -ENOMEM;
883 length = -ENOMEM;
888 length = -EINVAL;
892 length = security_context_str_to_sid(scon, &ssid, GFP_KERNEL);
893 if (length)
896 length = security_context_str_to_sid(tcon, &tsid, GFP_KERNEL);
897 if (length)
902 length = scnprintf(buf, SIMPLE_TRANSACTION_LIMIT,
910 return length;
919 ssize_t length;
924 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
927 if (length)
930 length = -ENOMEM;
935 length = -ENOMEM;
940 length = -ENOMEM;
945 length = -EINVAL;
980 length = security_context_str_to_sid(scon, &ssid, GFP_KERNEL);
981 if (length)
984 length = security_context_str_to_sid(tcon, &tsid, GFP_KERNEL);
985 if (length)
988 length = security_transition_sid_user(ssid, tsid, tclass,
990 if (length)
993 length = security_sid_to_context(newsid, &newcon, &len);
994 if (length)
997 length = -ERANGE;
1005 length = len;
1011 return length;
1019 ssize_t length;
1023 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
1026 if (length)
1029 length = -ENOMEM;
1034 length = -ENOMEM;
1039 length = -EINVAL;
1043 length = security_context_str_to_sid(scon, &ssid, GFP_KERNEL);
1044 if (length)
1047 length = security_context_str_to_sid(tcon, &tsid, GFP_KERNEL);
1048 if (length)
1051 length = security_change_sid(ssid, tsid, tclass, &newsid);
1052 if (length)
1055 length = security_sid_to_context(newsid, &newcon, &len);
1056 if (length)
1059 length = -ERANGE;
1064 length = len;
1069 return length;
1076 ssize_t length;
1081 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
1084 if (length)
1087 length = -ENOMEM;
1092 length = -ENOMEM;
1097 length = -EINVAL;
1101 length = security_context_str_to_sid(con, &sid, GFP_KERNEL);
1102 if (length)
1105 length = security_get_user_sids(sid, user, &sids, &nsids);
1106 if (length)
1109 length = sprintf(buf, "%u", nsids) + 1;
1110 ptr = buf + length;
1114 length = rc;
1117 if ((length + len) >= SIMPLE_TRANSACTION_LIMIT) {
1119 length = -ERANGE;
1125 length += len;
1131 return length;
1139 ssize_t length;
1143 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
1146 if (length)
1149 length = -ENOMEM;
1154 length = -ENOMEM;
1159 length = -EINVAL;
1163 length = security_context_str_to_sid(scon, &ssid, GFP_KERNEL);
1164 if (length)
1167 length = security_context_str_to_sid(tcon, &tsid, GFP_KERNEL);
1168 if (length)
1171 length = security_member_sid(ssid, tsid, tclass, &newsid);
1172 if (length)
1175 length = security_sid_to_context(newsid, &newcon, &len);
1176 if (length)
1179 length = -ERANGE;
1187 length = len;
1192 return length;
1211 ssize_t length;
1234 length = scnprintf(page, PAGE_SIZE, "%d %d", cur_enforcing,
1237 ret = simple_read_from_buffer(buf, count, ppos, page, length);
1252 ssize_t length;
1270 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
1273 if (length)
1276 length = -EINVAL;
1281 length = -EINVAL;
1289 length = count;
1294 return length;
1309 ssize_t length;
1325 length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
1328 if (length)
1331 length = -EINVAL;
1335 length = 0;
1337 length = security_set_bools(fsi->bool_num,
1340 if (!length)
1341 length = count;
1346 return length;
1443 ssize_t length;
1445 length = scnprintf(tmpbuf, TMPBUFLEN, "%u",
1447 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
1492 ssize_t length;
1498 length = avc_get_hash_stats(page);
1499 if (length >= 0)
1500 length = simple_read_from_buffer(buf, count, ppos, page, length);
1503 return length;
1510 ssize_t length;
1516 length = security_sidtab_hash_stats(page);
1517 if (length >= 0)
1518 length = simple_read_from_buffer(buf, count, ppos, page,
1519 length);
1522 return length;
1783 ssize_t length;
1787 length = scnprintf(tmpbuf, TMPBUFLEN, "%d", value);
1789 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);