Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/gpu/drm/amd/amdkfd: use in_compat_syscall to check open() caller type

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>

authored by

Andy Lutomirski and committed by
Linus Torvalds
10f1685f 4f01ed22

+2 -2
+1 -1
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
··· 107 107 if (iminor(inode) != 0) 108 108 return -ENODEV; 109 109 110 - is_32bit_user_mode = is_compat_task(); 110 + is_32bit_user_mode = in_compat_syscall(); 111 111 112 112 if (is_32bit_user_mode == true) { 113 113 dev_warn(kfd_device,
+1 -1
drivers/gpu/drm/amd/amdkfd/kfd_process.c
··· 311 311 goto err_process_pqm_init; 312 312 313 313 /* init process apertures*/ 314 - process->is_32bit_user_mode = is_compat_task(); 314 + process->is_32bit_user_mode = in_compat_syscall(); 315 315 if (kfd_init_apertures(process) != 0) 316 316 goto err_init_apretures; 317 317