Bug 320116

Summary: bind on AF_BLUETOOTH produces warnings because of sockaddr_rc padding
Product: [Developer tools] valgrind Reporter: Mark Wielaard <mark>
Component: memcheckAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Support-Linux-kernel-AF_BLUETOOTH-for-bind.patch

Description Mark Wielaard 2013-05-21 22:40:49 UTC
bind on AF_BLUETOOTH will always produce:

==8721== Syscall param socketcall.bind(my_addr.) points to uninitialised byte(s)
==8721==    at 0x318A2F3187: bind (syscall-template.S:81)
==8721==    by 0x400639: main (rfcomm.c:51)

Because sockaddr_rc has some padding which isn't used, but might not be initialized.

Reproducible: Always
Comment 1 Mark Wielaard 2013-05-21 22:44:29 UTC
Created attachment 80013 [details]
Support-Linux-kernel-AF_BLUETOOTH-for-bind.patch

    Support Linux kernel AF_BLUETOOTH for bind().
    
    Bug #320116. sockaddr_rc might contain some padding which might not be
    initialized. Explicitly check the sockaddr_rc fields are set. That also
    produces better diagnostics about which field is unitialized.
Comment 2 Mark Wielaard 2013-05-22 10:38:29 UTC
I committed this as r13404. Plus extra fix for platforms without AF_BLUETOOTH spotted by Tom Hughes as r13405.