1. 18 2月, 2010 1 次提交
    • C
      kmemcheck: Test the full object in kmemcheck_is_obj_initialized() · 81fc0390
      Catalin Marinas 提交于
      This is a fix for bug #14845 (bugzilla.kernel.org). The update_checksum()
      function in mm/kmemleak.c calls kmemcheck_is_obj_initialised() before scanning
      an object. When KMEMCHECK_PARTIAL_OK is enabled, this function returns true.
      However, the crc32_le() reads smaller intervals (32-bit) for which
      kmemleak_is_obj_initialised() may be false leading to a kmemcheck warning.
      
      Note that kmemcheck_is_obj_initialized() is currently only used by
      kmemleak before scanning a memory location.
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Christian Casteyde <casteyde.christian@free.fr>
      Cc: Vegard Nossum <vegardno@ifi.uio.no>
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      81fc0390
  2. 28 12月, 2009 1 次提交
  3. 20 9月, 2009 1 次提交
  4. 04 9月, 2009 1 次提交
    • P
      kmemleak: Don't scan uninitialized memory when kmemcheck is enabled · 8e019366
      Pekka Enberg 提交于
      Ingo Molnar reported the following kmemcheck warning when running both
      kmemleak and kmemcheck enabled:
      
        PM: Adding info for No Bus:vcsa7
        WARNING: kmemcheck: Caught 32-bit read from uninitialized memory
        (f6f6e1a4)
        d873f9f600000000c42ae4c1005c87f70000000070665f666978656400000000
         i i i i u u u u i i i i i i i i i i i i i i i i i i i i i u u u
                 ^
      
        Pid: 3091, comm: kmemleak Not tainted (2.6.31-rc7-tip #1303) P4DC6
        EIP: 0060:[<c110301f>] EFLAGS: 00010006 CPU: 0
        EIP is at scan_block+0x3f/0xe0
        EAX: f40bd700 EBX: f40bd780 ECX: f16b46c0 EDX: 00000001
        ESI: f6f6e1a4 EDI: 00000000 EBP: f10f3f4c ESP: c2605fcc
         DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
        CR0: 8005003b CR2: e89a4844 CR3: 30ff1000 CR4: 000006f0
        DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
        DR6: ffff4ff0 DR7: 00000400
         [<c110313c>] scan_object+0x7c/0xf0
         [<c1103389>] kmemleak_scan+0x1d9/0x400
         [<c1103a3c>] kmemleak_scan_thread+0x4c/0xb0
         [<c10819d4>] kthread+0x74/0x80
         [<c10257db>] kernel_thread_helper+0x7/0x3c
         [<ffffffff>] 0xffffffff
        kmemleak: 515 new suspected memory leaks (see
        /sys/kernel/debug/kmemleak)
        kmemleak: 42 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
      
      The problem here is that kmemleak will scan partially initialized
      objects that makes kmemcheck complain. Fix that up by skipping
      uninitialized memory regions when kmemcheck is enabled.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      8e019366
  5. 02 7月, 2009 2 次提交
  6. 15 6月, 2009 7 次提交
  7. 13 6月, 2009 2 次提交
    • R
      kmemcheck: include module.h to prevent warnings · 60e38393
      Randy Dunlap 提交于
      kmemcheck/shadow.c needs to include <linux/module.h> to prevent
      the following warnings:
      
      linux-next-20080724/arch/x86/mm/kmemcheck/shadow.c:64: warning : data definition has no type or storage class
      linux-next-20080724/arch/x86/mm/kmemcheck/shadow.c:64: warning : type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
      linux-next-20080724/arch/x86/mm/kmemcheck/shadow.c:64: warning : parameter names (without types) in function declaration
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Cc: vegardno@ifi.uio.no
      Cc: penberg@cs.helsinki.fi
      Cc: akpm <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      60e38393
    • V
      kmemcheck: add the kmemcheck core · dfec072e
      Vegard Nossum 提交于
      General description: kmemcheck is a patch to the linux kernel that
      detects use of uninitialized memory. It does this by trapping every
      read and write to memory that was allocated dynamically (e.g. using
      kmalloc()). If a memory address is read that has not previously been
      written to, a message is printed to the kernel log.
      
      Thanks to Andi Kleen for the set_memory_4k() solution.
      
      Andrew Morton suggested documenting the shadow member of struct page.
      Signed-off-by: NVegard Nossum <vegardno@ifi.uio.no>
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      
      [export kmemcheck_mark_initialized]
      [build fix for setup_max_cpus]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      
      [rebased for mainline inclusion]
      Signed-off-by: NVegard Nossum <vegardno@ifi.uio.no>
      dfec072e