Re: [RFC] module: Strict per-modname namespaces
From: Peter Zijlstra
Date: Fri Nov 08 2024 - 10:36:17 EST
On Fri, Nov 08, 2024 at 04:28:58PM +0100, H. Peter Anvin wrote:
> >@@ -1700,11 +1715,7 @@ static void check_exports(struct module *mod)
> > s->crc_valid = exp->crc_valid;
> > s->crc = exp->crc;
> >
> >- basename = strrchr(mod->name, '/');
> >- if (basename)
> >- basename++;
> >- else
> >- basename = mod->name;
> >+ basename = mod_basename(mod->name);
> >
> > if (!contains_namespace(&mod->imported_namespaces, exp->namespace)) {
> > modpost_log(!allow_missing_ns_imports,
>
> I presume this only applies to code compiled as dynamic modules, not compiled into the kernel?
Yes, the built-in modules get the regular linker to resolve relocations.
Nothing much we can do about that.