freebsd-dev/usr.sbin/iscsid
John Baldwin c74ab5ce6f iscsid: Always free the duplicated address in resolve_addr().
If a "raw" IPv6 address (denoted by a leading '[') is used as a target
address, then 'arg' is incremented by one to skip over the '['.
However, this meant that at the end of the function the wrong address
was passed to free().  With malloc junking enabled and given suitably
small strings, malloc() would happily overwrite the correct number of
bytes with junk, but off by one byte overwriting the byte after the
allocation.

This manifested as the first byte of the 'HeaderDigest' key being
overwritten causing the key name on the wire to be sent as
'\x5eaderDigest' which the target rejected.

Reported by:	Jithesh Arakkan @ Chelsio
Found with:	ASAN (via WITH_ASAN=yes)
Sponsored by:	Chelsio Communications
2021-12-28 16:49:46 -08:00
..
discovery.c libiscsiutil: Change keys_load/save to operate on data buffers. 2021-12-22 10:43:24 -08:00
iscsid.8 Drop "All rights reserved" from all my stuff. This includes 2020-10-28 13:46:11 +00:00
iscsid.c iscsid: Always free the duplicated address in resolve_addr(). 2021-12-28 16:49:46 -08:00
iscsid.h Add an internal libiscsiutil library. 2021-12-22 10:43:11 -08:00
login.c libiscsiutil: Change keys_load/save to operate on data buffers. 2021-12-22 10:43:24 -08:00
Makefile Add an internal libiscsiutil library. 2021-12-22 10:43:11 -08:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00