I am not clear from the context in this patch where the canaries normally come form on Windows. It looks like it is trying to use the Windows crypto provider instead of /dev/urandom? Is that correct? Or was it failing to access /dev/urandom because it didn't exist, and then using something else?
What is this patch applying to? gcc or binutils?
Trac: Summary: SSP may not applied to Windows TBB? to Make SSP use Windows-specifc RNG
It looks like it is trying to use the Windows crypto provider instead of /dev/urandom? Is that correct?
Yes.
What is this patch applying to? gcc or binutils?
GCC.
In Windows you can to create any directories for any disks(C:, D:, .. Z:), only system directories (Windows directory, Program files, etc) are protected. Any process with privileges of any standard user can to create C:\dev\urandom file and to fill it by any stuff.
Jacek looked at it (http://sourceforge.net/p/mingw-w64/mailman/message/33344781/) and made some suggestions which seemed reasonable and indicated that he thinks the patch is doing what it promises but could be enhanced. On the other hand he claimed to have not much knowledge about GCC/libssp and pointed to the gcc-patches mailing list (which I try next).
The patch got merged into GCC trunk as 19fef1633156a2c7ddd267b43d08f1b245a6e1f4. Commit d4950e565f93396ebbd310c71e49576af9224d25 contains the proper backport for our use case.
Trac: Status: needs_review to closed Resolution: N/Ato fixed