lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20111020.170326.2193877307745965380.davem@davemloft.net>
Date:	Thu, 20 Oct 2011 17:03:26 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	eric.dumazet@...il.com
Cc:	gallatin@...i.com, mason@...i.com, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] myri10ge: fix truesize underestimation

From: Eric Dumazet <eric.dumazet@...il.com>
Date: Thu, 20 Oct 2011 22:59:16 +0200

> Le jeudi 20 octobre 2011 à 16:45 -0400, Andrew Gallatin a écrit :
>> On 10/20/11 16:44, Eric Dumazet wrote:
>> > Le jeudi 20 octobre 2011 à 15:33 -0500, Jon Mason a écrit :
>> >> On Thu, Oct 20, 2011 at 3:10 PM, Eric Dumazet<eric.dumazet@...il.com>  wrote:
>> >>> skb->truesize must account for allocated memory, not the used part of
>> >>> it. Doing this work is important to avoid unexpected OOM situations.
>> >>>
>> >>> Signed-off-by: Eric Dumazet<eric.dumazet@...il.com>
>> >>
>> >> Acked-by: Jon Mason<mason@...i.com>
>> >
>> > Thanks for reviewing Jon !
>> >
>> >
>> 
>> Please wait a second..  I think the patch is incorrect.
>> 
>> There is already code in myri10ge_rx_skb_build() which
>> attempts to set the truesize.  However, it sets it to
>> the used, rather than the allocated size so it is apparently
>> incorrect.
>> 
>> I'd prefer we fix that code.
> 
> Well, I believe I did exactly that :)
> 
> truesize of initial skb is fine.
> 
> Then for everay frag added, you must add to skb-truesize the allocated
> memory for this frag.
> 
> You add frags of a given size (small or big)
> 
> In the end, its truesize += bytes * number_of_frags
> 
> (bytes being small_size or big_size)

Right, I believe Eric's patch is correct, and I intend to apply it.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ