kmemcheck: Test the full object in kmemcheck_is_obj_initialized()
commit81fc03909a80bead8f553287a2b749a1d29dca64
authorCatalin Marinas <catalin.marinas@arm.com>
Mon, 8 Feb 2010 11:16:24 +0000 (8 11:16 +0000)
committerPekka Enberg <penberg@cs.helsinki.fi>
Wed, 17 Feb 2010 19:39:08 +0000 (17 21:39 +0200)
tree6c62a780be628ea551bf1e5854260ce94608c521
parent724e6d3fe8003c3f60bf404bf22e4e331327c596
kmemcheck: Test the full object in kmemcheck_is_obj_initialized()

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: Catalin 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: Pekka Enberg <penberg@cs.helsinki.fi>
arch/x86/mm/kmemcheck/kmemcheck.c
arch/x86/mm/kmemcheck/shadow.c
arch/x86/mm/kmemcheck/shadow.h