Bug 469670

Summary: snmpd: argument parsing causes segfaults
Product: Red Hat Enterprise Linux 5 Reporter: Jan Safranek <jsafrane>
Component: net-snmpAssignee: Jan Safranek <jsafrane>
Status: CLOSED CURRENTRELEASE QA Contact: BaseOS QE <qe-baseos-auto>
Severity: low Docs Contact:
Priority: low    
Version: 5.3CC: jnansi, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-11-03 12:50:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 469620    
Bug Blocks:    

Description Jan Safranek 2008-11-03 12:41:55 UTC
+++ This bug was initially created as a clone of Bug #469620 +++

Description of problem:

This has been fixed upstream, please see details at http://sourceforge.net/tracker/index.php?func=detail&aid=1856562&group_id=12694&atid=112694

How reproducible:

Always.

Steps to Reproduce:

- Stop snmpd
- Start it using using any of the below method.

# snmpd -LF
# snmpd -LS

Snmpd shouldn't segfault, instead it should either start snmpd or say "syntax error". These options are deprecated as per "snmpd --help", but it should never segfault at any cost.

Actual results:

Snmpd segfatuls.

Expected results:

It shouldn't, but it should report "invalid syntax" if the passed options does not make any sense to it.

Additional info:

Patch is already upstream and is available from the above link.

--Sadique

Core was generated by `snmpd -f -LS'.
Program terminated with signal 11, Segmentation fault.
#0  decode_priority (optarg=0x0, pri_max=0x7fffda621c50) at snmp_logging.c:174
174         switch (*optarg) {
(gdb) bt
#0  decode_priority (optarg=0x0, pri_max=0x7fffda621c50) at snmp_logging.c:174
#1  0x00002accd12eb169 in snmp_log_options (optarg=<value optimized out>, argc=<value optimized out>, argv=0x7fffda622008) at snmp_logging.c:377
#2  0x00002accd048935d in main (argc=3, argv=0x7fffda622008) at snmpd.c:628

(gdb) thread apply all bt

Thread 1 (process 12849):
#0  decode_priority (optarg=0x0, pri_max=0x7fffda621c50) at snmp_logging.c:174
#1  0x00002accd12eb169 in snmp_log_options (optarg=<value optimized out>, argc=<value optimized out>, argv=0x7fffda622008) at snmp_logging.c:377
#2  0x00002accd048935d in main (argc=3, argv=0x7fffda622008) at snmpd.c:628
This event sent from IssueTracker by jnansi  [Support Engineering Group]
 issue 224872

Comment 1 Jan Safranek 2008-11-03 12:50:20 UTC
oops, this is already fixed in RHEL5.3 update by rebase to net-snmp-5.3.2.2, sorry for confusion.