17.11.2022 14:09, ArtMG wrote:
..
I have now reproduced the error on 4.13.13 on 32bit, and confirmed it is *still* an issue
with 4.16.7 on 32bit. However when I switch to 64bit OS version, the error does *not*
occur, not even in 4.13.13. The TimeMachine client successfully mounts the share and
completes multiple backups, and the server smbd logs are clean, with no overflow
warnings, and definitely no "Invalid or incomplete multibyte or wide character"
errors.
Do you have ability to compile samba? If yes (maybe with a debian package),
can you please try the attached patch? It removes the useless and actually
wrong check for the off_t overflowing size_t.
Or alternatively I can provide pre-built binaries.
Thanks,
/mjt
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 4058d4834e7..8e31e74f2a6 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -5273,17 +5273,6 @@ static bool fruit_tmsize_do_dirent(vfs_handle_struct *handle,
return true;
}
- /*
- * Arithmetic on 32-bit systems may cause overflow, depending on
- * size_t precision. First we check its unlikely, then we
- * force the precision into target off_t, then we check that
- * the total did not overflow either.
- */
- if (bandsize > SIZE_MAX/nbands) {
- DBG_ERR("tmsize potential overflow: bandsize [%zu] nbands [%zu]\n",
- bandsize, nbands);
- return false;
- }
tm_size = (off_t)bandsize * (off_t)nbands;
if (state->total_size + tm_size < state->total_size) {