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

Subversion リポジトリの参照

Diff of /trunk/1.8.x/ccs-patch/security/ccsecurity/domain.c

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

revision 3109 by kumaneko, Fri Oct 16 05:02:23 2009 UTC revision 3215 by kumaneko, Fri Nov 27 04:36:09 2009 UTC
# Line 3  Line 3 
3   *   *
4   * Copyright (C) 2005-2009  NTT DATA CORPORATION   * Copyright (C) 2005-2009  NTT DATA CORPORATION
5   *   *
6   * Version: 1.7.1-pre   2009/10/16   * Version: 1.7.1   2009/11/11
7   *   *
8   * This file is applicable to both 2.4.30 and 2.6.11 and later.   * This file is applicable to both 2.4.30 and 2.6.11 and later.
9   * See README.ccs for ChangeLog.   * See README.ccs for ChangeLog.
# Line 658  static int ccs_find_next_domain(struct c Line 658  static int ccs_find_next_domain(struct c
658          }          }
659          domain = ccs_find_or_assign_new_domain(ee->tmp, r->profile);          domain = ccs_find_or_assign_new_domain(ee->tmp, r->profile);
660          if (domain)          if (domain)
661                  ccs_audit_domain_creation_log(r->domain);                  ccs_audit_domain_creation_log(domain);
662   done:   done:
663          if (!domain) {          if (!domain) {
664                  printk(KERN_WARNING "ERROR: Domain '%s' not defined.\n",                  printk(KERN_WARNING "ERROR: Domain '%s' not defined.\n",
# Line 691  static int ccs_environ(struct ccs_execve Line 691  static int ccs_environ(struct ccs_execve
691  {  {
692          struct ccs_request_info *r = &ee->r;          struct ccs_request_info *r = &ee->r;
693          struct linux_binprm *bprm = ee->bprm;          struct linux_binprm *bprm = ee->bprm;
694          char *arg_ptr = ee->tmp;          /* env_page->data is allocated by ccs_dump_page(). */
695            struct ccs_page_dump env_page = { };
696            char *arg_ptr; /* Size is CCS_EXEC_TMPSIZE bytes */
697          int arg_len = 0;          int arg_len = 0;
698          unsigned long pos = bprm->p;          unsigned long pos = bprm->p;
699          int offset = pos % PAGE_SIZE;          int offset = pos % PAGE_SIZE;
# Line 701  static int ccs_environ(struct ccs_execve Line 703  static int ccs_environ(struct ccs_execve
703          int error = -ENOMEM;          int error = -ENOMEM;
704          if (!r->mode || !envp_count)          if (!r->mode || !envp_count)
705                  return 0;                  return 0;
706            arg_ptr = kzalloc(CCS_EXEC_TMPSIZE, GFP_KERNEL);
707            if (!arg_ptr)
708                    goto out;
709          while (error == -ENOMEM) {          while (error == -ENOMEM) {
710                  if (!ccs_dump_page(bprm, pos, &ee->dump))                  if (!ccs_dump_page(bprm, pos, &env_page))
711                          goto out;                          goto out;
712                  pos += PAGE_SIZE - offset;                  pos += PAGE_SIZE - offset;
713                  /* Read. */                  /* Read. */
714                  while (argv_count && offset < PAGE_SIZE) {                  while (argv_count && offset < PAGE_SIZE) {
715                          const char *kaddr = ee->dump.data;                          if (!env_page.data[offset++])
                         if (!kaddr[offset++])  
716                                  argv_count--;                                  argv_count--;
717                  }                  }
718                  if (argv_count) {                  if (argv_count) {
# Line 716  static int ccs_environ(struct ccs_execve Line 720  static int ccs_environ(struct ccs_execve
720                          continue;                          continue;
721                  }                  }
722                  while (offset < PAGE_SIZE) {                  while (offset < PAGE_SIZE) {
723                          const char *kaddr = ee->dump.data;                          const unsigned char c = env_page.data[offset++];
                         const unsigned char c = kaddr[offset++];  
724                          if (c && arg_len < CCS_EXEC_TMPSIZE - 10) {                          if (c && arg_len < CCS_EXEC_TMPSIZE - 10) {
725                                  if (c == '=') {                                  if (c == '=') {
726                                          arg_ptr[arg_len++] = '\0';                                          arg_ptr[arg_len++] = '\0';
# Line 753  static int ccs_environ(struct ccs_execve Line 756  static int ccs_environ(struct ccs_execve
756   out:   out:
757          if (r->mode != 3)          if (r->mode != 3)
758                  error = 0;                  error = 0;
759            kfree(env_page.data);
760          return error;          return error;
761  }  }
762    

Legend:
Removed from v.3109  
changed lines
  Added in v.3215

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