Skip to content

Commit

Permalink
[PATCH] Run 32bit compat ioctl handlers in BKL
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Feb 25, 2004
1 parent 047379f commit f9d3880
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f9d3880

Please sign in to comment.