_IOR should be _IOW for a few commands in lttng-modules ABI
Recently added commands are passing data from user-space to the kernel. According to Documentation/userspace-api/ioctl/ioctl-number.rst, this means:
_IO an ioctl with no parameters _IOW an ioctl with write parameters (copy_from_user) _IOR an ioctl with read parameters (copy_to_user) _IOWR an ioctl with both write and read parameters.
those should use _IOW, rather than _IOR. A quick review comes up with this list of offenders:
Another weird one is this:
Which takes a int32_t as _IOR, which it receives by directly casting the argument as int32_t, rather than using it as a pointer as we could expect.
Fixing this without introducing an ABI break is non-trivial, because changing _IOR to _IOW really changes the ioctl number AFAIU. So we need to be smart about fixing this without introducing an ABI break.
Updated by Mathieu Desnoyers 15 days ago
Fixed by commit (only in master branch, in time for 2.13-rc1):
commit 8c71721f7a868b575b05e24bc3a3dcc967e6d5d6 Author: Mathieu Desnoyers <email@example.com> Date: Tue Apr 20 11:05:19 2021 -0400 Fix: LTTng-modules ABI ioctl wrong direction