numam-dpdk/lib/librte_eal/common
Adrien Mazarguil 6b298c6285 eal: fix signed integers in fbarray
While debugging startup issues encountered with Clang (see "eal: fix
undefined behavior in fbarray"), I noticed that fbarray stores indices,
sizes and masks on signed integers involved in bitwise operations.

Such operations almost invariably cause undefined behavior with values that
cannot be represented by the result type, as is often the case with
bit-masks and left-shifts.

This patch replaces them with unsigned integers as a safety measure and
promotes a few internal variables to larger types for consistency.

Coverity issue: 272598, 272599
Fixes: c44d09811b ("eal: add shared indexed file-backed array")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-04-17 14:38:16 +02:00
..
arch align SPDX Mellanox copyrights 2018-04-11 01:47:47 +02:00
include eal: fix signed integers in fbarray 2018-04-17 14:38:16 +02:00
eal_common_bus.c convert snprintf to strlcpy 2018-04-04 17:33:08 +02:00
eal_common_cpuflags.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
eal_common_dev.c eal: add device event monitor framework 2018-04-13 12:00:31 +02:00
eal_common_devargs.c eal: use SPDX tags in 6WIND copyrighted files 2018-02-01 02:32:41 +01:00
eal_common_errno.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
eal_common_fbarray.c eal: fix signed integers in fbarray 2018-04-17 14:38:16 +02:00
eal_common_hexdump.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
eal_common_hypervisor.c align SPDX Mellanox copyrights 2018-04-11 01:47:47 +02:00
eal_common_launch.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
eal_common_lcore.c eal: provide API for querying valid socket ids 2018-04-05 00:27:13 +02:00
eal_common_log.c eal: register log type and pick level from args 2018-03-30 14:08:44 +02:00
eal_common_memalloc.c mem: add validator callback 2018-04-11 21:45:56 +02:00
eal_common_memory.c mem: add validator callback 2018-04-11 21:45:56 +02:00
eal_common_memzone.c malloc: enable memory hotplug support 2018-04-11 21:45:55 +02:00
eal_common_options.c mem: share hugepage info primary and secondary 2018-04-11 21:45:55 +02:00
eal_common_proc.c ipc: fix missing mutex unlocks on failed send 2018-04-17 10:23:05 +02:00
eal_common_string_fns.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
eal_common_tailqs.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
eal_common_thread.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
eal_common_timer.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
eal_filesystem.h mem: share hugepage info primary and secondary 2018-04-11 21:45:55 +02:00
eal_hugepages.h mem: share hugepage info primary and secondary 2018-04-11 21:45:55 +02:00
eal_internal_cfg.h mem: share hugepage info primary and secondary 2018-04-11 21:45:55 +02:00
eal_memalloc.h mem: add validator callback 2018-04-11 21:45:56 +02:00
eal_options.h eal: add single file segments option 2018-04-11 21:45:55 +02:00
eal_private.h eal: add device event monitor framework 2018-04-13 12:00:31 +02:00
eal_thread.h lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
Makefile eal: add shared indexed file-backed array 2018-04-11 19:55:21 +02:00
malloc_elem.c malloc: enable memory hotplug support 2018-04-11 21:45:55 +02:00
malloc_elem.h malloc: enable memory hotplug support 2018-04-11 21:45:55 +02:00
malloc_heap.c malloc: fix not unlocking hotplug on fail to init 2018-04-17 12:36:40 +02:00
malloc_heap.h malloc: enable memory hotplug support 2018-04-11 21:45:55 +02:00
malloc_mp.c malloc: support multiprocess memory hotplug 2018-04-11 21:45:55 +02:00
malloc_mp.h malloc: support multiprocess memory hotplug 2018-04-11 21:45:55 +02:00
meson.build malloc: support multiprocess memory hotplug 2018-04-11 21:45:55 +02:00
rte_keepalive.c keepalive: fix state alignment 2018-01-25 23:25:57 +01:00
rte_malloc.c malloc: enable memory hotplug support 2018-04-11 21:45:55 +02:00
rte_reciprocal.c eal: add u64-bit variant for reciprocal divide 2018-01-27 22:34:47 +01:00
rte_service.c add experimental tag to appropriate functions 2018-01-29 23:35:29 +01:00