@@ -434,38 +434,6 @@ static void tomoyo_read_profile(struct tomoyo_io_buffer *head)
434434 head -> read_eof = true;
435435}
436436
437- /*
438- * tomoyo_policy_manager_list is used for holding list of domainnames or
439- * programs which are permitted to modify configuration via
440- * /sys/kernel/security/tomoyo/ interface.
441- *
442- * An entry is added by
443- *
444- * # echo '<kernel> /sbin/mingetty /bin/login /bin/bash' > \
445- * /sys/kernel/security/tomoyo/manager
446- * (if you want to specify by a domainname)
447- *
448- * or
449- *
450- * # echo '/usr/sbin/tomoyo-editpolicy' > /sys/kernel/security/tomoyo/manager
451- * (if you want to specify by a program's location)
452- *
453- * and is deleted by
454- *
455- * # echo 'delete <kernel> /sbin/mingetty /bin/login /bin/bash' > \
456- * /sys/kernel/security/tomoyo/manager
457- *
458- * or
459- *
460- * # echo 'delete /usr/sbin/tomoyo-editpolicy' > \
461- * /sys/kernel/security/tomoyo/manager
462- *
463- * and all entries are retrieved by
464- *
465- * # cat /sys/kernel/security/tomoyo/manager
466- */
467- LIST_HEAD (tomoyo_policy_manager_list );
468-
469437static bool tomoyo_same_manager_entry (const struct tomoyo_acl_head * a ,
470438 const struct tomoyo_acl_head * b )
471439{
@@ -503,7 +471,7 @@ static int tomoyo_update_manager_entry(const char *manager,
503471 if (!e .manager )
504472 return - ENOMEM ;
505473 error = tomoyo_update_policy (& e .head , sizeof (e ), is_delete ,
506- & tomoyo_policy_manager_list ,
474+ & tomoyo_policy_list [ TOMOYO_ID_MANAGER ] ,
507475 tomoyo_same_manager_entry );
508476 tomoyo_put_name (e .manager );
509477 return error ;
@@ -545,7 +513,7 @@ static void tomoyo_read_manager_policy(struct tomoyo_io_buffer *head)
545513 if (head -> read_eof )
546514 return ;
547515 list_for_each_cookie (pos , head -> read_var2 ,
548- & tomoyo_policy_manager_list ) {
516+ & tomoyo_policy_list [ TOMOYO_ID_MANAGER ] ) {
549517 struct tomoyo_policy_manager_entry * ptr ;
550518 ptr = list_entry (pos , struct tomoyo_policy_manager_entry ,
551519 head .list );
@@ -578,7 +546,8 @@ static bool tomoyo_policy_manager(void)
578546 return true;
579547 if (!tomoyo_manage_by_non_root && (task -> cred -> uid || task -> cred -> euid ))
580548 return false;
581- list_for_each_entry_rcu (ptr , & tomoyo_policy_manager_list , head .list ) {
549+ list_for_each_entry_rcu (ptr , & tomoyo_policy_list [TOMOYO_ID_MANAGER ],
550+ head .list ) {
582551 if (!ptr -> head .is_deleted && ptr -> is_domain
583552 && !tomoyo_pathcmp (domainname , ptr -> manager )) {
584553 found = true;
@@ -590,7 +559,8 @@ static bool tomoyo_policy_manager(void)
590559 exe = tomoyo_get_exe ();
591560 if (!exe )
592561 return false;
593- list_for_each_entry_rcu (ptr , & tomoyo_policy_manager_list , head .list ) {
562+ list_for_each_entry_rcu (ptr , & tomoyo_policy_list [TOMOYO_ID_MANAGER ],
563+ head .list ) {
594564 if (!ptr -> head .is_deleted && !ptr -> is_domain
595565 && !strcmp (exe , ptr -> manager -> name )) {
596566 found = true;
0 commit comments