diff options
Diffstat (limited to 'security/selinux/ss/avtab.c')
-rw-r--r-- | security/selinux/ss/avtab.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/security/selinux/ss/avtab.c b/security/selinux/ss/avtab.c index a6175306d5b6..9e6626362bfd 100644 --- a/security/selinux/ss/avtab.c +++ b/security/selinux/ss/avtab.c | |||
@@ -310,8 +310,8 @@ void avtab_hash_eval(struct avtab *h, char *tag) | |||
310 | } | 310 | } |
311 | } | 311 | } |
312 | 312 | ||
313 | printk(KERN_DEBUG "%s: %d entries and %d/%d buckets used, longest " | 313 | printk(KERN_DEBUG "SELinux: %s: %d entries and %d/%d buckets used, " |
314 | "chain length %d sum of chain length^2 %Lu\n", | 314 | "longest chain length %d sum of chain length^2 %Lu\n", |
315 | tag, h->nel, slots_used, h->nslot, max_chain_len, | 315 | tag, h->nel, slots_used, h->nslot, max_chain_len, |
316 | chain2_len_sum); | 316 | chain2_len_sum); |
317 | } | 317 | } |
@@ -364,19 +364,19 @@ int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol, | |||
364 | val = le32_to_cpu(buf32[items++]); | 364 | val = le32_to_cpu(buf32[items++]); |
365 | key.source_type = (u16)val; | 365 | key.source_type = (u16)val; |
366 | if (key.source_type != val) { | 366 | if (key.source_type != val) { |
367 | printk("SELinux: avtab: truncated source type\n"); | 367 | printk(KERN_ERR "SELinux: avtab: truncated source type\n"); |
368 | return -1; | 368 | return -1; |
369 | } | 369 | } |
370 | val = le32_to_cpu(buf32[items++]); | 370 | val = le32_to_cpu(buf32[items++]); |
371 | key.target_type = (u16)val; | 371 | key.target_type = (u16)val; |
372 | if (key.target_type != val) { | 372 | if (key.target_type != val) { |
373 | printk("SELinux: avtab: truncated target type\n"); | 373 | printk(KERN_ERR "SELinux: avtab: truncated target type\n"); |
374 | return -1; | 374 | return -1; |
375 | } | 375 | } |
376 | val = le32_to_cpu(buf32[items++]); | 376 | val = le32_to_cpu(buf32[items++]); |
377 | key.target_class = (u16)val; | 377 | key.target_class = (u16)val; |
378 | if (key.target_class != val) { | 378 | if (key.target_class != val) { |
379 | printk("SELinux: avtab: truncated target class\n"); | 379 | printk(KERN_ERR "SELinux: avtab: truncated target class\n"); |
380 | return -1; | 380 | return -1; |
381 | } | 381 | } |
382 | 382 | ||
@@ -384,12 +384,12 @@ int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol, | |||
384 | enabled = (val & AVTAB_ENABLED_OLD) ? AVTAB_ENABLED : 0; | 384 | enabled = (val & AVTAB_ENABLED_OLD) ? AVTAB_ENABLED : 0; |
385 | 385 | ||
386 | if (!(val & (AVTAB_AV | AVTAB_TYPE))) { | 386 | if (!(val & (AVTAB_AV | AVTAB_TYPE))) { |
387 | printk("SELinux: avtab: null entry\n"); | 387 | printk(KERN_ERR "SELinux: avtab: null entry\n"); |
388 | return -1; | 388 | return -1; |
389 | } | 389 | } |
390 | if ((val & AVTAB_AV) && | 390 | if ((val & AVTAB_AV) && |
391 | (val & AVTAB_TYPE)) { | 391 | (val & AVTAB_TYPE)) { |
392 | printk("SELinux: avtab: entry has both access vectors and types\n"); | 392 | printk(KERN_ERR "SELinux: avtab: entry has both access vectors and types\n"); |
393 | return -1; | 393 | return -1; |
394 | } | 394 | } |
395 | 395 | ||
@@ -404,7 +404,7 @@ int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol, | |||
404 | } | 404 | } |
405 | 405 | ||
406 | if (items != items2) { | 406 | if (items != items2) { |
407 | printk("SELinux: avtab: entry only had %d items, expected %d\n", items2, items); | 407 | printk(KERN_ERR "SELinux: avtab: entry only had %d items, expected %d\n", items2, items); |
408 | return -1; | 408 | return -1; |
409 | } | 409 | } |
410 | return 0; | 410 | return 0; |
@@ -412,7 +412,7 @@ int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol, | |||
412 | 412 | ||
413 | rc = next_entry(buf16, fp, sizeof(u16)*4); | 413 | rc = next_entry(buf16, fp, sizeof(u16)*4); |
414 | if (rc < 0) { | 414 | if (rc < 0) { |
415 | printk("SELinux: avtab: truncated entry\n"); | 415 | printk(KERN_ERR "SELinux: avtab: truncated entry\n"); |
416 | return -1; | 416 | return -1; |
417 | } | 417 | } |
418 | 418 | ||
@@ -425,7 +425,7 @@ int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol, | |||
425 | if (!policydb_type_isvalid(pol, key.source_type) || | 425 | if (!policydb_type_isvalid(pol, key.source_type) || |
426 | !policydb_type_isvalid(pol, key.target_type) || | 426 | !policydb_type_isvalid(pol, key.target_type) || |
427 | !policydb_class_isvalid(pol, key.target_class)) { | 427 | !policydb_class_isvalid(pol, key.target_class)) { |
428 | printk(KERN_WARNING "SELinux: avtab: invalid type or class\n"); | 428 | printk(KERN_ERR "SELinux: avtab: invalid type or class\n"); |
429 | return -1; | 429 | return -1; |
430 | } | 430 | } |
431 | 431 | ||
@@ -435,20 +435,19 @@ int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol, | |||
435 | set++; | 435 | set++; |
436 | } | 436 | } |
437 | if (!set || set > 1) { | 437 | if (!set || set > 1) { |
438 | printk(KERN_WARNING | 438 | printk(KERN_ERR "SELinux: avtab: more than one specifier\n"); |
439 | "SELinux: avtab: more than one specifier\n"); | ||
440 | return -1; | 439 | return -1; |
441 | } | 440 | } |
442 | 441 | ||
443 | rc = next_entry(buf32, fp, sizeof(u32)); | 442 | rc = next_entry(buf32, fp, sizeof(u32)); |
444 | if (rc < 0) { | 443 | if (rc < 0) { |
445 | printk("SELinux: avtab: truncated entry\n"); | 444 | printk(KERN_ERR "SELinux: avtab: truncated entry\n"); |
446 | return -1; | 445 | return -1; |
447 | } | 446 | } |
448 | datum.data = le32_to_cpu(*buf32); | 447 | datum.data = le32_to_cpu(*buf32); |
449 | if ((key.specified & AVTAB_TYPE) && | 448 | if ((key.specified & AVTAB_TYPE) && |
450 | !policydb_type_isvalid(pol, datum.data)) { | 449 | !policydb_type_isvalid(pol, datum.data)) { |
451 | printk(KERN_WARNING "SELinux: avtab: invalid type\n"); | 450 | printk(KERN_ERR "SELinux: avtab: invalid type\n"); |
452 | return -1; | 451 | return -1; |
453 | } | 452 | } |
454 | return insertf(a, &key, &datum, p); | 453 | return insertf(a, &key, &datum, p); |