ANDROID: fuse-bpf: Make sure force_again flag is false by default

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 <dimorinny@google.com>
This commit is contained in:
Dmitrii Merkurev
2022-06-27 16:21:40 +00:00
parent 4ad093cae1
commit 2c8c8d03c1

View File

@@ -573,7 +573,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: