From f9d3880b37e3280e085e2917b8b5893cd9ae3bc9 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Tue, 24 Feb 2004 18:01:26 -0800 Subject: [PATCH] [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. --- fs/compat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/compat.c b/fs/compat.c index 626d8d3e06fa4..2c6a61a457e94 100644 --- a/fs/compat.c +++ b/fs/compat.c @@ -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); -- 2.53.0