1. 17 12月, 2009 5 次提交
  2. 19 11月, 2009 1 次提交
    • M
      ima: replace GFP_KERNEL with GFP_NOFS · c09c59e6
      Mimi Zohar 提交于
      While running fsstress tests on the NFSv4 mounted ext3 and ext4
      filesystem, the following call trace was generated on the nfs
      server machine.
      
      Replace GFP_KERNEL with GFP_NOFS in ima_iint_insert() to avoid a
      potential deadlock.
      
           =================================
          [ INFO: inconsistent lock state ]
          2.6.31-31.el6.x86_64 #1
          ---------------------------------
          inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W} usage.
          kswapd2/75 [HC0[0]:SC0[0]:HE1:SE1] takes:
           (jbd2_handle){+.+.?.}, at: [<ffffffff811edd5e>] jbd2_journal_start+0xfe/0x13f
          {RECLAIM_FS-ON-W} state was registered at:
            [<ffffffff81091e40>] mark_held_locks+0x65/0x99
            [<ffffffff81091f31>] lockdep_trace_alloc+0xbd/0xf5
            [<ffffffff81126fdd>] kmem_cache_alloc+0x40/0x185
            [<ffffffff812344d7>] ima_iint_insert+0x3d/0xf1
            [<ffffffff812345b0>] ima_inode_alloc+0x25/0x44
            [<ffffffff811484ac>] inode_init_always+0xec/0x271
            [<ffffffff81148682>] alloc_inode+0x51/0xa1
            [<ffffffff81148700>] new_inode+0x2e/0x94
            [<ffffffff811b2f08>] ext4_new_inode+0xb8/0xdc9
            [<ffffffff811be611>] ext4_create+0xcf/0x175
            [<ffffffff8113e2cd>] vfs_create+0x82/0xb8
            [<ffffffff8113f337>] do_filp_open+0x32c/0x9ee
            [<ffffffff811309b9>] do_sys_open+0x6c/0x12c
            [<ffffffff81130adc>] sys_open+0x2e/0x44
            [<ffffffff81011e42>] system_call_fastpath+0x16/0x1b
            [<ffffffffffffffff>] 0xffffffffffffffff
          irq event stamp: 90371
          hardirqs last  enabled at (90371): [<ffffffff8112708d>]
          kmem_cache_alloc+0xf0/0x185
          hardirqs last disabled at (90370): [<ffffffff81127026>]
          kmem_cache_alloc+0x89/0x185
          softirqs last  enabled at (89492): [<ffffffff81068ecf>]
          __do_softirq+0x1bf/0x1eb
          softirqs last disabled at (89477): [<ffffffff8101312c>] call_softirq+0x1c/0x30
      
          other info that might help us debug this:
          2 locks held by kswapd2/75:
           #0:  (shrinker_rwsem){++++..}, at: [<ffffffff810f98ba>] shrink_slab+0x44/0x177
           #1:  (&type->s_umount_key#25){++++..}, at: [<ffffffff811450ba>]
      Reported-by: NMuni P. Beerakam <mbeeraka@in.ibm.com>
      Reported-by: NAmit K. Arora <amitarora@in.ibm.com>
      Cc: stable@kernel.org
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      c09c59e6
  3. 25 10月, 2009 1 次提交
  4. 02 10月, 2009 1 次提交
  5. 23 9月, 2009 1 次提交
  6. 07 9月, 2009 1 次提交
  7. 27 8月, 2009 1 次提交
    • E
      IMA: iint put in ima_counts_get and put · 53a7197a
      Eric Paris 提交于
      ima_counts_get() calls ima_iint_find_insert_get() which takes a reference
      to the iint in question, but does not put that reference at the end of the
      function.  This can lead to a nasty memory leak.  Easy enough to reproduce:
      
      #include <sys/mman.h>
      #include <stdio.h>
      
      int main (void)
      {
      	int i;
      	void *ptr;
      
      	for (i=0; i < 100000; i++) {
      		ptr = mmap(NULL, 4096, PROT_READ|PROT_WRITE,
      			   MAP_SHARED|MAP_ANONYMOUS, -1, 0);
      		if (ptr == MAP_FAILED)
      			return 2;
      		munmap(ptr, 4096);
      	}
      
      	return 0;
      }
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      53a7197a
  8. 24 8月, 2009 1 次提交
  9. 29 6月, 2009 2 次提交
  10. 05 6月, 2009 1 次提交
  11. 22 5月, 2009 3 次提交
    • M
      integrity: path_check update · b9fc745d
      Mimi Zohar 提交于
      - Add support in ima_path_check() for integrity checking without
      incrementing the counts. (Required for nfsd.)
      - rename and export opencount_get to ima_counts_get
      - replace ima_shm_check calls with ima_counts_get
      - export ima_path_check
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      b9fc745d
    • E
      IMA: Add __init notation to ima functions · 932995f0
      Eric Paris 提交于
      A number of IMA functions only used during init are not marked with __init.
      Add those notations so they are freed automatically.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Acked-by: NMimi Zohar <zohar@us.ibm.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      932995f0
    • E
      IMA: Minimal IMA policy and boot param for TCB IMA policy · 5789ba3b
      Eric Paris 提交于
      The IMA TCB policy is dangerous.  A normal use can use all of a system's
      memory (which cannot be freed) simply by building and running lots of
      executables.  The TCB policy is also nearly useless because logging in as root
      often causes a policy violation when dealing with utmp, thus rendering the
      measurements meaningless.
      
      There is no good fix for this in the kernel.  A full TCB policy would need to
      be loaded in userspace using LSM rule matching to get both a protected and
      useful system.  But, if too little is measured before userspace can load a real
      policy one again ends up with a meaningless set of measurements.  One option
      would be to put the policy load inside the initrd in order to get it early
      enough in the boot sequence to be useful, but this runs into trouble with the
      LSM.  For IMA to measure the LSM policy and the LSM policy loading mechanism
      it needs rules to do so, but we already talked about problems with defaulting
      to such broad rules....
      
      IMA also depends on the files being measured to be on an FS which implements
      and supports i_version.  Since the only FS with this support (ext4) doesn't
      even use it by default it seems silly to have any IMA rules by default.
      
      This should reduce the performance overhead of IMA to near 0 while still
      letting users who choose to configure their machine as such to inclue the
      ima_tcb kernel paramenter and get measurements during boot before they can
      load a customized, reasonable policy in userspace.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Acked-by: NMimi Zohar <zohar@us.ibm.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      5789ba3b
  12. 19 5月, 2009 1 次提交
  13. 15 5月, 2009 2 次提交
  14. 12 5月, 2009 3 次提交
  15. 06 5月, 2009 3 次提交
  16. 15 4月, 2009 1 次提交
  17. 23 2月, 2009 1 次提交
  18. 20 2月, 2009 1 次提交
    • M
      integrity: ima scatterlist bug fix · 0da0a420
      Mimi Zohar 提交于
      Based on Alexander Beregalov's post http://lkml.org/lkml/2009/2/19/198
      
      - replaced sg_set_buf() with sg_init_one()
      
       kernel BUG at include/linux/scatterlist.h:65!
       invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
       last sysfs file:
       CPU 2
       Modules linked in:
       Pid: 1, comm: swapper Not tainted 2.6.29-rc5-next-20090219 #5 PowerEdge 1950
       RIP: 0010:[<ffffffff8045ec70>]  [<ffffffff8045ec70>] ima_calc_hash+0xc0/0x160
       RSP: 0018:ffff88007f46bc40  EFLAGS: 00010286
       RAX: ffffe200032c45e8 RBX: 00000000fffffff4 RCX: 0000000087654321
       RDX: 0000000000000002 RSI: 0000000000000001 RDI: ffff88007cf71048
       RBP: ffff88007f46bcd0 R08: 0000000000000000 R09: 0000000000000163
       R10: ffff88007f4707a8 R11: 0000000000000000 R12: ffff88007cf71048
       R13: 0000000000001000 R14: 0000000000000000 R15: 0000000000009d98
       FS:  0000000000000000(0000) GS:ffff8800051ac000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
       CR2: 0000000000000000 CR3: 0000000000201000 CR4: 00000000000006e0
       DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
       DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Tested-by: NAlexander Beregalov <a.beregalov@gmail.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      0da0a420
  19. 13 2月, 2009 1 次提交
    • R
      ima: fix build error · b53fab9d
      Randy Dunlap 提交于
      IMA_LSM_RULES requires AUDIT.  This is automatic if SECURITY_SELINUX=y
      but not when SECURITY_SMACK=y (and SECURITY_SELINUX=n), so make the
      dependency explicit.  This fixes the following build error:
      
      security/integrity/ima/ima_policy.c:111:error: implicit declaration of function 'security_audit_rule_match'
      security/integrity/ima/ima_policy.c:230:error: implicit declaration of function 'security_audit_rule_init'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Acked-by: NMimi Zohar <zohar@us.ibm.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      b53fab9d
  20. 12 2月, 2009 1 次提交
  21. 06 2月, 2009 6 次提交