kernel-5.10 软件逻辑bug In the tree search v2 ioctl we use the type size_t, which is an unsigned long, to track the buffer size in the local variable 'buf_size'. An unsigned long is 32 bits wide on a 32 bits architecture. The buffer size defined in struct btrfs_ioctl_search_args_v2 is a u64, so when we later try to copy the local variable 'buf_size' to the argument struct, when the search returns -EOVERFLOW, we copy only 32 bits which will be a problem on big endian systems. Fix this by using a u64 type for the buffer sizes, not only at btrfs_ioctl_tree_search_v2(), but also everywhere down the call chain so that we can use the u64 at btrfs_ioctl_tree_search_v2(). Additional info: 社区有patch已经解决 btrfs: use u64 for buffer sizes in the tree search ioctls commit 4be0407ffcf6db5bf520aac6e950e9488c96456b Reference:https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=4be0407ffcf6db5bf520aac6e950e9488c96456b git cherry-pick -s 4be0407ffc(with stable-v5.10.201 repo added)
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2447
(In reply to 小龙 from comment #1) > The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2447 merged