From 1a11a5283818fddcd82993c39fb1d16a55dfa2a7 Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Wed, 11 Jan 2023 15:40:14 -0800 Subject: [PATCH] ANDROID: fuse-bpf: Fix crash from assuming iter is kvec Note that this just stops the crash, it does not correctly set the buffer. However, since no current use case in Android requires the buffer, this is tolerable for now. Bug: 265206112 Test: atest android.scopedstorage.cts.host.ScopedStorageHostTest crashes without this, passes with it Change-Id: I25efac2b1d38fa54b9f26a3f297196fa79e5e7c3 Signed-off-by: Paul Lawrence --- fs/fuse/backing.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/fuse/backing.c b/fs/fuse/backing.c index 22656a0624ba..e784c17306db 100644 --- a/fs/fuse/backing.c +++ b/fs/fuse/backing.c @@ -920,7 +920,8 @@ int fuse_file_write_iter_initialize( .in_args[0].size = sizeof(fwio->fwi), .in_args[0].value = &fwio->fwi, .in_args[1].size = fwio->fwi.size, - .in_args[1].value = from->kvec->iov_base, + .in_args[1].value = iov_iter_is_kvec(from) + ? from->kvec->iov_base : NULL, .out_numargs = 1, .out_args[0].size = sizeof(fwio->fwio), .out_args[0].value = &fwio->fwio,