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)
Thu, Apr 16, 6:56 PM
Unknown Object (File)
Thu, Apr 16, 2:30 PM
Unknown Object (File)
Wed, Apr 15, 11:44 PM
Unknown Object (File)
Tue, Apr 14, 8:54 PM
Unknown Object (File)
Sun, Apr 12, 2:20 AM
Unknown Object (File)
Fri, Mar 27, 11:43 PM
Unknown Object (File)
Tue, Mar 24, 4:22 PM
Unknown Object (File)
Tue, Mar 24, 1:18 AM
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