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  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:   Thu, 22 Oct 2020 08:43:46 +0000
From:   "Li, Ke" <>
To:     Eric Dumazet <>
CC:     netdev <>,
        David Miller <>,
        "Jakub Kicinski" <>, "" <>,
        "Li, Ji" <>
Subject: Re: [PATCH net v2] net: Properly typecast int values to set

Thank you, Eric!

Nice to know the recent change to wrap-at-100. Will this be reflected somewhere, like, in Documentation/process/coding-style.rst?


´╗┐On 10/22/20, 12:49 AM, "Eric Dumazet" <> wrote:

    On Thu, Oct 22, 2020 at 8:42 AM Ke Li <> wrote:
    > In setsockopt(SO_MAX_PACING_RATE) on 64bit systems, sk_max_pacing_rate,
    > after extended from 'u32' to 'unsigned long', takes unintentionally
    > hiked value whenever assigned from an 'int' value with MSB=1, due to
    > binary sign extension in promoting s32 to u64, e.g. 0x80000000 becomes
    > 0xFFFFFFFF80000000.
    > Thus inflated sk_max_pacing_rate causes subsequent getsockopt to return
    > ~0U unexpectedly. It may also result in increased pacing rate.
    > Fix by explicitly casting the 'int' value to 'unsigned int' before
    > assigning it to sk_max_pacing_rate, for zero extension to happen.
    > Fixes: 76a9ebe811fb ("net: extend sk_pacing_rate to unsigned long")
    > Signed-off-by: Ji Li <>
    > Signed-off-by: Ke Li <>
    > Cc: Eric Dumazet <>
    > ---
    > v2: wrap the line in net/core/filter.c to less than 80 chars.

    SGTM (the other version was also fine, the 80 chars rule has been
    relaxed/changed to 100 recently)

    Reviewed-by: Eric Dumazet <>

Powered by blists - more mailing lists