<div class="gmail_quote">On Tue, Apr 27, 2010 at 11:20 AM, Ben Pfaff <span dir="ltr">&lt;<a href="mailto:blp@nicira.com">blp@nicira.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, Apr 27, 2010 at 11:08:48AM -0700, Jesse Gross wrote:<br>
&gt; There are some other places where we copy device names from userspace as<br>
&gt; well.  I don&#39;t think that any of them exhibit this bug with an unterminated<br>
&gt; string but they will happily truncate names and go with it.  I&#39;m thinking of<br>
&gt; various places in the vport library and things like querying ports.<br>
<br>
</div>If you point out other problematic cases I&#39;ll gladly fix them.<br>
<br>
A lot of port-related stuff goes through struct odp_port, which has an<br>
IFNAMSIZ-byte field for the name.  So it wouldn&#39;t be the kernel doing<br>
the truncating in that case.<br>
<br>
I only see one use of strncpy_from_user() in datapath.c.  That seems<br>
the most likely way to copy in a string other than through the<br>
odp_port struct.<br></blockquote><div><br></div><div>I skimmed through and you&#39;re right, most of them make userspace truncate.  However, there is one additional use of strncpy_from_user() in vport_del(), which has problems similar to the one in create_dp().</div>
</div>