From 3f557cd122e74dbf30dfc3a538880fbf2392b4e8 Mon Sep 17 00:00:00 2001 From: Dmitrii Merkurev Date: Mon, 27 Jun 2022 16:21:40 +0000 Subject: [PATCH] UPSTREAM: ANDROID: fuse-bpf: Make sure force_again flag is false by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Usage of uninitialized boolean is potentially can cause annoying and “hard to catch” types of problems. Currently we have 1 case where we use uninitialized boolean: int fuse_readdir(struct file *file, struct dir_context *ctx) And I constantly see that every userspace readdir operation causes an infinite cycle inside the Kernel for my QEMU tests (gcc). This problem isn’t reproducible inside cuttlefish, probably because we use clang toolchain. Bug: 219958836 Test: atest ScopedStorageDeviceTest Test: selftests Change-Id: I2c38056448cd2910e0cb20da5839d7db9ebd26b9 Signed-off-by: Dmitrii Merkurev --- fs/fuse/readdir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/fuse/readdir.c b/fs/fuse/readdir.c index be0df513a2e0..06446ee6e9d0 100644 --- a/fs/fuse/readdir.c +++ b/fs/fuse/readdir.c @@ -581,7 +581,8 @@ int fuse_readdir(struct file *file, struct dir_context *ctx) #ifdef CONFIG_FUSE_BPF struct fuse_err_ret fer; - bool force_again, allow_force; + bool allow_force; + bool force_again = false; bool is_continued = false; again: