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]
Date:   Sat, 19 Nov 2016 22:12:15 -0500 (EST)
From:   David Miller <davem@...emloft.net>
To:     adobriyan@...il.com
Cc:     netdev@...r.kernel.org
Subject: Re: [PATCH] net: fix bogus cast in skb_pagelen() and use unsigned
 variables

From: Alexey Dobriyan <adobriyan@...il.com>
Date: Sat, 19 Nov 2016 04:08:08 +0300

> 1) cast to "int" is unnecessary:
>    u8 will be promoted to int before decrementing,
>    small positive numbers fit into "int", so their values won't be changed
>    during promotion.
> 
>    Once everything is int including loop counters, signedness doesn't
>    matter: 32-bit operations will stay 32-bit operations.
> 
>    But! Someone tried to make this loop smart by making everything of
>    the same type apparently in an attempt to optimise it.
>    Do the optimization, just differently.
>    Do the cast where it matters. :^)
> 
> 2) frag size is unsigned entity and sum of fragments sizes is also
>    unsigned.
> 
> Make everything unsigned, leave no MOVSX instruction behind.
 ...
> Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>

Applied to net-next.

Powered by blists - more mailing lists