The local hostname was blindly copied into the to the nn_name array.
When the hostname exceeded 16 bytes, it would overflow.
PR: 228354
Reported by: donald.buchholz@intel.com
Differential D15936
Fix a stack overflow in mount_smbfs when hostname is too long. brooks on Jun 20 2018, 8:29 PM. Authored by Tags None Referenced Files
Subscribers
Details The local hostname was blindly copied into the to the nn_name array. PR: 228354
Diff Detail
Event Timeline
Comment Actions I'm not sure what the consequences of returning an error here are versus silently truncating. Before this change you'd have hostname "longerthan16chars.local" and it would get passed through as "longerthan16cha" but now mount_smbfs would fail with an error? If that assertion is true maybe it would be better just to copy and truncate at 16 than to return an error. Comment Actions For the local host name, it seems that truncating to 15-bytes is the right thing. For the server name, it's probably a bug if we are given a server name larger than 16 bytes and we should fail. |