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)
Sat, Apr 27, 7:18 PM
Unknown Object (File)
Sat, Apr 27, 7:18 PM
Unknown Object (File)
Sat, Apr 27, 7:17 PM
Unknown Object (File)
Sat, Apr 27, 6:52 PM
Unknown Object (File)
Wed, Apr 24, 2:45 PM
Unknown Object (File)
Tue, Apr 23, 12:56 AM
Unknown Object (File)
Mar 16 2024, 11:11 AM
Unknown Object (File)
Dec 22 2023, 11:09 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