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: <20181213131502.74be6f80@xeon-e3>
Date:   Thu, 13 Dec 2018 13:15:02 -0800
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Leon Romanovsky <leonro@...lanox.com>
Cc:     David Ahern <dsahern@...il.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [iproute] rdma broken on 32 bit

On Tue, 11 Dec 2018 17:33:19 +0000
Leon Romanovsky <leonro@...lanox.com> wrote:

> On Mon, Dec 10, 2018 at 02:10:20PM -0800, Stephen Hemminger wrote:
> > It appears that RDMA is broken on 32 bit platforms.
> > Sure you don't run on 32bit, but iproute2 needs to build everywhere.
> >
> > The issue is that  you are assuming a C enum can hold 64 bits.
> > The standard says enum only has to hold "int" values.
> > So it breaks on 32bit.
> >
> > The issue is deeper than just a trivial fix. Please either change iproute
> > config script to not build RDMA if sizeof(enum) < 64 or fix the code to
> > use a safe value like uint64_t.
> >
> > rdma
> >     CC       rdma.o
> >     CC       utils.o
> >     CC       dev.o
> >     CC       link.o
> > In file included from rdma.h:26:0,
> >                  from dev.c:12:
> > dev.c: In function ‘dev_caps_to_str’:
> > ../include/utils.h:269:38: warning: left shift count >= width of type [-Wshift-count-overflow]
> >  #define BIT(nr)                 (1UL << (nr))
> >                                       ^
> > rdma.h:32:61: note: in expansion of macro ‘BIT’
> >  #define RDMA_BITMAP_ENUM(name, bit_no) RDMA_BITMAP_##name = BIT(bit_no),
> >                                                              ^~~
> > If you wade through the macro swamp:
> > dev.c
> > #define RDMA_DEV_FLAGS(x) \
> >
> > 	x(SG_GAPS_REG, 32) \
> >
> > 	enum { RDMA_DEV_FLAGS(RDMA_BITMAP_ENUM) };
> >
> > Expands to:
> > 	enum {
> > 		RDMA_BITMAP_SG_GAPS_REG = (1UL << (32)),
> > 	};
> >  
> 
> Thanks for the report, I reproduced and will do my best to send patches tomorrow.

Thanks for fixing it so fast. Applied your fix

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ