Give 32bit emulation ioctl handlers the same locking rules as normal ioctl handlers.
This will avoid surprises in driver code.
Most call sys_ioctl who would take it anyways.
while (t && t->cmd != cmd)
t = (struct ioctl_trans *)t->next;
if (t) {
- if (t->handler)
+ if (t->handler) {
+ lock_kernel();
error = t->handler(fd, cmd, arg, filp);
- else
+ unlock_kernel();
+ } else
error = sys_ioctl(fd, cmd, arg);
} else if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
error = siocdevprivate_ioctl(fd, cmd, arg);