Summary: | [smbfs] [patch] mount_smbfs fails on arm because of wrong endianess assumption in libsmb | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | rz-rpi03 | ||||
Component: | kern | Assignee: | Ian Lepore <ian> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | ian, pi | ||||
Priority: | Normal | ||||||
Version: | 10.0-CURRENT | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=189415 | ||||||
Attachments: |
|
Description
rz-rpi03
2013-07-10 16:40:00 UTC
Responsible Changed From-To: freebsd-bugs->freebsd-fs Over to maintainer(s). See https://reviews.freebsd.org/D4622 for a patch. See also https://lists.freebsd.org/pipermail/freebsd-arm/2015-December/012841.html A commit references this bug: Author: ian Date: Mon Dec 21 17:17:00 UTC 2015 New revision: 292552 URL: https://svnweb.freebsd.org/changeset/base/292552 Log: Avoid unaligned memory accesses when encoding netbios names in libsmb. The current code for encoding a netbios name converts each byte to a 16-bit value and stores the result by casting a char* to u_short*, resulting in alignment faults on strict-alignment platforms. This change reimplements the encoding routine using only byte accesses to memory. There is no particular reason to work with 16-bit values just because the encoding process creates two bytes of output for every byte of input. Working a byte at at time also avoids endian problems for big-endian platforms. PR: 180438 PR: 189415 Differential Revision: https://reviews.freebsd.org/D4622 Changes: head/contrib/smbfs/lib/smb/nb_name.c A commit references this bug: Author: ian Date: Mon Dec 21 17:41:09 UTC 2015 New revision: 292553 URL: https://svnweb.freebsd.org/changeset/base/292553 Log: Make the building of libsmb and mount_smbfs unconditional, now that r292552 has eliminated alignment and endian problems that were making it fail on some platforms. PR: 180438 PR: 189415 Changes: head/lib/Makefile head/usr.sbin/Makefile head/usr.sbin/Makefile.amd64 head/usr.sbin/Makefile.arm head/usr.sbin/Makefile.i386 head/usr.sbin/Makefile.powerpc head/usr.sbin/Makefile.sparc64 Now this bug is fixed, so I am closing it. Thank you. A commit references this bug: Author: ian Date: Tue Jan 19 23:36:50 UTC 2016 New revision: 294364 URL: https://svnweb.freebsd.org/changeset/base/294364 Log: MFC r292337, r292552, r292553: Build mount_smbfs for arm. Also sort the subdirs. Avoid unaligned memory accesses when encoding netbios names in libsmb. The current code for encoding a netbios name converts each byte to a 16-bit value and stores the result by casting a char* to u_short*, resulting in alignment faults on strict-alignment platforms. This change reimplements the encoding routine using only byte accesses to memory. There is no particular reason to work with 16-bit values just because the encoding process creates two bytes of output for every byte of input. Working a byte at at time also avoids endian problems for big-endian platforms. Make the building of libsmb and mount_smbfs unconditional, now that r292552 has eliminated alignment and endian problems that were making it fail on some platforms. PR: 180438 PR: 189415 Relnotes: Yes Changes: _U stable/10/ stable/10/contrib/smbfs/lib/smb/nb_name.c stable/10/lib/Makefile stable/10/usr.sbin/Makefile stable/10/usr.sbin/Makefile.amd64 stable/10/usr.sbin/Makefile.arm stable/10/usr.sbin/Makefile.i386 stable/10/usr.sbin/Makefile.ia64 stable/10/usr.sbin/Makefile.powerpc stable/10/usr.sbin/Makefile.sparc64 |