https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192238
Bug ID: 192238 Summary: rtld-elf should use powerof2(); nmaskwords must not be zero Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: Needs Triage Severity: Affects Only Me Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: conrad.me...@isilon.com >From DT_GNU_HASH parsing: ========================================================== /* Number of bitmask words is required to be power of 2 */ nmw_power2 = ((nmaskwords & (nmaskwords - 1)) == 0); obj->maskwords_bm_gnu = nmaskwords - 1; ... obj->valid_hash_gnu = nmw_power2 && obj->nbuckets_gnu > 0 && obj->buckets_gnu != NULL; ========================================================== The nmw_power2 statement can be rewritten using the powerof2() macro from sys/param.h: nmw_power2 = powerof2(nmaskwords); And valid_hash_gnu should probably include '&& nmaskwords > 0' (see underflow in obj->maskwords_bm_gnu if nmaskwords is less than 1). I may eventually get around to attaching a patch, but this isn't a priority for us (just something that came up reviewing a similar change to the kernel linker, which will end up on bugzilla sometime soon). -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"