Changeset 2770

Show
Ignore:
Timestamp:
07/31/08 09:05:46 (4 months ago)
Author:
cpebenito
Message:

trunk: Policy size optimization with a non-security file attribute from James Carter.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Changelog

    r2765 r2770  
     1- Policy size optimization with a non-security file attribute from James 
     2  Carter. 
    13- Database labeled networking update from KaiGai Kohei. 
    24- Several misc changes from the Fedora policy, cherry picked by David 
  • trunk/policy/modules/kernel/files.if

    r2763 r2770  
    3333interface(`files_type',` 
    3434        gen_require(` 
    35                 attribute file_type
    36         ') 
    37  
    38         typeattribute $1 file_type
     35                attribute file_type, non_security_file_type
     36        ') 
     37 
     38        typeattribute $1 file_type, non_security_file_type
    3939') 
    4040 
     
    218218interface(`files_security_file',` 
    219219        gen_require(` 
    220                 attribute security_file_type; 
    221         ') 
    222  
    223         files_type($1) 
    224         typeattribute $1 security_file_type; 
     220                attribute file_type, security_file_type; 
     221        ') 
     222 
     223        typeattribute $1 file_type, security_file_type; 
     224') 
     225 
     226######################################## 
     227## <summary> 
     228##      Make the specified type usable for 
     229##      security file filesystem mount points. 
     230## </summary> 
     231## <param name="type"> 
     232##      <summary> 
     233##      Type to be used for mount points. 
     234##      </summary> 
     235## </param> 
     236
     237interface(`files_security_mountpoint',` 
     238        gen_require(` 
     239                attribute mountpoint; 
     240        ') 
     241 
     242        files_security_file($1) 
     243        typeattribute $1 mountpoint; 
    225244') 
    226245 
     
    317336interface(`files_list_non_security',` 
    318337        gen_require(` 
    319                 attribute file_type, security_file_type; 
    320         ') 
    321  
    322         list_dirs_pattern($1, { file_type -security_file_type }, { file_type -security_file_type }
     338                attribute non_security_file_type; 
     339        ') 
     340 
     341        list_dirs_pattern($1, non_security_file_type, non_security_file_type
    323342') 
    324343 
     
    336355interface(`files_dontaudit_list_non_security',` 
    337356        gen_require(` 
    338                 attribute file_type, security_file_type; 
    339         ') 
    340  
    341         dontaudit $1 { file_type -security_file_type }:dir list_dir_perms; 
     357                attribute non_security_file_type; 
     358        ') 
     359 
     360        dontaudit $1 non_security_file_type:dir list_dir_perms; 
    342361') 
    343362 
     
    355374interface(`files_mounton_non_security',` 
    356375        gen_require(` 
    357                 attribute file_type, security_file_type; 
    358         ') 
    359  
    360         allow $1 { file_type -security_file_type }:dir mounton; 
    361         allow $1 { file_type -security_file_type }:file mounton; 
     376                attribute non_security_file_type; 
     377        ') 
     378 
     379        allow $1 non_security_file_type:dir mounton; 
     380        allow $1 non_security_file_type:file mounton; 
    362381') 
    363382 
     
    374393interface(`files_write_non_security_dirs',` 
    375394        gen_require(` 
    376                 attribute file_type, security_file_type; 
    377         ') 
    378  
    379         allow $1 { file_type -security_file_type }:dir write; 
     395                attribute non_security_file_type; 
     396        ') 
     397 
     398        allow $1 non_security_file_type:dir write; 
     399') 
     400 
     401######################################## 
     402## <summary> 
     403##      Allow attempts to manage non-security directories 
     404## </summary> 
     405## <param name="domain"> 
     406##      <summary> 
     407##      Domain to allow 
     408##      </summary> 
     409## </param> 
     410
     411interface(`files_manage_non_security_dirs',` 
     412        gen_require(` 
     413                attribute non_security_file_type; 
     414        ') 
     415 
     416        allow $1 non_security_file_type:dir manage_dir_perms; 
    380417') 
    381418 
     
    431468interface(`files_dontaudit_getattr_non_security_files',` 
    432469        gen_require(` 
    433                 attribute file_type, security_file_type; 
    434         ') 
    435  
    436         dontaudit $1 { file_type -security_file_type }:file getattr; 
     470                attribute non_security_file_type; 
     471        ') 
     472 
     473        dontaudit $1 non_security_file_type:file getattr; 
    437474') 
    438475 
     
    499536interface(`files_read_non_security_files',` 
    500537        gen_require(` 
    501                 attribute file_type, security_file_type; 
    502         ') 
    503  
    504         read_files_pattern($1, { file_type -security_file_type }, { file_type -security_file_type }
    505         read_lnk_files_pattern($1, { file_type -security_file_type }, { file_type -security_file_type }
     538                attribute non_security_file_type; 
     539        ') 
     540 
     541        read_files_pattern($1, non_security_file_type, non_security_file_type
     542        read_lnk_files_pattern($1, non_security_file_type, non_security_file_type
    506543') 
    507544 
     
    649686interface(`files_dontaudit_getattr_non_security_symlinks',` 
    650687        gen_require(` 
    651                 attribute file_type, security_file_type; 
    652         ') 
    653  
    654         dontaudit $1 { file_type -security_file_type }:lnk_file getattr; 
     688                attribute non_security_file_type; 
     689        ') 
     690 
     691        dontaudit $1 non_security_file_type:lnk_file getattr; 
    655692') 
    656693 
     
    668705interface(`files_dontaudit_getattr_non_security_blk_files',` 
    669706        gen_require(` 
    670                 attribute file_type, security_file_type; 
    671         ') 
    672  
    673         dontaudit $1 { file_type -security_file_type }:blk_file getattr; 
     707                attribute non_security_file_type; 
     708        ') 
     709 
     710        dontaudit $1 non_security_file_type:blk_file getattr; 
    674711') 
    675712 
     
    687724interface(`files_dontaudit_getattr_non_security_chr_files',` 
    688725        gen_require(` 
    689                 attribute file_type, security_file_type; 
    690         ') 
    691  
    692         dontaudit $1 { file_type -security_file_type }:chr_file getattr; 
     726                attribute non_security_file_type; 
     727        ') 
     728 
     729        dontaudit $1 non_security_file_type:chr_file getattr; 
    693730') 
    694731 
     
    764801interface(`files_dontaudit_getattr_non_security_pipes',` 
    765802        gen_require(` 
    766                 attribute file_type, security_file_type; 
    767         ') 
    768  
    769         dontaudit $1 { file_type -security_file_type }:fifo_file getattr; 
     803                attribute non_security_file_type; 
     804        ') 
     805 
     806        dontaudit $1 non_security_file_type:fifo_file getattr; 
    770807') 
    771808 
     
    821858interface(`files_dontaudit_getattr_non_security_sockets',` 
    822859        gen_require(` 
    823                 attribute file_type, security_file_type; 
    824         ') 
    825  
    826         dontaudit $1 { file_type -security_file_type }:sock_file getattr; 
     860                attribute non_security_file_type; 
     861        ') 
     862 
     863        dontaudit $1 non_security_file_type:sock_file getattr; 
    827864') 
    828865 
     
    47514788        typeattribute $1 files_unconfined_type; 
    47524789') 
    4753  
    4754 ######################################## 
    4755 ## <summary> 
    4756 ##      Allow attempts to monage any directory 
    4757 ## </summary> 
    4758 ## <param name="domain"> 
    4759 ##      <summary> 
    4760 ##      Domain to allow 
    4761 ##      </summary> 
    4762 ## </param> 
    4763 # 
    4764 interface(`files_manage_non_security_dirs',` 
    4765         gen_require(` 
    4766                 attribute file_type, security_file_type; 
    4767         ') 
    4768  
    4769         allow $1 { file_type -security_file_type }:dir manage_dir_perms; 
    4770 ') 
  • trunk/policy/modules/kernel/files.te

    r2763 r2770  
    11 
    2 policy_module(files, 1.9.0
     2policy_module(files, 1.9.1
    33 
    44######################################## 
     
    2727# not be dontaudited for uses 
    2828attribute security_file_type; 
     29# and its opposite 
     30attribute non_security_file_type; 
    2931 
    3032attribute tmpfile; 
  • trunk/policy/modules/system/logging.te

    r2742 r2770  
    11 
    2 policy_module(logging, 1.11.0
     2policy_module(logging, 1.11.1
    33 
    44######################################## 
     
    1919type auditd_log_t; 
    2020files_security_file(auditd_log_t) 
    21 files_mountpoint(auditd_log_t) 
     21files_security_mountpoint(auditd_log_t) 
    2222 
    2323type auditd_t;