[-next,2/2] Revert "mm/kmemleak: annotate various data races obj->ptr"
diff mbox series

Message ID 1583263716-25150-2-git-send-email-cai@lca.pw
State New
Headers show
Series
  • [-next,1/2] mm: disable KCSAN for kmemleak
Related show

Commit Message

Qian Cai March 3, 2020, 7:28 p.m. UTC
This reverts commit a03184297d546c6531cdd40878f1f50732d3bac9.

Signed-off-by: Qian Cai <cai@lca.pw>
---
 mm/kmemleak.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Comments

Marco Elver March 3, 2020, 8:21 p.m. UTC | #1
On Tue, 3 Mar 2020 at 20:28, Qian Cai <cai@lca.pw> wrote:
>
> This reverts commit a03184297d546c6531cdd40878f1f50732d3bac9.
>
> Signed-off-by: Qian Cai <cai@lca.pw>

Acked-by: Marco Elver <elver@google.com>

Thank you!

> ---
>  mm/kmemleak.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> index 788dc5509539..e362dc3d2028 100644
> --- a/mm/kmemleak.c
> +++ b/mm/kmemleak.c
> @@ -1169,12 +1169,7 @@ static bool update_checksum(struct kmemleak_object *object)
>         u32 old_csum = object->checksum;
>
>         kasan_disable_current();
> -       /*
> -        * crc32() will dereference object->pointer. If an unstable value was
> -        * returned due to a data race, it will be corrected in the next scan.
> -        */
> -       object->checksum = data_race(crc32(0, (void *)object->pointer,
> -                                          object->size));
> +       object->checksum = crc32(0, (void *)object->pointer, object->size);
>         kasan_enable_current();
>
>         return object->checksum != old_csum;
> @@ -1248,7 +1243,7 @@ static void scan_block(void *_start, void *_end,
>                         break;
>
>                 kasan_disable_current();
> -               pointer = data_race(*ptr);
> +               pointer = *ptr;
>                 kasan_enable_current();
>
>                 untagged_ptr = (unsigned long)kasan_reset_tag((void *)pointer);
> --
> 1.8.3.1
>
Catalin Marinas March 11, 2020, 2:19 p.m. UTC | #2
On Tue, Mar 03, 2020 at 02:28:36PM -0500, Qian Cai wrote:
> This reverts commit a03184297d546c6531cdd40878f1f50732d3bac9.
> 
> Signed-off-by: Qian Cai <cai@lca.pw>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

Patch
diff mbox series

diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 788dc5509539..e362dc3d2028 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -1169,12 +1169,7 @@  static bool update_checksum(struct kmemleak_object *object)
 	u32 old_csum = object->checksum;
 
 	kasan_disable_current();
-	/*
-	 * crc32() will dereference object->pointer. If an unstable value was
-	 * returned due to a data race, it will be corrected in the next scan.
-	 */
-	object->checksum = data_race(crc32(0, (void *)object->pointer,
-					   object->size));
+	object->checksum = crc32(0, (void *)object->pointer, object->size);
 	kasan_enable_current();
 
 	return object->checksum != old_csum;
@@ -1248,7 +1243,7 @@  static void scan_block(void *_start, void *_end,
 			break;
 
 		kasan_disable_current();
-		pointer = data_race(*ptr);
+		pointer = *ptr;
 		kasan_enable_current();
 
 		untagged_ptr = (unsigned long)kasan_reset_tag((void *)pointer);