Author: pjd
Date: Tue Oct 25 13:44:23 2011
New Revision: 226730
URL: http://svn.freebsd.org/changeset/base/226730
Log:
When decoding metadata, check magic string, so we know this is not GELI device
before we check its version. We don't want to report that some garbage is
unsupported version if this is not even GELI provider.
MFC after: 3 days
Modified:
head/sys/geom/eli/g_eli.h
Modified: head/sys/geom/eli/g_eli.h
==============================================================================
--- head/sys/geom/eli/g_eli.h Tue Oct 25 13:41:12 2011 (r226729)
+++ head/sys/geom/eli/g_eli.h Tue Oct 25 13:44:23 2011 (r226730)
@@ -294,6 +294,8 @@ eli_metadata_decode(const u_char *data,
int error;
bcopy(data, md->md_magic, sizeof(md->md_magic));
+ if (strcmp(md->md_magic, G_ELI_MAGIC) != 0)
+ return (EINVAL);
md->md_version = le32dec(data + sizeof(md->md_magic));
switch (md->md_version) {
case G_ELI_VERSION_00:
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"