[PATCH] Use arc4random() to permutate talloc_magic number

Timur I. Bakeyev timur at freebsd.org
Wed Feb 14 02:59:11 UTC 2018


Hi!

I've noticed that talloc testsuite fails on FreeBSD cause talloc_magic is
always a predictable number, derived from the function address of the
loaded library, which is unfortunately always the same(contrary to OpenBSD,
for example). The existing talloc code uses Linux/glibc specific calls to
obtaining random bytes to permutate talloc_magic. *BSD has their own set of
arc4*  functions that can provide cryptographically applicable PRNG.

So, this small patch adds support for the usage of arc4random() to obtain
random talloc_magic signature per invocation.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Use-arc4random-to-permutate-talloc_magic-number.patch
Type: application/octet-stream
Size: 1547 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20180214/a741f16f/0001-Use-arc4random-to-permutate-talloc_magic-number.obj>


More information about the samba-technical mailing list