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.
Created attachment 78818 [details] Patch to fix this problem And here's a fix.
Committed with minor adjustments as r13461.