drivers/gpu/drm/amd/amdkfd: use in_compat_syscall to check open() caller type
authorAndy Lutomirski <luto@kernel.org>
Tue, 22 Mar 2016 21:25:19 +0000 (14:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Mar 2016 22:36:02 +0000 (15:36 -0700)
amdkfd wants to know syscall type, not task type.  Check directly.

Unfortunately, amdkfd is making nasty assumptions that a process'
bitness is a well-defined constant thing.  This isn't the case on x86.
I don't know how much this matters, but this patch has no effect on
generated code on x86, so amdkfd is equally broken with and without this
patch.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Oded Gabbay <oded.gabbay@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
drivers/gpu/drm/amd/amdkfd/kfd_process.c

index d2b49c026cf685a92dbb57b203f5ecdc04cfb653..07ac724e3ec909102c22d0fc47ce4be19c8606ab 100644 (file)
@@ -107,7 +107,7 @@ static int kfd_open(struct inode *inode, struct file *filep)
        if (iminor(inode) != 0)
                return -ENODEV;
 
-       is_32bit_user_mode = is_compat_task();
+       is_32bit_user_mode = in_compat_syscall();
 
        if (is_32bit_user_mode == true) {
                dev_warn(kfd_device,
index a902ae037398389cf6e19c1ab7379ca64e6a46ed..ac005796b71c1491fb509bc3705b6e5f5c75442a 100644 (file)
@@ -311,7 +311,7 @@ static struct kfd_process *create_process(const struct task_struct *thread)
                goto err_process_pqm_init;
 
        /* init process apertures*/
-       process->is_32bit_user_mode = is_compat_task();
+       process->is_32bit_user_mode = in_compat_syscall();
        if (kfd_init_apertures(process) != 0)
                goto err_init_apretures;