<div dir="ltr"><div><div><div>Hi,<br><br></div>I am a final year French student doing an internship at the University of Portsmouth. As I was taking hands on AddressSanitizer I took a look at BoundsChecking (both are in the lib/Transforms/Instrumentation folder).<br><br></div><div>I found nothing on it except for the LLVM Documentation and references to BaggyBoundsCheck (which is not the same project. As far as I understood it is part of the SAFECode project). Does anyone knows about it (BoundsChecking)? I have some inquiries I will try to explain just below...<br></div><div><br></div>I modified a bit the registration process of the Pass (the BoundsChecking one) to get the .so generated file once llvm rebuild. I then ran the LLVM opt with loading the .so for a C program that did both a stack and heap overflow:<br></div><div>  - clang -emit-llvm overflow.c -c -o overflow.bc<br></div><div>  - opt -load path-to-so/LLVMBoundsChecking.so -options < overflow.bc > overflow_instrumented.bc<br><br></div><div>I then ran llc and gcc to get an executable:<br></div><div>  - llc -filetype=obj overflow_instrumented.bc (generates a .o file with same name)<br></div><div>  - gcc overflow_instrumented.o -o overflow_instrumented<br><br></div><div>Once launched, the executable detects the stack access and crash the program (you can see the checks on the assembly code which are followed by a conditional jump on a UD2 instruction that basically crash a program) but nothing is instrumented for the heap access. On the BoundsChecking file it is said that run-time checks are maid but I don't see them. So my questions are:<br></div><div>  - are there any heap checking made?<br></div><div>  - if yes, where are they?<br><br></div><div>I am interested in this because I think I am going to try to do the same work made on the stack to the heap.<br><br></div><div>Thank you for your help, any information or advice is welcome :)<br><br></div><div>Pierre<br></div></div>