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] [day] [month] [year] [list]
Message-ID: <20190425092245.GV2654@lahna.fi.intel.com>
Date:   Thu, 25 Apr 2019 12:22:45 +0300
From:   Mika Westerberg <mika.westerberg@...ux.intel.com>
To:     Nathan Chancellor <natechancellor@...il.com>
Cc:     Nick Desaulniers <ndesaulniers@...gle.com>,
        Andreas Noever <andreas.noever@...il.com>,
        Michael Jamet <michael.jamet@...el.com>,
        Yehezkel Bernat <YehezkelShB@...il.com>,
        LKML <linux-kernel@...r.kernel.org>,
        clang-built-linux@...glegroups.com
Subject: Re: [PATCH] thunderbolt: Make priority unsigned in struct tb_path

On Wed, Apr 24, 2019 at 12:00:05PM -0700, Nathan Chancellor wrote:
> On Wed, Apr 24, 2019 at 11:49:37AM -0700, Nick Desaulniers wrote:
> > On Wed, Apr 24, 2019 at 11:34 AM Nathan Chancellor
> > <natechancellor@...il.com> wrote:
> > >
> > > Clang warns:
> > >
> > > drivers/thunderbolt/tunnel.c:504:17: warning: implicit truncation from
> > > 'int' to bit-field changes value from 5 to -3
> > > [-Wbitfield-constant-conversion]
> > >         path->priority = 5;
> > >                        ^ ~
> > > 1 warning generated.
> > >
> > > The priority member in struct tb_path is only ever assigned a positive
> > > number:
> > >
> > > $ rg -n priority drivers/thunderbolt/path.c
> > > drivers/thunderbolt/tunnel.c:99:        path->priority = 3;
> > > drivers/thunderbolt/tunnel.c:308:       path->priority = 2;
> > > drivers/thunderbolt/tunnel.c:323:       path->priority = 1;
> > > drivers/thunderbolt/tunnel.c:504:       path->priority = 5;
> > 
> > LGTM.  Looks like drivers/thunderbolt/tb_regs.h also defines it as u32
> > (no change needed here).
> > Triple checking it's uses, looks like it gets assigned:
> > drivers/thunderbolt/path.c#L492:
> > hop.priority = path->priority;
> > hop is an instance of a struct tb_regs_hop, which is the definition I
> > was looking at above.  LGTM thanks Nathan!
> > Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
> 
> Thanks for the review!
> 
> > 
> > >
> > > Furthmore, that value is only assigned to an unsigned integer in
> 
> Although apparently I can't spell... should be "Furthermore".

Fixed the typo and applied to thunderbolt.git/next, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ