<div dir="ltr"><div class="gmail-gs" style="margin:0px;padding:0px 0px 20px;width:1644.25px;font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:medium"><div class="gmail-"><div id="gmail-:1hb" class="gmail-ii gmail-gt gmail-adO" style="font-size:0.875rem;direction:ltr;margin:8px 0px 0px;padding:0px"><div id="gmail-:ni" class="gmail-a3s gmail-aXjCH" style="overflow:hidden;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:small;line-height:1.5;font-family:Arial,Helvetica,sans-serif"><div dir="ltr"><div style="padding:20px 0px 0px;font-size:0.875rem"><span style="font-size:small">I am working of using libfuzzer and asan to test out a third-party library.</span><br><span style="font-size:small">As demonstrated in the tutorial, I wrote a fuzz target to fuzz a specific function in the library. The fuzz target is then linked to the library and compiles clean and I do see some tests generated by the fuzzer. However, I have some questions regarding the "right" way to go about doing this. I have doubts that the fuzzer taking coverage feedback from the fuzztarget and not the library functions (not sure though). Suppose the function in the library being tested is called -</span><span style="font-size:small"> </span><b style="font-size:small">apifunc()</b><span style="font-size:small">. The libfuzzer log has a line which says - </span><b style="font-size:small">apifunc() resp=0x7ff38f83ac20 uninitialized, fixing it</b><span style="font-size:small">. I am not sure what this means. Also, I can see that the apifunc is called and it runs but it does not show up in the </span><span style="font-size:small"> </span><b style="font-size:small">NEW_FUNC[x/xxx]: </b><span style="font-size:small">log lines in the libfuzzer output. </span><table cellpadding="0" style="border-collapse:collapse;margin-top:0px;width:auto;font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:0.875rem;letter-spacing:0.2px;display:block"></table></div><div><div id="gmail-m_-4875253864227967866gmail-:14q" style="font-size:0.875rem;direction:ltr;margin:8px 0px 0px;padding:0px"><div id="gmail-m_-4875253864227967866gmail-:13i" style="overflow:hidden;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:small;line-height:1.5"><div dir="ltr"><div><br></div><div>To enable fuzzing. First I build the library with the following libfuzzer flags.</div><div><b>-fsanitize=fuzzer-no-link,address -fsanitize-coverage=edge,indirect-calls</b><br></div><div>I also had to make a blacklist to avoid some buffer overflow and use after free error during this build.<br></div><div><br></div><div>After this, I link the fuzz target with the library and use the following libfuzzer options.</div><div><b>-fsanitize=fuzzer,address</b><br></div><div><b><br></b></div><div>I am looking for some guidance and feedback if this is the right way to go about fuzzing the library and the meaning of <b>uninitialized fixing it </b>line in the log.</div></div></div></div></div></div></div></div></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Live long and Prosper,</div><div><br></div><div>Shikhar Singh</div></div></div></div>