Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932192AbbG1LiL (ORCPT ); Tue, 28 Jul 2015 07:38:11 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:35229 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755362AbbG1LiJ (ORCPT ); Tue, 28 Jul 2015 07:38:09 -0400 Message-ID: <1438083484.20182.43.camel@edumazet-glaptop2.roam.corp.google.com> Subject: Re: [PATCH] packet: tpacket_snd(): fix signed/unsigned comparison From: Eric Dumazet To: Daniel Borkmann Cc: Alexander Drozdov , "David S. Miller" , Daniel Borkmann , Eric Dumazet , Willem de Bruijn , Al Viro , Eyal Birger , "Michael S. Tsirkin" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 28 Jul 2015 13:38:04 +0200 In-Reply-To: <55B76256.2040105@iogearbox.net> References: <1438081021-1321-1-git-send-email-al.drozdov@gmail.com> <55B76256.2040105@iogearbox.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 972 Lines: 28 On Tue, 2015-07-28 at 13:07 +0200, Daniel Borkmann wrote: > 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 > -- Fixes: 52f1454f629fa ("packet: allow to transmit +4 byte in TX_RING slot for VLAN case") -- 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/