Commit b453e4a7 authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Laibin Qiu
Browse files

ovl: fix IOCB_DIRECT if underlying fs doesn't support direct IO

mainline inclusion
from mainline-v5.15-rc5
commit 1dc1eed4
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I51NT0


CVE: NA

--------------------------------

Normally the check at open time suffices, but e.g loop device does set
IOCB_DIRECT after doing its own checks (which are not sufficent for
overlayfs).

Make sure we don't call the underlying filesystem read/write method with
the IOCB_DIRECT if it's not supported.

Reported-by: default avatarHuang Jianan <huangjianan@oppo.com>
Fixes: 16914e6f ("ovl: add ovl_read_iter()")
Cc: <stable@vger.kernel.org> # v4.19
Tested-by: default avatarHuang Jianan <huangjianan@oppo.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>

conflicts:
	fs/overlayfs/file.c
Signed-off-by: default avatarZheng Liang <zhengliang6@huawei.com>
Reviewed-by: default avatarZhang Yi <yi.zhang@huawei.com>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent b52ef3c6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment