Re: [RFC] module: Strict per-modname namespaces

2024-11-08 Thread Peter Zijlstra
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 (base

Re: [RFC] module: Strict per-modname namespaces

2024-11-08 Thread H. Peter Anvin
On November 6, 2024 8:02:40 PM GMT+01:00, Peter Zijlstra wrote: >Hi, > >I've been wanting $topic for a while, and having just stumbled into the >whole namespace thing by accident, I figured I'd give it a go, most if >the hard parts seem to have already been done. > >It reserves and disallows impo

Re: [RFC] module: Strict per-modname namespaces

2024-11-08 Thread Geert Uytterhoeven
On Thu, Nov 7, 2024 at 6:39 AM Christoph Hellwig wrote: > On Wed, Nov 06, 2024 at 08:02:40PM +0100, Peter Zijlstra wrote: > > It reserves and disallows imports on any "MODULE_${name}" namespace, > > while it implicitly adds the same namespace to every module. > > Ah nice. This is pretty similar t

Re: [RFC] module: Strict per-modname namespaces

2024-11-07 Thread Peter Zijlstra
On Thu, Nov 07, 2024 at 04:55:46PM +0900, Masahiro Yamada wrote: > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c > > index 107393a8c48a..d1de3044ee03 100644 > > --- a/scripts/mod/modpost.c > > +++ b/scripts/mod/modpost.c > > @@ -1553,8 +1553,19 @@ static void mod_set_crcs(struct modu

Re: [RFC] module: Strict per-modname namespaces

2024-11-07 Thread Peter Zijlstra
On Thu, Nov 07, 2024 at 12:58:19PM +0100, Peter Zijlstra wrote: > Anyway, let me see about doing that whole ',' parsing thing people seem > to want. git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git module/namespace Seems to work with very limited testing.

Re: [RFC] module: Strict per-modname namespaces

2024-11-07 Thread Masahiro Yamada
On Thu, Nov 7, 2024 at 2:46 PM Christoph Hellwig wrote: > > On Wed, Nov 06, 2024 at 03:42:03PM -0800, Luis Chamberlain wrote: > > > This allows exports targeted at specific modules and no others -- one > > > random example included. I've hated the various kvm exports we've had > > > for a while, a

Re: [RFC] module: Strict per-modname namespaces

2024-11-06 Thread Masahiro Yamada
On Thu, Nov 7, 2024 at 4:02 AM Peter Zijlstra wrote: > > Hi, > > I've been wanting $topic for a while, and having just stumbled into the > whole namespace thing by accident, I figured I'd give it a go, most if > the hard parts seem to have already been done. > > It reserves and disallows imports o

Re: [RFC] module: Strict per-modname namespaces

2024-11-06 Thread Greg KH
On Wed, Nov 06, 2024 at 08:02:40PM +0100, Peter Zijlstra wrote: > Hi, > > I've been wanting $topic for a while, and having just stumbled into the > whole namespace thing by accident, I figured I'd give it a go, most if > the hard parts seem to have already been done. > > It reserves and disallows

Re: [RFC] module: Strict per-modname namespaces

2024-11-06 Thread Christoph Hellwig
On Wed, Nov 06, 2024 at 03:42:03PM -0800, Luis Chamberlain wrote: > > This allows exports targeted at specific modules and no others -- one > > random example included. I've hated the various kvm exports we've had > > for a while, and strictly limiting them to the kvm module helps > > alleviate som

Re: [RFC] module: Strict per-modname namespaces

2024-11-06 Thread Christoph Hellwig
On Wed, Nov 06, 2024 at 08:02:40PM +0100, Peter Zijlstra wrote: > It reserves and disallows imports on any "MODULE_${name}" namespace, > while it implicitly adds the same namespace to every module. Ah nice. This is pretty similar to what I want and had badly prototyped a while ago. > This allows

Re: [RFC] module: Strict per-modname namespaces

2024-11-06 Thread Luis Chamberlain
On Wed, Nov 06, 2024 at 08:02:40PM +0100, Peter Zijlstra wrote: > Hi, > > I've been wanting $topic for a while, and having just stumbled into the > whole namespace thing by accident, I figured I'd give it a go, most if > the hard parts seem to have already been done. Neat, hch suggested something

[RFC] module: Strict per-modname namespaces

2024-11-06 Thread Peter Zijlstra
Hi, I've been wanting $topic for a while, and having just stumbled into the whole namespace thing by accident, I figured I'd give it a go, most if the hard parts seem to have already been done. It reserves and disallows imports on any "MODULE_${name}" namespace, while it implicitly adds the same