Bug 320116 - bind on AF_BLUETOOTH produces warnings because of sockaddr_rc padding
Summary: bind on AF_BLUETOOTH produces warnings because of sockaddr_rc padding
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-21 22:40 UTC by Mark Wielaard
Modified: 2013-05-22 10:39 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Support-Linux-kernel-AF_BLUETOOTH-for-bind.patch (6.67 KB, patch)
2013-05-21 22:44 UTC, Mark Wielaard
Details

Note You need to log in before you can comment on or make changes to this bug.
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.