# 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-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-gcc --version # < git log --format=%s --max-count=1 d497ebf5fb3a026c0817f8c96cde578787f24093 # < make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-next_wii_defconfig_powerpc CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- wii_defconfig # make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-next_wii_defconfig_powerpc CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- /kisskb/src/net/Makefile:24: CC cannot link executables. Skipping bpfilter. /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:183:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/rcu/srcutree.c: In function 'init_srcu_struct_fields': /kisskb/src/kernel/rcu/srcutree.c:127:33: warning: 'levelspread[]' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/rcu/srcutree.c:94:6: note: 'levelspread[]' was declared here /kisskb/src/net/Makefile:24: CC cannot link executables. Skipping bpfilter. /kisskb/src/drivers/base/regmap/regmap.c: In function 'regmap_raw_read': /kisskb/src/drivers/base/regmap/regmap.c:2497:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function '_regmap_raw_write': /kisskb/src/drivers/base/regmap/regmap.c:1819:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c: In function 'proc_reg_open': /kisskb/src/include/linux/list.h:65:12: warning: 'pdeo' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c:339:21: note: 'pdeo' was declared here /kisskb/src/drivers/net/wireless/broadcom/b43/phy_n.c: In function 'b43_nphy_rf_ctl_override_rev7': /kisskb/src/drivers/net/wireless/broadcom/b43/phy_n.c:202:21: warning: 'val_addr' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/mac80211/mlme.c: In function 'ieee80211_rx_mgmt_beacon': /kisskb/src/net/mac80211/mlme.c:1353:3: warning: 'pwr_level_cisco' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/mac80211/mlme.c:1310:6: note: 'pwr_level_cisco' was declared here INFO: Uncompressed kernel (size 0x88a628) overlaps the address of the wrapper(0x600000) INFO: Fixing the link_address of wrapper to (0x900000) Completed OK # rm -rf /kisskb/build/powerpc-next_wii_defconfig_powerpc # Build took: 0:00:56.942696