1. 12 2月, 2009 3 次提交
    • K
      Memory and pathname management functions. · c73bd6d4
      Kentaro Takeda 提交于
      TOMOYO Linux performs pathname based access control.
      To remove factors that make pathname based access control difficult
      (e.g. symbolic links, "..", "//" etc.), TOMOYO Linux derives realpath
      of requested pathname from "struct dentry" and "struct vfsmount".
      
      The maximum length of string data is limited to 4000 including trailing '\0'.
      Since TOMOYO Linux uses '\ooo' style representation for non ASCII printable
      characters, maybe TOMOYO Linux should be able to support 16336 (which means
      (NAME_MAX * (PATH_MAX / (NAME_MAX + 1)) * 4 + (PATH_MAX / (NAME_MAX + 1)))
      including trailing '\0'), but I think 4000 is enough for practical use.
      
      TOMOYO uses only 0x21 - 0x7E (as printable characters) and 0x20 (as word
      delimiter) and 0x0A (as line delimiter).
      0x01 - 0x20 and 0x80 - 0xFF is handled in \ooo style representation.
      The reason to use \ooo is to guarantee that "%s" won't damage logs.
      Userland program can request
      
       open("/tmp/file granted.\nAccess /tmp/file ", O_WRONLY | O_CREAT, 0600)
      
      and logging such crazy pathname using "Access %s denied.\n" format will cause
      "fabrication of logs" like
      
       Access /tmp/file granted.
       Access /tmp/file denied.
      
      TOMOYO converts such characters to \ooo so that the logs will become
      
       Access /tmp/file\040granted.\012Access\040/tmp/file denied.
      
      and the administrator can read the logs safely using /bin/cat .
      Likewise, a crazy request like
      
       open("/tmp/\x01\x02\x03\x04\x05\x06\x07\x08\x09", O_WRONLY | O_CREAT, 0600)
      
      will be processed safely by converting to
      
       Access /tmp/\001\002\003\004\005\006\007\010\011 denied.
      Signed-off-by: NKentaro Takeda <takedakn@nttdata.co.jp>
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: NToshiharu Harada <haradats@nttdata.co.jp>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      c73bd6d4
    • K
      Add in_execve flag into task_struct. · f9ce1f1c
      Kentaro Takeda 提交于
      This patch allows LSM modules to determine whether current process is in an
      execve operation or not so that they can behave differently while an execve
      operation is in progress.
      
      This patch is needed by TOMOYO. Please see another patch titled "LSM adapter
      functions." for backgrounds.
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      f9ce1f1c
    • M
      integrity: audit update · 523979ad
      Mimi Zohar 提交于
      Based on discussions on linux-audit, as per Steve Grubb's request
      http://lkml.org/lkml/2009/2/6/269, the following changes were made:
      - forced audit result to be either 0 or 1.
      - made template names const
      - Added new stand-alone message type: AUDIT_INTEGRITY_RULE
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Acked-by: NSteve Grubb <sgrubb@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      523979ad
  2. 11 2月, 2009 1 次提交
    • M
      integrity: shmem zero fix · ed850a52
      Mimi Zohar 提交于
      Based on comments from Mike Frysinger and Randy Dunlap:
      (http://lkml.org/lkml/2009/2/9/262)
      - moved ima.h include before CONFIG_SHMEM test to fix compiler error
        on Blackfin:
      mm/shmem.c: In function 'shmem_zero_setup':
      mm/shmem.c:2670: error: implicit declaration of function 'ima_shm_check'
      
      - added 'struct linux_binprm' in ima.h to fix compiler warning on Blackfin:
      In file included from mm/shmem.c:32:
      include/linux/ima.h:25: warning: 'struct linux_binprm' declared inside
      parameter list
      include/linux/ima.h:25: warning: its scope is only this definition or
      declaration, which is probably not what you want
      
      - moved fs.h include within _LINUX_IMA_H definition
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      ed850a52
  3. 06 2月, 2009 35 次提交
  4. 05 2月, 2009 1 次提交