Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755151AbbG1LHO (ORCPT ); Tue, 28 Jul 2015 07:07:14 -0400 Received: from www62.your-server.de ([213.133.104.62]:39523 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366AbbG1LHM (ORCPT ); Tue, 28 Jul 2015 07:07:12 -0400 Message-ID: <55B76256.2040105@iogearbox.net> Date: Tue, 28 Jul 2015 13:07:02 +0200 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Alexander Drozdov , "David S. Miller" , Daniel Borkmann CC: Eric Dumazet , Willem de Bruijn , Al Viro , Eyal Birger , "Michael S. Tsirkin" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] packet: tpacket_snd(): fix signed/unsigned comparison References: <1438081021-1321-1-git-send-email-al.drozdov@gmail.com> In-Reply-To: <1438081021-1321-1-git-send-email-al.drozdov@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 783 Lines: 22 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 Looks good to me, thanks! Acked-by: Daniel Borkmann -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/