Bug 318203

Summary: setsockopt handling needs to handle SOL_SOCKET/SO_ATTACH_FILTER
Product: [Developer tools] valgrind Reporter: Guy Harris <gharris>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: tom
Priority: NOR    
Version: 3.9.0.SVN   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch to fix this problem

Description Guy Harris 2013-04-11 19:57:24 UTC
The setsockopt handling for Linux needs special handling for SOL_SOCKET/SO_ATTACH_FILTER so as not to report bogus "uninitialized data" for locations the kernel doesn't look at (because they're padding) and to handle the fact that the structure being passed in contains a pointer that is dereferenced by the kernel (so that we check validity of data read through that pointer).

Reproducible: Always

Steps to Reproduce:
1. Run tcpdump under Valgrind
Actual Results:  
A warning about setsockopt() that doesn't reflect an actual problem.  (There may be other warnings, but some are due to bug 303536, and others may be due to a Valgrind bug or may be due to a libnl bug - I haven't investigated that yet.)

Expected Results:  
No such warning.
Comment 1 Guy Harris 2013-04-11 19:58:03 UTC
Created attachment 78818 [details]
Patch to fix this problem

And here's a fix.
Comment 2 Tom Hughes 2013-07-17 14:37:14 UTC
Committed with minor adjustments as r13461.