lkml.org 
[lkml]   [2015]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] packet: tpacket_snd(): fix signed/unsigned comparison
On 07/28/2015 12:57 PM, Alexander Drozdov wrote:
> tpacket_fill_skb() can return a negative value (-errno) which
> is stored in tp_len variable. In that case the following
> condition will be (but shouldn't be) true:
>
> tp_len > dev->mtu + dev->hard_header_len
>
> as dev->mtu and dev->hard_header_len are both unsigned.
>
> That may lead to just returning an incorrect EMSGSIZE errno
> to the user.
>
> Signed-off-by: Alexander Drozdov <al.drozdov@gmail.com>

Looks good to me, thanks!

Acked-by: Daniel Borkmann <daniel@iogearbox.net>


\
 
 \ /
  Last update: 2015-07-28 13:21    [W:0.049 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site