<div dir="ltr"><div><div><div>Hi,<br><br></div>  I am working on a patch on the vboxnetflt kernel module on Linux (3.18.0 kernel).<br></div>While inspecting the code of vboxnetlflt, I found something that looks to me like a buffer overflow.<br><br>VBoxNetFltInternal.h declares the structure VBOXNETFLTINS<br></div>and one of its members is: <br><pre>char szName[1];<br></pre><pre><span style="font-family:arial,helvetica,sans-serif">This array is too small to contain the network device name:<br></span></pre><pre><span style="font-family:arial,helvetica,sans-serif">so when there is a copy in VBoxNetFlt.c:<br></span><br>    memcpy(pNew->szName, pszName, cchName + 1);<br><br></pre><pre><span style="font-family:arial,helvetica,sans-serif">this copy does a buffer overflow of the character array pNew->szName.<br><br></span></pre><pre><span style="font-family:arial,helvetica,sans-serif">Basically you are trying to copy a string like 'eno1'<br></span></pre><pre><span style="font-family:arial,helvetica,sans-serif">or another interface name, into a buffer of chars with length 1.<br></span></pre><pre><span style="font-family:arial,helvetica,sans-serif">Obviously this implies a buffer overflow.<br></span></pre><pre><span style="font-family:arial,helvetica,sans-serif">Thank for your attention,<br><br></span></pre><pre><span style="font-family:arial,helvetica,sans-serif">  Valerio Daelli<br></span></pre><pre><br></pre></div>