Re: Net-SNMP 5.9.5. and 5.10.pre2 released to address snmptrapd security vulnerability

Bart Van Assche via Net-snmp-coders <[email protected]> Tue, 6 Jan 2026 10:38:04 -0700
Newsgroups gmane.network.net-snmp.devel
Message-ID <[email protected]>
On 1/6/26 8:53 AM, Wes Hardaker wrote:
> Bart Van Assche via Net-snmp-coders
> <[email protected]> writes:
> 
>> How about realizing this with the patch below?
> 
> I like it in general, but:
> 
>> +	    -fsanitize*)
>> +		echo -n "$cflag ";;
> 
> Why is that given special exception?  IMHO, it is a developer specific
> thing and people using our needed flags should make their own compiling
> choices for all -f or -W like options.

-fsanitize is special. It is the only -f flag I know of that causes
additional libraries to be linked. If -fsanitize is treated in the same
way as other -f flags (filtered out) then ld complains about undefined
references:

$ ./configure 'CFLAGS=-fsanitize=address -fsanitize=pointer-compare 
-fsanitize=pointer-subtract -fsanitize=leak -fsanitize=undefined' 
'LDFLAGS= -fsanitize=address -fsanitize=pointer-compare 
-fsanitize=pointer-subtract -fsanitize=leak -fsanitize=undefined'
$ make
[ ... ]
$ ci/net-snmp-run-tests
[ ... ]
mkdir testing/fulltests/snmpv3
/usr/bin/ld: 
/usr/local/google/home/bvanassche/software/net-snmp/snmplib/.libs/libnetsnmp.so: 
undefined reference to `__asan_report_store4'
/usr/bin/ld: 
/usr/local/google/home/bvanassche/software/net-snmp/snmplib/.libs/libnetsnmp.so: 
undefined reference to `__asan_stack_free_7'
[ ... ]

Thanks,

Bart.