Skip to content

Commit 69c9070

Browse files
Davidlohr Buesoaegl
authored andcommitted
ia64/err-inject: Use get_user_pages_fast()
At the point of sysfs callback, the call to gup is done without mmap_sem (or any lock for that matter). This is racy. As such, use the get_user_pages_fast() alternative and safely avoid taking the lock, if possible. Signed-off-by: Davidlohr Bueso <dbueso@suse.de> Signed-off-by: Tony Luck <tony.luck@intel.com>
1 parent 339d541 commit 69c9070

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/ia64/kernel/err_inject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ store_virtual_to_phys(struct device *dev, struct device_attribute *attr,
142142
u64 virt_addr=simple_strtoull(buf, NULL, 16);
143143
int ret;
144144

145-
ret = get_user_pages(virt_addr, 1, FOLL_WRITE, NULL, NULL);
145+
ret = get_user_pages_fast(virt_addr, 1, FOLL_WRITE, NULL);
146146
if (ret<=0) {
147147
#ifdef ERR_INJ_DEBUG
148148
printk("Virtual address %lx is not existing.\n",virt_addr);

0 commit comments

Comments
 (0)