Hello, I am wondering if there is a generic automatic method to add ioctl value to the wrapper. For the documentation, there is PRE and POST to create : https://valgrind.org/docs/manual/dist.readme-missing.html But having a list of ioctl value in this format : #define my_ioctl "0x656460" Is there a way to include them, to have them automatically added in the list of wrappers? How to avoid to create a PRE / POST method for all my new ioctls ? Regards, Frédéric
I wish that this could be automated! The first thing that you can do is use the lax ioctl simhint (--sim-hints=lax-ioctls). If you do that then Valgrind won't complain at all about unhandled ioctls. The second thing that you can do is to make sure that your ioctl has size and direction (or no direction and a size of 0). You can do that using the _IOR _IOW and _IORW macros in asm-generic/ioctl.h. That only covers the call to the ioctl. Then there is the state of the memory that the ioctl refers to. The ioctl encoding gives only a basic indication of what kinds of memory accesses to expect. Often there will be mutilple levels of indirection, numerous subcodes etc. Without all the details Memcheck won't know which memory ranges become initialized by ioctls that write to user memory. That could result in false positive "Conditional jump or move" errors.