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
F82017455: D12646.diff
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
Unknown Object (File)
Dec 21 2023, 11:33 PM
Unknown Object (File)
Nov 15 2023, 8:37 AM
Unknown Object (File)
Oct 12 2023, 6:53 PM
Unknown Object (File)
Sep 16 2023, 10:39 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