Commit f9d3880b authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Run 32bit compat ioctl handlers in BKL

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.
parent 047379fb
......@@ -406,9 +406,11 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, unsigned lon
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment