freebsd-skq/usr.sbin/bsnmpd
trociny 1fecf4ec8c In snmp_hostres, device_map table is used for consistent device table
indexing. When a device has gone it is not removed from device_map
table but just its entry_p field is set to NULL.

So when traversing device_map in disk_OS_get_ATA_disks() and
disk_OS_get_MD_disks() check for entry_p being NULL, otherwise the
bsnmpd crash is possible when a removed map entry is dereferenced.

Before the fix, for disk_OS_get_ATA_disks() the crash could be easily
reproduced running:

  atacontrol detach ata1

The crash was not observed in disk_OS_get_MD_disks() because currently
snmp_hostres does no see md(4) disks: to get the device list it uses
devinfo(3), which does not return md devices.

Reported by:	Miroslav Lachman 000.fbsd quip.cz
MFC after:	1 week
2012-09-17 07:32:53 +00:00
..
bsnmpd Bring in a SNMP module that allows configuration of SNMPv3 Notification targets. 2010-12-20 17:13:14 +00:00
gensnmptree
modules In snmp_hostres, device_map table is used for consistent device table 2012-09-17 07:32:53 +00:00
tools Remove trailing whitespace per mdoc lint warning 2012-03-29 05:02:12 +00:00
Makefile Add bsnmpd(1)'s SNMP client tools (including SNMPv3 support) to the base system. 2010-12-08 14:30:25 +00:00
Makefile.inc