Lines Matching refs:length
129 ssize_t length;
131 length = scnprintf(tmpbuf, TMPBUFLEN, "%d",
133 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
144 ssize_t length;
158 length = -EINVAL;
166 length = avc_has_perm(&selinux_state,
170 if (length)
186 length = count;
189 return length;
207 ssize_t length;
213 length = scnprintf(tmpbuf, TMPBUFLEN, "%d", handle_unknown);
214 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
283 ssize_t length;
305 length = -EINVAL;
311 length = selinux_disable(fsi->state);
312 if (length)
322 length = count;
325 return length;
340 ssize_t length;
342 length = scnprintf(tmpbuf, TMPBUFLEN, "%u", POLICYDB_VERSION_MAX);
343 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
375 ssize_t length;
377 length = scnprintf(tmpbuf, TMPBUFLEN, "%d",
379 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
620 ssize_t length;
625 length = avc_has_perm(&selinux_state,
628 if (length)
632 length = -EINVAL;
636 length = -ENOMEM;
641 length = -EFAULT;
645 length = security_load_policy(fsi->state, data, count, &load_state);
646 if (length) {
651 length = sel_make_policy_nodes(fsi, load_state.policy);
652 if (length) {
659 length = count;
668 return length;
682 ssize_t length;
684 length = avc_has_perm(&selinux_state,
687 if (length)
690 length = security_context_to_sid(state, buf, size, &sid, GFP_KERNEL);
691 if (length)
694 length = security_sid_to_context(state, sid, &canon, &len);
695 if (length)
698 length = -ERANGE;
706 length = len;
709 return length;
717 ssize_t length;
719 length = scnprintf(tmpbuf, TMPBUFLEN, "%u",
721 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
729 ssize_t length;
732 length = avc_has_perm(&selinux_state,
736 if (length)
737 return length;
750 length = -EINVAL;
763 length = count;
766 return length;
902 * and the length returned. Otherwise return 0 or and -error.
913 ssize_t length;
915 length = avc_has_perm(&selinux_state,
918 if (length)
921 length = -ENOMEM;
926 length = -ENOMEM;
931 length = -EINVAL;
935 length = security_context_str_to_sid(state, scon, &ssid, GFP_KERNEL);
936 if (length)
939 length = security_context_str_to_sid(state, tcon, &tsid, GFP_KERNEL);
940 if (length)
945 length = scnprintf(buf, SIMPLE_TRANSACTION_LIMIT,
953 return length;
964 ssize_t length;
969 length = avc_has_perm(&selinux_state,
973 if (length)
976 length = -ENOMEM;
981 length = -ENOMEM;
986 length = -ENOMEM;
991 length = -EINVAL;
1026 length = security_context_str_to_sid(state, scon, &ssid, GFP_KERNEL);
1027 if (length)
1030 length = security_context_str_to_sid(state, tcon, &tsid, GFP_KERNEL);
1031 if (length)
1034 length = security_transition_sid_user(state, ssid, tsid, tclass,
1036 if (length)
1039 length = security_sid_to_context(state, newsid, &newcon, &len);
1040 if (length)
1043 length = -ERANGE;
1051 length = len;
1057 return length;
1067 ssize_t length;
1071 length = avc_has_perm(&selinux_state,
1075 if (length)
1078 length = -ENOMEM;
1083 length = -ENOMEM;
1088 length = -EINVAL;
1092 length = security_context_str_to_sid(state, scon, &ssid, GFP_KERNEL);
1093 if (length)
1096 length = security_context_str_to_sid(state, tcon, &tsid, GFP_KERNEL);
1097 if (length)
1100 length = security_change_sid(state, ssid, tsid, tclass, &newsid);
1101 if (length)
1104 length = security_sid_to_context(state, newsid, &newcon, &len);
1105 if (length)
1108 length = -ERANGE;
1113 length = len;
1118 return length;
1127 ssize_t length;
1132 length = avc_has_perm(&selinux_state,
1136 if (length)
1139 length = -ENOMEM;
1144 length = -ENOMEM;
1149 length = -EINVAL;
1153 length = security_context_str_to_sid(state, con, &sid, GFP_KERNEL);
1154 if (length)
1157 length = security_get_user_sids(state, sid, user, &sids, &nsids);
1158 if (length)
1161 length = sprintf(buf, "%u", nsids) + 1;
1162 ptr = buf + length;
1166 length = rc;
1169 if ((length + len) >= SIMPLE_TRANSACTION_LIMIT) {
1171 length = -ERANGE;
1177 length += len;
1183 return length;
1193 ssize_t length;
1197 length = avc_has_perm(&selinux_state,
1201 if (length)
1204 length = -ENOMEM;
1209 length = -ENOMEM;
1214 length = -EINVAL;
1218 length = security_context_str_to_sid(state, scon, &ssid, GFP_KERNEL);
1219 if (length)
1222 length = security_context_str_to_sid(state, tcon, &tsid, GFP_KERNEL);
1223 if (length)
1226 length = security_member_sid(state, ssid, tsid, tclass, &newsid);
1227 if (length)
1230 length = security_sid_to_context(state, newsid, &newcon, &len);
1231 if (length)
1234 length = -ERANGE;
1242 length = len;
1247 return length;
1266 ssize_t length;
1289 length = scnprintf(page, PAGE_SIZE, "%d %d", cur_enforcing,
1292 ret = simple_read_from_buffer(buf, count, ppos, page, length);
1307 ssize_t length;
1325 length = avc_has_perm(&selinux_state,
1329 if (length)
1332 length = -EINVAL;
1337 length = -EINVAL;
1345 length = count;
1350 return length;
1365 ssize_t length;
1381 length = avc_has_perm(&selinux_state,
1385 if (length)
1388 length = -EINVAL;
1392 length = 0;
1394 length = security_set_bools(fsi->state, fsi->bool_num,
1397 if (!length)
1398 length = count;
1403 return length;
1502 ssize_t length;
1504 length = scnprintf(tmpbuf, TMPBUFLEN, "%u",
1506 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
1556 ssize_t length;
1562 length = avc_get_hash_stats(state->avc, page);
1563 if (length >= 0)
1564 length = simple_read_from_buffer(buf, count, ppos, page, length);
1567 return length;
1576 ssize_t length;
1582 length = security_sidtab_hash_stats(state, page);
1583 if (length >= 0)
1584 length = simple_read_from_buffer(buf, count, ppos, page,
1585 length);
1588 return length;
1851 ssize_t length;
1855 length = scnprintf(tmpbuf, TMPBUFLEN, "%d", value);
1857 return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);