オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Diff of /branches/ccs-patch/security/ccsecurity/domain.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2544 by kumaneko, Thu May 14 06:55:46 2009 UTC revision 2545 by kumaneko, Thu May 14 07:44:57 2009 UTC
# Line 745  bool ccs_find_or_assign_new_domain(const Line 745  bool ccs_find_or_assign_new_domain(const
745          saved_domainname = ccs_get_name(domainname);          saved_domainname = ccs_get_name(domainname);
746          if (!saved_domainname)          if (!saved_domainname)
747                  return false;                  return false;
748          entry = kzalloc(sizeof(*domain), GFP_KERNEL);          entry = kzalloc(sizeof(*entry), GFP_KERNEL);
749          /***** WRITER SECTION START *****/          /***** WRITER SECTION START *****/
750          down_write(&ccs_policy_lock);          down_write(&ccs_policy_lock);
751          list_for_each_entry(domain, &ccs_domain_list, list) {          list_for_each_entry(domain, &ccs_domain_list, list) {
# Line 767  bool ccs_find_or_assign_new_domain(const Line 767  bool ccs_find_or_assign_new_domain(const
767          up_write(&ccs_policy_lock);          up_write(&ccs_policy_lock);
768          /***** WRITER SECTION END *****/          /***** WRITER SECTION END *****/
769          ccs_put_name(saved_domainname);          ccs_put_name(saved_domainname);
770          kfree(domain);          kfree(entry);
771          return cookie->u.domain != NULL;          return cookie->u.domain != NULL;
772  }  }
773    
# Line 837  static int ccs_find_next_domain(struct c Line 837  static int ccs_find_next_domain(struct c
837  {  {
838          struct ccs_request_info *r = &ee->r;          struct ccs_request_info *r = &ee->r;
839          const struct ccs_path_info *handler = ee->handler;          const struct ccs_path_info *handler = ee->handler;
         struct ccs_domain_info *domain = NULL;  
840          const char *old_domain_name = r->cookie.u.domain->domainname->name;          const char *old_domain_name = r->cookie.u.domain->domainname->name;
841          struct linux_binprm *bprm = ee->bprm;          struct linux_binprm *bprm = ee->bprm;
842          const u8 mode = r->mode;          const u8 mode = r->mode;
# Line 988  static int ccs_find_next_domain(struct c Line 987  static int ccs_find_next_domain(struct c
987          found = ccs_find_or_assign_new_domain(new_domain_name, r->profile,          found = ccs_find_or_assign_new_domain(new_domain_name, r->profile,
988                                                &r->cookie);                                                &r->cookie);
989          if (found)          if (found)
990                  ccs_audit_domain_creation_log(domain);                  ccs_audit_domain_creation_log(r->cookie.u.domain);
991   done:   done:
992          if (found) {          if (found) {
993                  retval = 0;                  retval = 0;
# Line 1211  static struct ccs_execve_entry *ccs_allo Line 1210  static struct ccs_execve_entry *ccs_allo
1210          }          }
1211          /* ee->dump->data is allocated by ccs_dump_page(). */          /* ee->dump->data is allocated by ccs_dump_page(). */
1212          ee->task = current;          ee->task = current;
         ccs_add_cookie(&ee->r.cookie, current->ccs_domain_info);  
1213          /***** CRITICAL SECTION START *****/          /***** CRITICAL SECTION START *****/
1214          spin_lock(&ccs_execve_list_lock);          spin_lock(&ccs_execve_list_lock);
1215          list_add(&ee->list, &ccs_execve_list);          list_add(&ee->list, &ccs_execve_list);
# Line 1260  static void ccs_free_execve_entry(struct Line 1258  static void ccs_free_execve_entry(struct
1258          ccs_free(ee->program_path);          ccs_free(ee->program_path);
1259          ccs_free(ee->tmp);          ccs_free(ee->tmp);
1260          kfree(ee->dump.data);          kfree(ee->dump.data);
         ccs_del_cookie(&ee->r.cookie);  
1261          ccs_free(ee);          ccs_free(ee);
1262  }  }
1263    

Legend:
Removed from v.2544  
changed lines
  Added in v.2545

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26