# git rev-parse -q --verify d497ebf5fb3a026c0817f8c96cde578787f24093^{commit} d497ebf5fb3a026c0817f8c96cde578787f24093 already have revision, skipping fetch # git checkout -q -f -B kisskb d497ebf5fb3a026c0817f8c96cde578787f24093 # git clean -qxdf # < git log -1 # commit d497ebf5fb3a026c0817f8c96cde578787f24093 # Author: Frederic Barrat # Date: Mon Jun 18 14:14:36 2018 +0200 # # ocxl: Fix page fault handler in case of fault on dying process # # If a process exits without doing proper cleanup, there's a window # where an opencapi device can try to access the memory of the dying # process and may trigger a page fault. That's an expected scenario and # the ocxl driver holds a reference on the mm_struct of the process # until the opencapi device is notified of the process exiting. # However, if mm_users is already at 0, i.e. the address space of the # process has already been destroyed, the driver shouldn't try resolving # the page fault, as it will fail, but it can also try accessing already # freed data. # # It is fixed by only calling the bottom half of the page fault handler # if mm_users is greater than 0 and get a reference on mm_users instead # of mm_count. Otherwise, we can safely return a translation fault to # the device, as its associated memory context is being removed. The # opencapi device will be properly cleaned up shortly after when closing # the file descriptors. # # Fixes: 5ef3166e8a32 ("ocxl: Driver code for 'generic' opencapi devices") # Cc: stable@vger.kernel.org # v4.16+ # Signed-off-by: Frederic Barrat # Reviewed-By: Alastair D'Silva # Acked-by: Andrew Donnellan # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/gcc-5.3.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < git log --format=%s --max-count=1 d497ebf5fb3a026c0817f8c96cde578787f24093 # < make -s -j 120 ARCH=powerpc O=/kisskb/build/powerpc-next_allmodconfig+4K_PAGES_powerpc-5.3 CROSS_COMPILE=/opt/cross/kisskb/gcc-5.3.0-nolibc/powerpc64-linux/bin/powerpc64-linux- allmodconfig # Added to kconfig CONFIG_BUILD_DOCSRC=n CONFIG_MODULE_SIG=n CONFIG_SAMPLES=n CONFIG_PPC_4K_PAGES=y CONFIG_PPC_64K_PAGES=n # yes \n | make -s -j 120 ARCH=powerpc O=/kisskb/build/powerpc-next_allmodconfig+4K_PAGES_powerpc-5.3 CROSS_COMPILE=/opt/cross/kisskb/gcc-5.3.0-nolibc/powerpc64-linux/bin/powerpc64-linux- oldconfig yes: standard output: Broken pipe yes: write error # make -s -j 120 ARCH=powerpc O=/kisskb/build/powerpc-next_allmodconfig+4K_PAGES_powerpc-5.3 CROSS_COMPILE=/opt/cross/kisskb/gcc-5.3.0-nolibc/powerpc64-linux/bin/powerpc64-linux- /kisskb/src/net/Makefile:24: CC cannot link executables. Skipping bpfilter. /kisskb/src/net/Makefile:24: CC cannot link executables. Skipping bpfilter. /kisskb/src/sound/aoa/codecs/onyx.c: In function 'onyx_snd_single_bit_get': /kisskb/src/sound/aoa/codecs/onyx.c:380:37: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized] ucontrol->value.integer.value[0] = !!(c & mask) ^ polarity; ^ In file included from /kisskb/src/include/linux/io.h:25:0, from /kisskb/src/include/linux/of_address.h:7, from /kisskb/src/drivers/ata/ahci_qoriq.c:18: /kisskb/src/drivers/ata/ahci_qoriq.c: In function 'ahci_qoriq_hardreset': /kisskb/src/arch/powerpc/include/asm/io.h:633:3: warning: 'px_is' may be used uninitialized in this function [-Wmaybe-uninitialized] ppc_pci_io.name al; \ ^ /kisskb/src/drivers/ata/ahci_qoriq.c:86:14: note: 'px_is' was declared here u32 px_cmd, px_is, px_val; ^ In file included from /kisskb/src/include/linux/io.h:25:0, from /kisskb/src/include/linux/of_address.h:7, from /kisskb/src/drivers/ata/ahci_qoriq.c:18: /kisskb/src/arch/powerpc/include/asm/io.h:142:2: warning: 'px_cmd' may be used uninitialized in this function [-Wmaybe-uninitialized] __asm__ __volatile__("sync;"#insn" %1,%y0" \ ^ /kisskb/src/drivers/ata/ahci_qoriq.c:86:6: note: 'px_cmd' was declared here u32 px_cmd, px_is, px_val; ^ Completed OK # rm -rf /kisskb/build/powerpc-next_allmodconfig+4K_PAGES_powerpc-5.3 # Build took: 0:04:22.465379