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]
Message-ID: <20181211173315.GF3933@mtr-leonro.mtl.com>
Date:   Tue, 11 Dec 2018 17:33:19 +0000
From:   Leon Romanovsky <leonro@...lanox.com>
To:     Stephen Hemminger <stephen@...workplumber.org>
CC:     David Ahern <dsahern@...il.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [iproute] rdma broken on 32 bit

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.

Download attachment "signature.asc" of type "application/pgp-signature" (802 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ