<div dir="ltr"><div class="gmail_extra"><div>On Tue, Aug 12, 2014 at 10:35 PM,  <span dir="ltr">&lt;<a href="mailto:Valdis.Kletnieks@vt.edu" target="_blank">Valdis.Kletnieks@vt.edu</a>&gt;</span> wrote:<br></div><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Tue, 12 Aug 2014 23:24:32 -0400, Nicholas Krause said:<br>
&gt; This patch checks if we are getting a Null allocated skb in the while/do<br>
&gt; loop of this function.<br>
</div><div class="">&gt;               skb  = dev_alloc_skb(frag_length + 4);<br>
&gt; +             if (skb == NULL) {<br>
&gt; +                     rt_status =  false;<br>
&gt; +                     break;<br>
&gt; +             }<br>
<br>
</div>Nick, it&#39;s *STILL* wrong.  And although I admit I blew it on the refcount<br>
issue, that doesn&#39;t change the fact that you&#39;re still leaking memory here.<br>
<br>
Work this through.  Hand simulate it.  Pretend that 3 fragments are<br>
needed, and that the first two succeed but the third one fails.<br>
<br>
Who frees the first two fragments before you return?<br>
<br>
For bonus points - explain under what conditions this bug can *possibly*<br>
be triggered on an actual system.  Consider in your reply both (a) when this<br>
code is called and (b) what the system state *should* be at that point, and<br>
what it has to be for this bug to trigger.  Given your answer to (a) and (b),<br>
extrapolate to what the next few hundredths of a second likely hold for<br>
this system even after we&#39;ve fixed the bug you&#39;re mis-fixing here.<br>
<br>
Once you&#39;ve done that, you&#39;ll hopefully understand why you&#39;re trying to fix<br>
a bug from 2009.<br>
<br></blockquote><div><br></div><div>And it may also be a good idea to post the logs regarding how you tested your patch and verified that the fix works as expected. As you are asking someone else to send the patch on behalf of you, anyone who volunteers would like to verify that the patch is indeed tested properly before forwarding.</div>

<div><br></div><div>Thanks -</div><div>Manish</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br></div></div>