alobbs / macchanger

GNU MAC Changer

Home Page:http://www.gnu.org/software/macchanger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

failing to read random data, causing address to never change

lucianposton opened this issue · comments

The code that reads random data doesn't check read() errors causing the rand seed to be initialized with non-random data. This caused macchanger to set the address to the same value repeatedly.

This is particularly bad if you happen to have a /dev/hwrng that doesn't have a backing driver. In this case, open(/dev/hwrng) will always succeed, and read will always fail. I used the following patch to disable using /dev/hwrng since, in addition to not checking error codes, it is incorrectly using /dev/hwrng. See https://www.kernel.org/doc/Documentation/hw_random.txt

https://github.com/lucianposton/gentoo-patches/blob/master/net-analyzer/macchanger/0001-don-t-use-hwrng.patch