[alsa-devel] [PATCH 04/39] ALSA: seq: copy ioctl data from user space to kernel stack

Clemens Ladisch clemens at ladisch.de
Sun Aug 7 12:15:02 CEST 2016


Takashi Sakamoto wrote:
> Data from user space is once copied to kernel stack, then operated and
> copied to user space, in a consistent manner. This manner forces all ioctl
> operations to copy the data from/to user space, even if it's read-only or
> write-only. Thus, it has an overhead for simpler ioctl commands.

The ioctl code itself already contains information about the direction
and size of the data to be copied (and in theory, these values are
correct).  See dispatch_ioctl() in drivers/firewire/core-cdev.c for an
example.


Regards,
Clemens


More information about the Alsa-devel mailing list