diff options
author | Adrian Huang <[email protected]> | 2020-09-17 19:15:49 +0800 |
---|---|---|
committer | Dan Williams <[email protected]> | 2020-09-20 08:57:36 -0700 |
commit | d4c5da5049ac27c6ef8f6f98548c3a1ade352d25 (patch) | |
tree | cc167f186cdc547b3f372c117692a186fe22b016 /tools/perf/util/trace-event-scripting.c | |
parent | e2ec5128254518cae320d5dc631b71b94160f663 (diff) |
dax: Fix stack overflow when mounting fsdax pmem device
When mounting fsdax pmem device, commit 6180bb446ab6 ("dax: fix
detection of dax support for non-persistent memory block devices")
introduces the stack overflow [1][2]. Here is the call path for
mounting ext4 file system:
ext4_fill_super
bdev_dax_supported
__bdev_dax_supported
dax_supported
generic_fsdax_supported
__generic_fsdax_supported
bdev_dax_supported
The call path leads to the infinite calling loop, so we cannot
call bdev_dax_supported() in __generic_fsdax_supported(). The sanity
checking of the variable 'dax_dev' is moved prior to the two
bdev_dax_pgoff() checks [3][4].
[1] https://lore.kernel.org/linux-nvdimm/[email protected]/
[2] https://lore.kernel.org/linux-nvdimm/alpine.LRH.2.02.2009141131220.30651@file01.intranet.prod.int.rdu2.redhat.com/
[3] https://lore.kernel.org/linux-nvdimm/CA+RJvhxBHriCuJhm-D8NvJRe3h2MLM+ZMFgjeJjrRPerMRLvdg@mail.gmail.com/
[4] https://lore.kernel.org/linux-nvdimm/[email protected]/
Fixes: 6180bb446ab6 ("dax: fix detection of dax support for non-persistent memory block devices")
Reported-by: Yi Zhang <[email protected]>
Reported-by: Mikulas Patocka <[email protected]>
Signed-off-by: Adrian Huang <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Tested-by: Ritesh Harjani <[email protected]>
Cc: Coly Li <[email protected]>
Cc: Ira Weiny <[email protected]>
Cc: John Pittman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dan Williams <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions