Re: [PATCH] af_packet: check loop for greater than zero in tpacket_fill_skb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From: Daniel Borkmann <danborkmann@xxxxxxxxxxxxx>
Date: Sun, 10 Jun 2012 21:25:08 +0200

> It could be more safe to check the 'to_write' for 'greater than zero'
> instead for 'not zero'. 'to_write' is of type int and subtraction operations
> are performed on it, so in the case of malformed values that are
> subtracted from 'to_write', it could become less than zero, which is then
> interpreted as 'not zero' in the while condition, thus the loop won't
> return as expected.
> 
> Signed-off-by: Daniel Borkmann <daniel.borkmann@xxxxxxxxxxxxxx>

I hate this kind of change.

The implication is that there are bugs in the loop that can cause
the value to go negative.

Unless you can show that this actually happens, leave this clean
test alone.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Kernel Discussion]     [Ethernet Bridging]     [Linux Wireless Networking]     [Linux Bluetooth Networking]     [Linux Networking Users]     [VLAN]     [Git]     [IETF Annouce]     [Linux Assembly]     [Security]     [Bugtraq]     [Photo]     [Singles Social Networking]     [Yosemite Information]     [MIPS Linux]     [ARM Linux Kernel]     [ARM Linux]     [Linux Virtualization]     [Linux Security]     [Linux IDE]     [Linux RAID]     [Linux SCSI]     [Free Dating]

Add to Google Powered by Linux