Page MenuHomeFreeBSD

usr.sbin/ctld: fix a segfault on duplicate lun or target when using ucl conf format
ClosedPublic

Authored by nikita_elyzion.net on Oct 12 2017, 4:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 3, 4:22 PM
Unknown Object (File)
Tue, May 26, 4:35 AM
Unknown Object (File)
Apr 25 2026, 4:09 PM
Unknown Object (File)
Apr 25 2026, 2:21 PM
Unknown Object (File)
Apr 25 2026, 12:24 AM
Unknown Object (File)
Apr 24 2026, 4:56 AM
Unknown Object (File)
Apr 16 2026, 6:56 PM
Unknown Object (File)
Apr 16 2026, 2:30 PM
Subscribers

Details

Summary

When using ucl conf file format for ctld, having a duplicate lun or target make ctld segfault with :

(lldb) target create "/usr/sbin/ctld" --core "./ctld.core"
Core file '/root/./ctld.core' (x86_64) was loaded.
(lldb) bt
* thread #1, name = 'ctld', stop reason = signal SIGSEGV
  * frame #0: ctld`uclparse_conf [inlined] uclparse_target at uclparse.c:637
    frame #1: ctld`uclparse_conf at uclparse.c:374
    frame #2: ctld`uclparse_conf(newconf=<unavailable>, path=<unavailable>) at uclparse.c:919
    frame #3: ctld`conf_new_from_file(path="", oldconf=<unavailable>, ucl=<unavailable>) at ctld.c:2576
    frame #4: ctld`main(argc=<unavailable>, argv=<unavailable>) at ctld.c:2693
    frame #5: 0x0000000000402f0f ctld`_start + 383

This patch check that target_new() and lun_new() succeed.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable