Annotate geom modules with MODULE_VERSION

GEOM ELI may double ask the password during boot. Once at loader time, and
once at init time.

This happens due a module loading bug. By default GEOM ELI caches the
password in the kernel, but without the MODULE_VERSION annotation, the
kernel loads over the kernel module, even if the GEOM ELI was compiled into
the kernel. In this case, the newly loaded module
purges/invalidates/overwrites the GEOM ELI's password cache, which causes
the double asking.

MFC Note: There's a pc98 component to the original submission that is
omitted here due to pc98 removal in head. This part will need to be revived
upon MFC.

Reviewed by:	imp
Submitted by:	op
Obtained from:	opBSD
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D14992
This commit is contained in:
Kyle Evans 2018-04-10 19:18:16 +00:00
parent f98bd69cbb
commit 74d6c131cb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=332387
35 changed files with 35 additions and 0 deletions

View File

@ -292,3 +292,4 @@ static struct g_class g_bde_class = {
};
DECLARE_GEOM_CLASS(g_bde_class, g_bde);
MODULE_VERSION(geom_bde, 0);

View File

@ -1016,3 +1016,4 @@ g_cache_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp,
}
DECLARE_GEOM_CLASS(g_cache_class, g_cache);
MODULE_VERSION(geom_cache, 0);

View File

@ -993,3 +993,4 @@ g_concat_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp,
}
DECLARE_GEOM_CLASS(g_concat_class, g_concat);
MODULE_VERSION(geom_concat, 0);

View File

@ -1333,3 +1333,4 @@ g_eli_fini(struct g_class *mp)
DECLARE_GEOM_CLASS(g_eli_class, g_eli);
MODULE_DEPEND(g_eli, crypto, 1, 1, 1);
MODULE_VERSION(geom_eli, 0);

View File

@ -964,3 +964,4 @@ static moduledata_t g_gate_module = {
};
DECLARE_MODULE(geom_gate, g_gate_module, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
DECLARE_GEOM_CLASS(g_gate_class, g_gate);
MODULE_VERSION(geom_gate, 0);

View File

@ -614,3 +614,4 @@ static struct g_class g_bsd_class = {
};
DECLARE_GEOM_CLASS(g_bsd_class, g_bsd);
MODULE_VERSION(geom_bsd, 0);

View File

@ -936,3 +936,4 @@ static struct g_class g_ccd_class = {
};
DECLARE_GEOM_CLASS(g_ccd_class, g_ccd);
MODULE_VERSION(geom_ccd, 0);

View File

@ -485,3 +485,4 @@ static struct g_class g_fox_class = {
};
DECLARE_GEOM_CLASS(g_fox_class, g_fox);
MODULE_VERSION(geom_fox, 0);

View File

@ -407,3 +407,4 @@ static struct g_class g_map_class = {
.ctlreq = g_map_config,
};
DECLARE_GEOM_CLASS(g_map_class, g_map);
MODULE_VERSION(geom_map, 0);

View File

@ -528,3 +528,4 @@ static struct g_class g_mbrext_class = {
};
DECLARE_GEOM_CLASS(g_mbrext_class, g_mbrext);
MODULE_VERSION(geom_mbr, 0);

View File

@ -357,3 +357,4 @@ static struct g_class g_redboot_class = {
.ioctl = g_redboot_ioctl,
};
DECLARE_GEOM_CLASS(g_redboot_class, g_redboot);
MODULE_VERSION(geom_redboot, 0);

View File

@ -334,3 +334,4 @@ static struct g_class g_sunlabel_class = {
};
DECLARE_GEOM_CLASS(g_sunlabel_class, g_sunlabel);
MODULE_VERSION(geom_sunlabel, 0);

View File

@ -164,3 +164,4 @@ static struct g_class g_vol_ffs_class = {
};
DECLARE_GEOM_CLASS(g_vol_ffs_class, g_vol_ffs);
MODULE_VERSION(geom_vol_ffs, 0);

View File

@ -101,3 +101,4 @@ const struct g_journal_desc g_journal_ufs = {
};
MODULE_DEPEND(g_journal, ufs, 1, 1, 1);
MODULE_VERSION(geom_journal, 0);

View File

@ -556,3 +556,4 @@ g_label_config(struct gctl_req *req, struct g_class *mp, const char *verb)
}
DECLARE_GEOM_CLASS(g_label_class, g_label);
MODULE_VERSION(geom_label, 0);

View File

@ -1190,3 +1190,4 @@ static struct g_class g_llvm_class = {
};
DECLARE_GEOM_CLASS(g_llvm_class, g_linux_lvm);
MODULE_VERSION(geom_linux_lvm, 0);

View File

@ -3492,3 +3492,4 @@ g_mirror_fini(struct g_class *mp)
}
DECLARE_GEOM_CLASS(g_mirror_class, g_mirror);
MODULE_VERSION(geom_mirror, 0);

View File

@ -660,3 +660,4 @@ g_mountver_fini(struct g_class *mp)
}
DECLARE_GEOM_CLASS(g_mountver_class, g_mountver);
MODULE_VERSION(geom_mountver, 0);

View File

@ -1532,3 +1532,4 @@ g_multipath_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp,
}
DECLARE_GEOM_CLASS(g_multipath_class, g_multipath);
MODULE_VERSION(geom_multipath, 0);

View File

@ -717,3 +717,4 @@ g_nop_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp,
}
DECLARE_GEOM_CLASS(g_nop_class, g_nop);
MODULE_VERSION(geom_nop, 0);

View File

@ -107,6 +107,7 @@ static struct g_part_scheme g_part_apm_scheme = {
.gps_maxent = 4096,
};
G_PART_SCHEME_DECLARE(g_part_apm);
MODULE_VERSION(geom_part_apm, 0);
static void
swab(char *buf, size_t bufsz)

View File

@ -113,6 +113,7 @@ static struct g_part_scheme g_part_bsd_scheme = {
.gps_bootcodesz = BBSIZE,
};
G_PART_SCHEME_DECLARE(g_part_bsd);
MODULE_VERSION(geom_part_bsd, 0);
static struct g_part_bsd_alias {
uint8_t type;

View File

@ -165,6 +165,7 @@ static struct g_part_scheme g_part_bsd64_scheme = {
.gps_maxent = MAXPARTITIONS64
};
G_PART_SCHEME_DECLARE(g_part_bsd64);
MODULE_VERSION(geom_part_bsd64, 0);
#define EQUUID(a, b) (memcmp(a, b, sizeof(struct uuid)) == 0)
static struct uuid bsd64_uuid_unused = GPT_ENT_TYPE_UNUSED;

View File

@ -128,6 +128,7 @@ static struct g_part_scheme g_part_ebr_scheme = {
.gps_maxent = INT_MAX,
};
G_PART_SCHEME_DECLARE(g_part_ebr);
MODULE_VERSION(geom_part_ebr, 0);
static struct g_part_ebr_alias {
u_char typ;

View File

@ -146,6 +146,7 @@ static struct g_part_scheme g_part_gpt_scheme = {
.gps_bootcodesz = MBRSIZE,
};
G_PART_SCHEME_DECLARE(g_part_gpt);
MODULE_VERSION(geom_part_gpt, 0);
static struct uuid gpt_uuid_apple_apfs = GPT_ENT_TYPE_APPLE_APFS;
static struct uuid gpt_uuid_apple_boot = GPT_ENT_TYPE_APPLE_BOOT;

View File

@ -363,6 +363,7 @@ static struct g_part_scheme g_part_ldm_scheme = {
.gps_entrysz = sizeof(struct g_part_ldm_entry)
};
G_PART_SCHEME_DECLARE(g_part_ldm);
MODULE_VERSION(geom_part_ldm, 0);
static struct g_part_ldm_alias {
u_char typ;

View File

@ -121,6 +121,7 @@ static struct g_part_scheme g_part_mbr_scheme = {
.gps_bootcodesz = MBRSIZE,
};
G_PART_SCHEME_DECLARE(g_part_mbr);
MODULE_VERSION(geom_part_mbr, 0);
static struct g_part_mbr_alias {
u_char typ;

View File

@ -101,6 +101,7 @@ static struct g_part_scheme g_part_vtoc8_scheme = {
.gps_maxent = VTOC8_NPARTS,
};
G_PART_SCHEME_DECLARE(g_part_vtoc8);
MODULE_VERSION(geom_part_vtoc8, 0);
static int
vtoc8_parse_type(const char *type, uint16_t *tag)

View File

@ -3583,3 +3583,4 @@ g_raid3_fini(struct g_class *mp)
}
DECLARE_GEOM_CLASS(g_raid3_class, g_raid3);
MODULE_VERSION(geom_raid3, 0);

View File

@ -836,3 +836,4 @@ g_shsec_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp,
}
DECLARE_GEOM_CLASS(g_shsec_class, g_shsec);
MODULE_VERSION(geom_shsec, 0);

View File

@ -1270,3 +1270,4 @@ g_stripe_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp,
}
DECLARE_GEOM_CLASS(g_stripe_class, g_stripe);
MODULE_VERSION(geom_stripe, 0);

View File

@ -922,3 +922,4 @@ static struct g_class g_uzip_class = {
DECLARE_GEOM_CLASS(g_uzip_class, g_uzip);
MODULE_DEPEND(g_uzip, zlib, 1, 1, 1);
MODULE_VERSION(geom_uzip, 0);

View File

@ -1048,3 +1048,4 @@ static struct g_class g_vinum_class = {
};
DECLARE_GEOM_CLASS(g_vinum_class, g_vinum);
MODULE_VERSION(geom_vinum, 0);

View File

@ -1891,3 +1891,4 @@ invalid_call(void)
}
DECLARE_GEOM_CLASS(g_virstor_class, g_virstor); /* Let there be light */
MODULE_VERSION(geom_virstor, 0);

View File

@ -143,3 +143,4 @@ static struct g_class g_zero_class = {
};
DECLARE_GEOM_CLASS(g_zero_class, g_zero);
MODULE_VERSION(geom_zero, 0);