lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230221103313.120834-2-jefflexu@linux.alibaba.com>
Date:   Tue, 21 Feb 2023 18:33:12 +0800
From:   Jingbo Xu <jefflexu@...ux.alibaba.com>
To:     dhowells@...hat.com, linux-cachefs@...hat.com
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] cachefiles: don't align the write IO in ondemand mode

If the write IO requested by the user daemon is not aligned with the
block size of the backing filesystem, it's expected to fail directly
rather than submit the aligned write IO (with expanded file range
unmatching with the given iov_iter).

Signed-off-by: Jingbo Xu <jefflexu@...ux.alibaba.com>
---
 fs/cachefiles/ondemand.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/cachefiles/ondemand.c b/fs/cachefiles/ondemand.c
index 0254ed39f68c..c017aca2a8a2 100644
--- a/fs/cachefiles/ondemand.c
+++ b/fs/cachefiles/ondemand.c
@@ -52,7 +52,8 @@ static ssize_t cachefiles_ondemand_fd_write_iter(struct kiocb *kiocb,
 		return -ENOBUFS;
 
 	cachefiles_begin_secure(cache, &saved_cred);
-	ret = __cachefiles_prepare_write(object, file, &pos, &len, true);
+	ret = cachefiles_has_space(cache, 0, len >> cache->bshift,
+				   cachefiles_has_space_for_write);
 	cachefiles_end_secure(cache, saved_cred);
 	if (ret < 0)
 		return ret;
-- 
2.19.1.6.gb485710b

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ