Created attachment 154744 [details] Add error check g_eli_read_metadata() doesn't check the return value of eli_metadata_read(). Because of that, if eli_metadata_read() fails, the g_eli_metadata struct passed isn't changed (and so probably contains garbage from the caller), but g_eli_read_metadata() returns success, so the caller will try using it. The goto in the patch is redundant with the current code, but is added for symmetry with other earlier error checks, and for safety if anything else later gets added to the function.
A commit references this bug: Author: pjd Date: Thu Jul 2 10:57:35 UTC 2015 New revision: 285024 URL: https://svnweb.freebsd.org/changeset/base/285024 Log: Properly propagate errors in metadata reading. PR: 198860 Submitted by: Matthew D. Fuller Changes: head/sys/geom/eli/g_eli.c