aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/avtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/ss/avtab.c')
-rw-r--r--security/selinux/ss/avtab.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/security/selinux/ss/avtab.c b/security/selinux/ss/avtab.c
index cd10e27fc9e6..916e73a18bc5 100644
--- a/security/selinux/ss/avtab.c
+++ b/security/selinux/ss/avtab.c
@@ -280,8 +280,8 @@ int avtab_alloc(struct avtab *h, u32 nrules)
280 h->nel = 0; 280 h->nel = 0;
281 h->nslot = nslot; 281 h->nslot = nslot;
282 h->mask = mask; 282 h->mask = mask;
283 printk(KERN_DEBUG "SELinux:%d avtab hash slots allocated. " 283 printk(KERN_DEBUG "SELinux: %d avtab hash slots, %d rules.\n",
284 "Num of rules:%d\n", h->nslot, nrules); 284 h->nslot, nrules);
285 return 0; 285 return 0;
286} 286}
287 287
@@ -345,18 +345,18 @@ int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol,
345 if (vers < POLICYDB_VERSION_AVTAB) { 345 if (vers < POLICYDB_VERSION_AVTAB) {
346 rc = next_entry(buf32, fp, sizeof(u32)); 346 rc = next_entry(buf32, fp, sizeof(u32));
347 if (rc < 0) { 347 if (rc < 0) {
348 printk(KERN_ERR "security: avtab: truncated entry\n"); 348 printk(KERN_ERR "SELinux: avtab: truncated entry\n");
349 return -1; 349 return -1;
350 } 350 }
351 items2 = le32_to_cpu(buf32[0]); 351 items2 = le32_to_cpu(buf32[0]);
352 if (items2 > ARRAY_SIZE(buf32)) { 352 if (items2 > ARRAY_SIZE(buf32)) {
353 printk(KERN_ERR "security: avtab: entry overflow\n"); 353 printk(KERN_ERR "SELinux: avtab: entry overflow\n");
354 return -1; 354 return -1;
355 355
356 } 356 }
357 rc = next_entry(buf32, fp, sizeof(u32)*items2); 357 rc = next_entry(buf32, fp, sizeof(u32)*items2);
358 if (rc < 0) { 358 if (rc < 0) {
359 printk(KERN_ERR "security: avtab: truncated entry\n"); 359 printk(KERN_ERR "SELinux: avtab: truncated entry\n");
360 return -1; 360 return -1;
361 } 361 }
362 items = 0; 362 items = 0;
@@ -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("security: avtab: truncated source type\n"); 367 printk("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("security: avtab: truncated target type\n"); 373 printk("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("security: avtab: truncated target class\n"); 379 printk("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("security: avtab: null entry\n"); 387 printk("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("security: avtab: entry has both access vectors and types\n"); 392 printk("SELinux: avtab: entry has both access vectors and types\n");
393 return -1; 393 return -1;
394 } 394 }
395 395
@@ -403,7 +403,7 @@ int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol,
403 } 403 }
404 404
405 if (items != items2) { 405 if (items != items2) {
406 printk("security: avtab: entry only had %d items, expected %d\n", items2, items); 406 printk("SELinux: avtab: entry only had %d items, expected %d\n", items2, items);
407 return -1; 407 return -1;
408 } 408 }
409 return 0; 409 return 0;
@@ -411,7 +411,7 @@ int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol,
411 411
412 rc = next_entry(buf16, fp, sizeof(u16)*4); 412 rc = next_entry(buf16, fp, sizeof(u16)*4);
413 if (rc < 0) { 413 if (rc < 0) {
414 printk("security: avtab: truncated entry\n"); 414 printk("SELinux: avtab: truncated entry\n");
415 return -1; 415 return -1;
416 } 416 }
417 417
@@ -424,7 +424,7 @@ int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol,
424 if (!policydb_type_isvalid(pol, key.source_type) || 424 if (!policydb_type_isvalid(pol, key.source_type) ||
425 !policydb_type_isvalid(pol, key.target_type) || 425 !policydb_type_isvalid(pol, key.target_type) ||
426 !policydb_class_isvalid(pol, key.target_class)) { 426 !policydb_class_isvalid(pol, key.target_class)) {
427 printk(KERN_WARNING "security: avtab: invalid type or class\n"); 427 printk(KERN_WARNING "SELinux: avtab: invalid type or class\n");
428 return -1; 428 return -1;
429 } 429 }
430 430
@@ -435,19 +435,19 @@ int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol,
435 } 435 }
436 if (!set || set > 1) { 436 if (!set || set > 1) {
437 printk(KERN_WARNING 437 printk(KERN_WARNING
438 "security: avtab: more than one specifier\n"); 438 "SELinux: avtab: more than one specifier\n");
439 return -1; 439 return -1;
440 } 440 }
441 441
442 rc = next_entry(buf32, fp, sizeof(u32)); 442 rc = next_entry(buf32, fp, sizeof(u32));
443 if (rc < 0) { 443 if (rc < 0) {
444 printk("security: avtab: truncated entry\n"); 444 printk("SELinux: avtab: truncated entry\n");
445 return -1; 445 return -1;
446 } 446 }
447 datum.data = le32_to_cpu(*buf32); 447 datum.data = le32_to_cpu(*buf32);
448 if ((key.specified & AVTAB_TYPE) && 448 if ((key.specified & AVTAB_TYPE) &&
449 !policydb_type_isvalid(pol, datum.data)) { 449 !policydb_type_isvalid(pol, datum.data)) {
450 printk(KERN_WARNING "security: avtab: invalid type\n"); 450 printk(KERN_WARNING "SELinux: avtab: invalid type\n");
451 return -1; 451 return -1;
452 } 452 }
453 return insertf(a, &key, &datum, p); 453 return insertf(a, &key, &datum, p);
@@ -468,12 +468,12 @@ int avtab_read(struct avtab *a, void *fp, struct policydb *pol)
468 468
469 rc = next_entry(buf, fp, sizeof(u32)); 469 rc = next_entry(buf, fp, sizeof(u32));
470 if (rc < 0) { 470 if (rc < 0) {
471 printk(KERN_ERR "security: avtab: truncated table\n"); 471 printk(KERN_ERR "SELinux: avtab: truncated table\n");
472 goto bad; 472 goto bad;
473 } 473 }
474 nel = le32_to_cpu(buf[0]); 474 nel = le32_to_cpu(buf[0]);
475 if (!nel) { 475 if (!nel) {
476 printk(KERN_ERR "security: avtab: table is empty\n"); 476 printk(KERN_ERR "SELinux: avtab: table is empty\n");
477 rc = -EINVAL; 477 rc = -EINVAL;
478 goto bad; 478 goto bad;
479 } 479 }
@@ -486,9 +486,9 @@ int avtab_read(struct avtab *a, void *fp, struct policydb *pol)
486 rc = avtab_read_item(a, fp, pol, avtab_insertf, NULL); 486 rc = avtab_read_item(a, fp, pol, avtab_insertf, NULL);
487 if (rc) { 487 if (rc) {
488 if (rc == -ENOMEM) 488 if (rc == -ENOMEM)
489 printk(KERN_ERR "security: avtab: out of memory\n"); 489 printk(KERN_ERR "SELinux: avtab: out of memory\n");
490 else if (rc == -EEXIST) 490 else if (rc == -EEXIST)
491 printk(KERN_ERR "security: avtab: duplicate entry\n"); 491 printk(KERN_ERR "SELinux: avtab: duplicate entry\n");
492 else 492 else
493 rc = -EINVAL; 493 rc = -EINVAL;
494 goto bad; 494 goto bad;