# git rev-parse -q --verify a4d63c3732f1a0c91abcf5b7f32b4ef7dcd82025^{commit} a4d63c3732f1a0c91abcf5b7f32b4ef7dcd82025 already have revision, skipping fetch # git checkout -q -f -B kisskb a4d63c3732f1a0c91abcf5b7f32b4ef7dcd82025 # git clean -qxdf # < git log -1 # commit a4d63c3732f1a0c91abcf5b7f32b4ef7dcd82025 # Author: Jason A. Donenfeld # Date: Mon Sep 28 12:35:07 2020 +0200 # # mm: do not rely on mm == current->mm in __get_user_pages_locked # # It seems likely this block was pasted from internal_get_user_pages_fast, # which is not passed an mm struct and therefore uses current's. But # __get_user_pages_locked is passed an explicit mm, and current->mm is not # always valid. This was hit when being called from i915, which uses: # # pin_user_pages_remote-> # __get_user_pages_remote-> # __gup_longterm_locked-> # __get_user_pages_locked # # Before, this would lead to an OOPS: # # BUG: kernel NULL pointer dereference, address: 0000000000000064 # #PF: supervisor write access in kernel mode # #PF: error_code(0x0002) - not-present page # CPU: 10 PID: 1431 Comm: kworker/u33:1 Tainted: P S U O 5.9.0-rc7+ #140 # Hardware name: LENOVO 20QTCTO1WW/20QTCTO1WW, BIOS N2OET47W (1.34 ) 08/06/2020 # Workqueue: i915-userptr-acquire __i915_gem_userptr_get_pages_worker [i915] # RIP: 0010:__get_user_pages_remote+0xd7/0x310 # Call Trace: # __i915_gem_userptr_get_pages_worker+0xc8/0x260 [i915] # process_one_work+0x1ca/0x390 # worker_thread+0x48/0x3c0 # kthread+0x114/0x130 # ret_from_fork+0x1f/0x30 # CR2: 0000000000000064 # # This commit fixes the problem by using the mm pointer passed to the # function rather than the bogus one in current. # # Fixes: 008cfe4418b3 ("mm: Introduce mm_struct.has_pinned") # Tested-by: Chris Wilson # Reported-by: Harald Arnesen # Reviewed-by: Jason Gunthorpe # Reviewed-by: Peter Xu # Signed-off-by: Jason A. Donenfeld # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 a4d63c3732f1a0c91abcf5b7f32b4ef7dcd82025 # < make -s -j 48 ARCH=powerpc O=/kisskb/build/linus_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- ppc44x_defconfig # < make -s -j 48 ARCH=powerpc O=/kisskb/build/linus_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 48 ARCH=powerpc O=/kisskb/build/linus_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig # make -s -j 48 ARCH=powerpc O=/kisskb/build/linus_ppc44x_defconfig_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- /kisskb/src/block/genhd.c: In function 'diskstats_show': /kisskb/src/block/genhd.c:1667:1: warning: the frame size of 1160 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ /kisskb/src/lib/zstd/compress.c: In function 'ZSTD_compressBlock_doubleFast': /kisskb/src/lib/zstd/compress.c:1393:1: warning: the frame size of 1584 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ INFO: Uncompressed kernel (size 0x5e57d8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e57d8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e57d8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e57d8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e57d8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e57d8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e57d8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e57d8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e57d8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e57d8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x5e57d8) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) Image Name: Linux-5.9.0-rc7-49702-ga4d63c373 Created: Tue Sep 29 03:28:38 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3043084 Bytes = 2971.76 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006014a8 Image Name: Linux-5.9.0-rc7-49702-ga4d63c373 Created: Tue Sep 29 03:28:38 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3042537 Bytes = 2971.23 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006014a8 Image Name: Linux-5.9.0-rc7-49702-ga4d63c373 Created: Tue Sep 29 03:28:38 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3043125 Bytes = 2971.80 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006000c4 Image Name: Linux-5.9.0-rc7-49702-ga4d63c373 Created: Tue Sep 29 03:28:38 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3041754 Bytes = 2970.46 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006014a8 Image Name: Linux-5.9.0-rc7-49702-ga4d63c373 Created: Tue Sep 29 03:28:38 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3042432 Bytes = 2971.12 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 00601498 Image Name: Linux-5.9.0-rc7-49702-ga4d63c373 Created: Tue Sep 29 03:28:38 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3042863 Bytes = 2971.55 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006014a0 Image Name: Linux-5.9.0-rc7-49702-ga4d63c373 Created: Tue Sep 29 03:28:38 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3042215 Bytes = 2970.91 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006001b8 Image Name: Linux-5.9.0-rc7-49702-ga4d63c373 Created: Tue Sep 29 03:28:38 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3043162 Bytes = 2971.84 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 00601488 Image Name: Linux-5.9.0-rc7-49702-ga4d63c373 Created: Tue Sep 29 03:28:38 2020 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 3042453 Bytes = 2971.15 KiB = 2.90 MiB Load Address: 00600000 Entry Point: 006014b8 Completed OK # rm -rf /kisskb/build/linus_ppc44x_defconfig_powerpc-gcc4.9 # Build took: 0:00:59.267882