[前][次][番号順一覧][スレッド一覧]

ruby-changes:63191

From: Aaron <ko1@a...>
Date: Tue, 29 Sep 2020 02:18:36 +0900 (JST)
Subject: [ruby-changes:63191] 85e9cc2c87 (master): Unpoison THEAP header before reading

https://git.ruby-lang.org/ruby.git/commit/?id=85e9cc2c87

From 85e9cc2c8721badb5c6a7f80518342194d5988b4 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Mon, 28 Sep 2020 09:53:30 -0700
Subject: Unpoison THEAP header before reading

Another ASAN fix.  THEAP header is poisoned, so we need to un-poison
before reading

diff --git a/transient_heap.c b/transient_heap.c
index 809a237..391dd59 100644
--- a/transient_heap.c
+++ b/transient_heap.c
@@ -716,6 +716,7 @@ transient_heap_block_evacuate(struct transient_heap* theap, struct transient_hea https://github.com/ruby/ruby/blob/trunk/transient_heap.c#L716
 
     while (marked_index >= 0) {
         struct transient_alloc_header *header = alloc_header(block, marked_index);
+        asan_unpoison_memory_region(header, sizeof *header, true);
         VALUE obj = header->obj;
         TH_ASSERT(header->magic == TRANSIENT_HEAP_ALLOC_MAGIC);
         if (header->magic != TRANSIENT_HEAP_ALLOC_MAGIC) rb_bug("rb_transient_heap_mark: wrong header %s\n", rb_obj_info(obj));
@@ -744,6 +745,7 @@ transient_heap_block_evacuate(struct transient_heap* theap, struct transient_hea https://github.com/ruby/ruby/blob/trunk/transient_heap.c#L745
             header->obj = Qundef; /* for debug */
         }
         marked_index = header->next_marked_index;
+        asan_poison_memory_region(header, sizeof *header);
     }
 }
 
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]