Created attachment 15720 [details] patch for vfs_fruit.c of 4.11.4 vfs_fruit.c of Samba 4.10 and 4.11 divide by zero in fruit_tmsize_do_dirent() if you create a fresh time machine backup in an empty directory which contains no bands yet. Around line 6974: if (bandsize > SIZE_MAX/nbands) { Trivial patch is attached. smbd in debug mode (eg. smbd -S -F -i -d 10 -s /usr/local/etc/smb4.conf) was very helpful finding this one.
I encountered this issue on FreeBSD 12.1 running Samba 4.11.11. Creating a new Time Machine backup to a Samba share crashes samba with a floating point division by zero error. I added Felix's patch to the existing patch set and rebuilt the samba411 port and now it works fine. As Felix mentioned, the patch is trivial and the bug is obvious in the source code. This issue has been here for nearly a year now. Can the patch please be applied to vfs_fruit.c? Thank you! Sam
I'll take a look tomorrow.