[Bug sanitizer/97941] New: [HWASAN] use After free not working as per expectation

akhilesh.k at samsung dot com gcc-bugzilla@gcc.gnu.org
Mon Nov 23 05:15:32 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97941

            Bug ID: 97941
           Summary: [HWASAN] use After free not working as per expectation
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: akhilesh.k at samsung dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---

Hello Matthew

While HWASAN verification feature, Source I taken from GCC11 trunk. 
I observed Some HWASAN features are not working as per expectation. 
Like use After free, Is this known behaviors/Issue ? 



int main() {
  char *x = (char*)malloc(10 * sizeof(char*));
  free(x);
  return x[5];
} 

./myhak 
HWAddressSanitizer:DEADLYSIGNAL
==1227==ERROR: HWAddressSanitizer: SEGV on unknown address 0x000000000030 (pc
0x0000004096c8 bp 0x005f00ae9fe0 sp 0x005f00ae8d10 T1227)
==1227==The signal is caused by a UNKNOWN memory access.
==1227==Hint: address points to the zero page.
    #0 0x4096c8 in GetAccessInfo
/data2/2706/akhilesh.k/script/32/hwsetup/gcc-11.1.0/libsanitizer/hwasan/hwasan_linux.cpp:383
    #1 0x4096c8 in HwasanOnSIGTRAP
/data2/2706/akhilesh.k/script/32/hwsetup/gcc-11.1.0/libsanitizer/hwasan/hwasan_linux.cpp:445
    #2 0x4096c8 in __hwasan::HwasanOnDeadlySignal(int, void*, void*)
/data2/2706/akhilesh.k/script/32/hwsetup/gcc-11.1.0/libsanitizer/hwasan/hwasan_linux.cpp:470
    #3 0x5f00ae9fec  (<unknown module>)
    #4 0x406918 in __hwasan_load1
/data2/2706/akhilesh.k/script/32/hwsetup/gcc-11.1.0/libsanitizer/hwasan/hwasan.cpp:446
    #5 0x43815c in main
(/data10/1000/akhilesh.k/Activity/buildroot/myhak+0x43815c)
    #6 0x55009830a0 in __libc_start_main ../csu/libc-start.c:308
    #7 0x4023c4  (/data10/1000/akhilesh.k/Activity/buildroot/myhak+0x4023c4)

HWAddressSanitizer can not provide additional info.
SUMMARY: HWAddressSanitizer: SEGV
/data2/2706/akhilesh.k/script/32/hwsetup/gcc-11.1.0/libsanitizer/hwasan/hwasan_linux.cpp:383
in GetAccessInfo
==1227==ABORTING


More information about the Gcc-bugs mailing list