SMB2 AIO with unaligned memory address caused the read data corruption.

Partha Sarathi at
Mon Jun 11 19:21:57 UTC 2018


We recently come across a read data corruption issue using samba.4.7.x
against *Linux Fuse FS with DIO enabled*.

We nailed down the issue was an outcome of samba AIO preads were reusing
the unaligned buffer address allocated by *talloc* library.  The kernel
FUSE with DIO path (Direct IO) was not handling the unaligned memory
correctly.  We are trying to fix this issue from both the ends.

For samba, I provided the attached patch as workaround patch i.e for AIO
read path I want to make sure the allocated memory is aligned of the system
page size which fixed the issue, but I would like to fix this in as part of
*talloc* library itself.

Please take a look at the patch and let me know, if we can fix this in
*talloc* itself i.e guaranteeing the aligned memory allocation for IO

Thanks & Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-the-smb2-AIO-read-buffer-to-get-4k-memory-align.patch
Type: application/octet-stream
Size: 3699 bytes
Desc: not available
URL: <>

More information about the samba-technical mailing list