<div dir="ltr">Clang-tidy is a good start. By writing one simple check you can learn about AST</div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-04 9:17 GMT+01:00 Daniel Marjamäki via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div>Hello!</div>
<div><br>
</div>
<div>I personally think that if you only have 1 month then that is very little time. Sorry but I personally don't think it's realistic to first learn Clang and then implement and commit a new analysis framework in that time.</div>
<div><br>
</div>
<div>I suggest you try to limit the scope. Learn Clang and use existing framework to develop a new small check or tweak some existing check.</div>
<div><br>
</div>
<div>You don't need to worry about LLVM IR at all. There are many utility classes like StringRef,SmallSet,etc... but I suggest you focus on the analysis. You can spend a lot of time looking around at utility classes and learning all details about the framework.. and
getting no work done.</div>
<div><br>
</div>
<div>Good luck!!</div>
<div><br>
</div>
<div>Best regards,</div>
<div>Daniel Marjamäki<br>
</div>
<div><br>
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<p class="MsoNormal" style="margin:0cm 0cm 0pt"><span style="font-family:'Arial','sans-serif';color:gray;font-size:8pt">..............................<wbr>..............................<wbr>..............................<wbr>........................</span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0pt"><span style="font-family:'Arial','sans-serif';color:black;font-size:8pt">Daniel Marjamäki
</span><span style="font-family:'Arial','sans-serif';color:gray;font-size:8pt">Senior Engineer</span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:'Arial','sans-serif';color:gray;font-size:8.5pt">Evidente ES East</span><span lang="EN-US" style="font-family:'Arial','sans-serif';color:gray;font-size:8pt"> AB<span>
</span>Warfvinges väg 34<span> </span>SE-112 51 Stockholm<span> </span>Sweden </span>
</p>
<p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:'Arial','sans-serif';color:gray;font-size:8pt"></span> </p>
<p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-GB" style="font-family:'Arial','sans-serif';color:gray;font-size:8pt">Mobile</span><span lang="EN-GB" style="font-family:'Arial','sans-serif';color:gray;font-size:8pt">:<span>
</span>+46 (0)709 12 42 62</span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-GB" style="font-family:'Arial','sans-serif';color:gray;font-size:8pt"></span><span lang="EN-GB" style="font-family:'Arial','sans-serif';color:gray;font-size:8pt">E-mail:<span>
</span><span> <a href="mailto:Daniel.Marjamaki@evidente.se" target="_blank">
Daniel.Marjamaki</a></span><a href="mailto:Daniel.Marjamaki@evidente.se" target="_blank">@evidente.se</a><span> <wbr>
</span><span> </span></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-GB" style="font-family:'Arial','sans-serif';color:gray;font-size:8pt"></span> </p>
<p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-GB" style="font-family:'Arial','sans-serif';font-size:8pt"><a href="http://www.evidente.se" target="_blank">www.evidente.se</a></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div id="m_4350848668565870126divRpF299017" style="direction:ltr"><font color="#000000" face="Tahoma" size="2"><b>From:</b> cfe-dev [<a href="mailto:cfe-dev-bounces@lists.llvm.org" target="_blank">cfe-dev-bounces@lists.llvm.<wbr>org</a>] on behalf of Muhui Jiang via cfe-dev [<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>]<br>
<b>Sent:</b> 04 January 2017 03:21<br>
<b>To:</b> Mads Ravn<br>
<b>Cc:</b> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<b>Subject:</b> Re: [cfe-dev] Static taint analysis<br>
</font><br>
</div><div><div class="h5">
<div></div>
<div>
<div dir="ltr">Hi Mads
<div><br>
</div>
<div>Thanks. I made the decision to develop the tool in Clang. I never used Clang before. The only thing I know is that clang is the frontend of llvm. I also watched the tutorial for write a checker in 24hours in clang and had a basic understanding now. Do
you have any suggestions to me. Do I need to understand llvm IR or other thing related to llvm before using clang. Many Thanks</div>
<div><br>
</div>
<div>Regards</div>
<div>Muhui</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2017-01-02 3:12 GMT+08:00 Mads Ravn <span dir="ltr"><<a href="mailto:madsravn@gmail.com" target="_blank">madsravn@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Muhui,
<div><br>
</div>
<div>I am not sure how much of these static analysis are already present in Clang, but I'm sure you can develop them here. I would look into the files and directories I mentioned in my previous mail. I can't say how hard it will be to implement. There is also
a IRC channel, if you want a more flowing conversation about the subject.</div>
<div><br>
</div>
<div>Best regards,</div>
<div>Mads Ravn</div>
</div>
<div class="m_4350848668565870126HOEnZb">
<div class="m_4350848668565870126h5"><br>
<div class="gmail_quote">
<div dir="ltr">On Sun, Jan 1, 2017 at 9:06 AM Muhui Jiang <<a href="mailto:jiangmuhui@gmail.com" target="_blank">jiangmuhui@gmail.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg" dir="ltr">Hi Mads
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg"><br class="m_4350848668565870126m_-1762182652399387206gmail_msg">
</div>
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg">Thanks for your reply. Actually, I am completely new to clang. I know the theory of program analysis and I tried to find a powerful tool to carry out static analysis for my research. I need taint propagation,field
sensitive, context sensitive,flow sensitive with implicit and explicit flows and pointer analysis. I think Clang should be available to develop such a tool. I am familiar with C, C++ linux programming. There are about one month left for me. Do you have any
suggestions and do you have any comments on the difficulty of implementation. Many Thanks</div>
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg"><br class="m_4350848668565870126m_-1762182652399387206gmail_msg">
</div>
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg">Regards</div>
</div>
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg" dir="ltr">
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg">Muhui</div>
</div>
<div class="gmail_extra m_4350848668565870126m_-1762182652399387206gmail_msg"><br class="m_4350848668565870126m_-1762182652399387206gmail_msg">
<div class="gmail_quote m_4350848668565870126m_-1762182652399387206gmail_msg">2016-12-31 6:48 GMT+08:00 Mads Ravn
<span class="m_4350848668565870126m_-1762182652399387206gmail_msg" dir="ltr"><<a class="m_4350848668565870126m_-1762182652399387206gmail_msg" href="mailto:madsravn@gmail.com" target="_blank">madsravn@gmail.com</a>></span>:<br class="m_4350848668565870126m_-1762182652399387206gmail_msg">
<blockquote class="gmail_quote m_4350848668565870126m_-1762182652399387206gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg" dir="ltr">Hi Muhui,
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg"><br class="m_4350848668565870126m_-1762182652399387206gmail_msg">
</div>
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg">It looks like clang has some kind of taint analysis already. I don't know if it fits your purpose. But have a look at DivZeroChecker.cpp and GenericTaintChecker.cpp in clang. There are also other files.</div>
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg"><br class="m_4350848668565870126m_-1762182652399387206gmail_msg">
</div>
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg">If these do not fit your purpose, I think you should be able to construct your own. If you have any questions about how to do this, please also elaborate on your experience with clang. It's much easier to guide you
in the right direction, if we know your current level.</div>
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg"><br class="m_4350848668565870126m_-1762182652399387206gmail_msg">
</div>
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg">Best regards,</div>
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg">Mads Ravn</div>
</div>
<br class="m_4350848668565870126m_-1762182652399387206gmail_msg">
<div class="gmail_quote m_4350848668565870126m_-1762182652399387206gmail_msg">
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg">
<div class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659h5 m_4350848668565870126m_-1762182652399387206gmail_msg">
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg" dir="ltr">On Fri, Dec 30, 2016 at 9:46 PM Muhui Jiang via cfe-dev <<a class="m_4350848668565870126m_-1762182652399387206gmail_msg" href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br class="m_4350848668565870126m_-1762182652399387206gmail_msg">
</div>
</div>
</div>
<blockquote class="gmail_quote m_4350848668565870126m_-1762182652399387206gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="m_4350848668565870126m_-1762182652399387206gmail_msg">
<div class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659h5 m_4350848668565870126m_-1762182652399387206gmail_msg">
Hi
<div class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659m_6786224778097200963gmail_msg m_4350848668565870126m_-1762182652399387206gmail_msg">
<br class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659m_6786224778097200963gmail_msg m_4350848668565870126m_-1762182652399387206gmail_msg">
</div>
<div class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659m_6786224778097200963gmail_msg m_4350848668565870126m_-1762182652399387206gmail_msg">
I am trying to use clang analyzer to conduct static taint analysis on the Linux kernel. I am wondering whether clang has a static taint analysis framework or do I have to write a new one. If so, any suggestions or hints to write the static taint analysis tool.
Many thanks </div>
<div class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659m_6786224778097200963gmail_msg m_4350848668565870126m_-1762182652399387206gmail_msg">
<br class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659m_6786224778097200963gmail_msg m_4350848668565870126m_-1762182652399387206gmail_msg">
</div>
<div class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659m_6786224778097200963gmail_msg m_4350848668565870126m_-1762182652399387206gmail_msg">
Regards </div>
<div class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659m_6786224778097200963gmail_msg m_4350848668565870126m_-1762182652399387206gmail_msg">
Muhui</div>
</div>
</div>
______________________________<wbr>_________________<br class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659m_6786224778097200963gmail_msg m_4350848668565870126m_-1762182652399387206gmail_msg">
cfe-dev mailing list<br class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659m_6786224778097200963gmail_msg m_4350848668565870126m_-1762182652399387206gmail_msg">
<a class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659m_6786224778097200963gmail_msg m_4350848668565870126m_-1762182652399387206gmail_msg" href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659m_6786224778097200963gmail_msg m_4350848668565870126m_-1762182652399387206gmail_msg">
<a class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659m_6786224778097200963gmail_msg m_4350848668565870126m_-1762182652399387206gmail_msg" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br class="m_4350848668565870126m_-1762182652399387206m_-3628958544845335659m_6786224778097200963gmail_msg m_4350848668565870126m_-1762182652399387206gmail_msg">
</blockquote>
</div>
</blockquote>
</div>
<br class="m_4350848668565870126m_-1762182652399387206gmail_msg">
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div></div></div>
</div>
</div>
<br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>