]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Run 32bit compat ioctl handlers in BKL
authorAndi Kleen <ak@suse.de>
Wed, 25 Feb 2004 02:01:26 +0000 (18:01 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 25 Feb 2004 02:01:26 +0000 (18:01 -0800)
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.

fs/compat.c

index 626d8d3e06fa4bdca156d5cd7cdfc83629355489..2c6a61a457e94ef2e769947b1f15bb538a718cd9 100644 (file)
@@ -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);