John Starks
3ac29732a2
mm/gup: fix gup_pud_range() for dax
...
commit fcd0ccd836ffad73d98a66f6fea7b16f735ea920 upstream.
For dax pud, pud_huge() returns true on x86. So the function works as long
as hugetlb is configured. However, dax doesn't depend on hugetlb.
Commit 414fd080d125 ("mm/gup: fix gup_pmd_range() for dax") fixed
devmap-backed huge PMDs, but missed devmap-backed huge PUDs. Fix this as
well.
This fixes the below kernel panic:
general protection fault, probably for non-canonical address 0x69e7c000cc478: 0000 [#1 ] SMP
< snip >
Call Trace:
<TASK>
get_user_pages_fast+0x1f/0x40
iov_iter_get_pages+0xc6/0x3b0
? mempool_alloc+0x5d/0x170
bio_iov_iter_get_pages+0x82/0x4e0
? bvec_alloc+0x91/0xc0
? bio_alloc_bioset+0x19a/0x2a0
blkdev_direct_IO+0x282/0x480
? __io_complete_rw_common+0xc0/0xc0
? filemap_range_has_page+0x82/0xc0
generic_file_direct_write+0x9d/0x1a0
? inode_update_time+0x24/0x30
__generic_file_write_iter+0xbd/0x1e0
blkdev_write_iter+0xb4/0x150
? io_import_iovec+0x8d/0x340
io_write+0xf9/0x300
io_issue_sqe+0x3c3/0x1d30
? sysvec_reschedule_ipi+0x6c/0x80
__io_queue_sqe+0x33/0x240
? fget+0x76/0xa0
io_submit_sqes+0xe6a/0x18d0
? __fget_light+0xd1/0x100
__x64_sys_io_uring_enter+0x199/0x880
? __context_tracking_enter+0x1f/0x70
? irqentry_exit_to_user_mode+0x24/0x30
? irqentry_exit+0x1d/0x30
? __context_tracking_exit+0xe/0x70
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fc97c11a7be
< snip >
</TASK>
---[ end trace 48b2e0e67debcaeb ]---
RIP: 0010:internal_get_user_pages_fast+0x340/0x990
< snip >
Kernel panic - not syncing: Fatal exception
Kernel Offset: disabled
Link: https://lkml.kernel.org/r/1670392853-28252-1-git-send-email-ssengar@linux.microsoft.com
Fixes: 414fd080d125 ("mm/gup: fix gup_pmd_range() for dax")
Signed-off-by: John Starks <jostarks@microsoft.com>
Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Yu Zhao <yuzhao@google.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-12-14 11:37:20 +01:00
..
2022-11-16 09:58:27 +01:00
2022-05-09 09:14:41 +02:00
2022-05-25 09:57:23 +02:00
2022-08-31 17:16:47 +02:00
2021-05-07 00:26:35 -07:00
2022-08-31 17:16:48 +02:00
2021-05-05 11:27:21 -07:00
2021-05-05 11:27:24 -07:00
2022-06-09 10:23:27 +02:00
2021-05-05 11:27:24 -07:00
2022-12-08 11:28:44 +01:00
2022-02-08 18:34:05 +01:00
2021-09-24 16:13:35 -07:00
2021-06-29 10:53:52 -07:00
2021-09-08 11:50:24 -07:00
2020-10-13 18:38:29 -07:00
2022-11-26 09:24:51 +01:00
2021-05-05 11:27:27 -07:00
2021-05-05 11:27:26 -07:00
2021-05-05 11:27:26 -07:00
2022-12-14 11:37:20 +01:00
2022-04-13 20:59:21 +02:00
2022-08-03 12:03:54 +02:00
2022-10-12 09:53:28 +02:00
2021-05-05 11:27:22 -07:00
2021-06-30 20:47:26 -07:00
2021-06-30 20:47:25 -07:00
2022-11-26 09:24:33 +01:00
2022-07-12 16:35:05 +02:00
2021-07-08 11:48:21 -07:00
2021-09-03 09:58:16 -07:00
2021-04-30 11:20:38 -07:00
2021-04-30 11:20:39 -07:00
2021-09-08 11:50:24 -07:00
2021-11-25 09:48:43 +01:00
2020-12-15 12:13:46 -08:00
2022-12-14 11:37:18 +01:00
2022-09-15 11:30:00 +02:00
2021-09-13 10:18:28 -07:00
2021-05-05 11:27:23 -07:00
2022-11-26 09:24:47 +01:00
2022-10-05 10:39:39 +02:00
2021-09-08 11:50:24 -07:00
2021-07-01 11:06:02 -07:00
2022-03-02 11:48:10 +01:00
2022-12-14 11:37:19 +01:00
2022-03-08 19:12:48 +01:00
2021-09-08 12:55:35 -07:00
2022-11-26 09:24:33 +01:00
2022-08-03 12:03:42 +02:00
2022-08-17 14:23:47 +02:00
2021-06-04 19:32:21 +01:00
2022-11-16 09:58:27 +01:00
2022-10-05 10:39:39 +02:00
2021-01-24 14:27:16 +01:00
2022-05-15 20:18:53 +02:00
2021-04-30 11:20:42 -07:00
2021-07-23 17:43:28 -07:00
2022-10-26 12:34:24 +02:00
2022-12-14 11:37:17 +01:00
2022-04-27 14:38:58 +02:00
2020-12-15 14:48:04 -08:00
2022-02-23 12:03:03 +01:00
2022-04-13 20:59:22 +02:00
2021-04-30 11:20:37 -07:00
2021-09-04 11:35:47 -07:00
2022-04-27 14:38:58 +02:00
2022-10-05 10:39:39 +02:00
2021-04-30 11:20:38 -07:00
2021-10-18 20:22:02 -10:00
2021-09-08 11:50:24 -07:00
2022-04-20 09:34:18 +02:00
2021-09-08 12:55:35 -07:00
2021-09-08 11:50:22 -07:00
2021-04-30 11:20:36 -07:00
2021-06-29 10:53:47 -07:00
2021-06-29 10:53:47 -07:00
2021-07-01 11:06:03 -07:00
2022-08-31 17:16:47 +02:00
2022-09-08 12:28:05 +02:00
2021-07-01 17:17:24 -07:00
2021-07-04 18:30:17 +00:00
2021-06-05 20:43:15 +00:00
2021-07-04 18:30:17 +00:00
2021-09-08 12:55:35 -07:00
2021-05-07 00:26:35 -07:00
2021-06-16 09:24:42 -07:00
2021-05-05 11:27:27 -07:00
2022-09-08 12:28:05 +02:00
2021-07-13 13:14:27 +02:00
2022-09-05 10:30:07 +02:00
2020-08-21 09:52:53 -07:00
2022-10-05 10:39:39 +02:00
2022-11-26 09:24:28 +01:00
2021-04-16 16:10:36 -07:00
2021-05-22 15:09:07 -10:00
2022-04-27 14:38:51 +02:00
2022-04-27 14:38:51 +02:00
2022-04-27 14:38:51 +02:00
2022-04-27 14:38:51 +02:00
2022-09-28 11:11:44 +02:00
2021-06-30 20:47:26 -07:00
2021-09-03 09:58:15 -07:00
2021-08-28 01:46:17 +02:00
2022-03-23 09:16:41 +01:00
2021-09-24 16:13:35 -07:00
2021-09-03 09:58:12 -07:00
2021-09-03 10:08:28 -07:00
2022-04-08 14:24:14 +02:00
2022-11-26 09:24:28 +01:00
2022-07-12 16:35:01 +02:00
2022-03-08 19:12:38 +01:00
2021-09-03 09:58:17 -07:00
2022-12-08 11:28:44 +01:00
2021-09-08 15:32:34 -07:00
2022-04-27 14:38:57 +02:00
2021-07-01 11:06:03 -07:00
2021-07-01 11:06:03 -07:00
2021-05-07 00:26:35 -07:00
2022-06-06 08:43:39 +02:00
2021-06-30 20:47:31 -07:00