SUMMARY Solaris did remove /dev/crypto framework in 2018. Reason being that more recent sparc systems (>= Sparc T4) have the crypto instructions available to non-privileged code, so kernel driver is no longer necessary. Even though the code was removed, the header with corresponding structures and definitions remained on System. Now Solaris removes the headers (/usr/include/sys/crypto/ioctl.h) and so valgrind fails to compile. STEPS TO REPRODUCE 1. Compile valgrind on Solaris >= b211 which corresponds to (not yet released) SRU90. OBSERVED RESULT In file included from /scratch/ulhg/jenkins-nightly-on-nightly/components/valgrind/valgrind-3.24.0/include/pub_tool_vki.h:53, from pub_core_vki.h:42, from m_debuglog.c:58: /scratch/ulhg/jenkins-nightly-on-nightly/components/valgrind/valgrind-3.24.0/include/vki/vki-solaris.h:338:10: fatal error: sys/crypto/ioctl.h: No such file or directory 338 | #include <sys/crypto/ioctl.h> | ^~~~~~~~~~~~~~~~~~~~ compilation terminated. EXPECTED RESULT Valgrind should compile SOFTWARE/OS VERSIONS Solaris: SRU 90 ADDITIONAL INFORMATION Even though valgrind did compile just fine, since 2018 it is not possible to use the /dev/crypto framework so the code in valgrind can not be executed too.
Created attachment 186921 [details] Patch to compile The patch was generated against valgrind 3.24 which we currently have, but I have verified that it applies to 3.26 too. I have manually edited the test results, but because the tests do not run very cleanly on Solaris I couldn't verify them. Thank you for valgrind
Valgrind does not run on SPARC systems. Goes this patch do anything for amd64? How can I test this? I do have a Solaris 11.4 amd64 VM somewhere, which is as up to date as I can get without a support contract.
Hi, thank you for getting back to me. Correct, we do not have valgrind on sparc (sadly). You can test it by removing /usr/include/sys/crypto/ioctl.h and trying to compile valgrind. That ioctl.h was removed only recently, so it will take some time before the change appears even at paying customers machines. However my patch is safe to apply even now. The sys/crypto/ioctl.h delivers some definitions and structures, but no one is using them. The crypto functionality was removed during 2018, now we are removing just the unused header files. I have updated valgrind which is being built for Solaris to 3.26 and updated the patch accordingly. You can see that we are using the patch too here: https://github.com/oracle/solaris-userland/commit/fb09518777dae7f67de40689a7bb51e1be4f73f2 . Latest free release available is the CBE release 11.4.81 at https://www.oracle.com/solaris/solaris11/downloads/solaris-downloads.html . It requires oracle account though (even though it is free). And you must have ksh and run ugly script (sigh). And it does not work on Linux as I just tried (more sigh). But if you run it it will create IPS repo from which you can update Solaris to fairly recent build. Longer story follows. Back in time Sun Microsystems did release T1 (codename Niagara) which had hardware support for cryptography. There was big BUT, the instructions for that were limited to priviledged space only, meaning only kernel was able to run them. So Solaris gained new driver called 'crypto' though which applications were able to use it. And new syscalls. Because one had to pass data between userspace and kernel it was slow. So eventually T4 came which allowed to call crypto functions directly from user space. Wikipedia says 2005. Since then we do not need the crypto kernel module and syscalls. Originally we thought we could use the crypto module for all kinds of crypto work (even on x86) but in reality this never happened. So during 2018 the crypto framework was removed and about a month ago colleague of mine did some cleanup and removed the headers. Which in turn broke valgrind build which is why I got involved and learned about the whole history :) It could be argued that old Solaris 10 installations still have the crypto functionality (S10 is 20 years old too ...). We could make autotools detect the presence of /usr/include/sys/crypto/ioctl.h. If that is something you are more likely to accept I'm happy to go that route too. Personally I do not think that it is practical.
How does this affect illumos? I still see lrwxrwxrwx 1 root root 33 Apr 1 2025 /dev/crypto -> '../devices/pseudo/crypto@0:crypto' lrwxrwxrwx 1 root root 39 Apr 1 2025 /dev/cryptoadm -> '../devices/pseudo/cryptoadm@0:cryptoadm' plus the headers are all there, scalar_ioctl builds OK and the test passes. It's a bit more effort but what I'll do is 1. Add a configure check for sys/crypto/ioctl.h like HAVE_CRYPTO_IOCL 2. Put existing code in #ifdef HAVE_CRYPTO_IOCL blocks 2. Split scalar_crypto from scalar_ioctl FWIW I used Solaris for a long time (SPARC workstations from about 1997 to 2011, and a HP amd64 workstation at home from about 2004 to 2018. I still use illumos, mostly for Valgrind testing.
Thank you you are very kind. Of course I'm more than happy to test your change. It is a pity that Solaris didn't get fair chance at thriving...
Created attachment 187065 [details] Make ioctl crypto conditional Could you test this patch, please? It runs clean on illumos.