lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241230134212.18af06f8@dsl-u17-10>
Date: Mon, 30 Dec 2024 13:42:12 +0000
From: David Laight <david.laight.linux@...il.com>
To: Uwe Kleine-König <u.kleine-koenig@...libre.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>, andi.shyti@...nel.org,
 andriy.shevchenko@...ux.intel.com, masahiroy@...nel.org,
 linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org
Subject: Re: [PATCH] module: Allow DEFAULT_SYMBOL_NAMESPACE be set after
 export.h included

On Mon, 30 Dec 2024 13:54:45 +0100
Uwe Kleine-König <u.kleine-koenig@...libre.com> wrote:

> Hello David,
> 
> On Mon, Dec 30, 2024 at 12:03:03PM +0000, David Laight wrote:
> > On Mon, 30 Dec 2024 10:42:55 +0100
> > Uwe Kleine-König <u.kleine-koenig@...libre.com> wrote:
> >   
> > > On Sun, Dec 29, 2024 at 12:59:36AM +0000, David Laight wrote:  
> > > > On Sat, 28 Dec 2024 15:29:24 -0800
> > > > Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> > > >     
> > > > > On Sat, 28 Dec 2024 at 10:43, David Laight <david.laight.linux@...il.com> wrote:    
> > > > > >
> > > > > > Instead just default DEFAULT_SYMBOL_NAMESPACE to "" and remove the
> > > > > > extra _EXPORT_SYMBOL() wrapper.
> > > > > >
> > > > > > This lets DEFAULT_SYMBOL_NAMESPACE be defined after export.h is included.      
> > > > > 
> > > > > Grr. This is horribly ugly.    
> > > > 
> > > > I thought it was a neater 'ugly' than the current definitions in export.h
> > > >     
> > > > > I think the i2c code should just be fixed to use the proper "define
> > > > > namespace early".    
> > > > 
> > > > The i2c changes were needed because I found the code wouldn't compile.
> > > > It is pretty easy mistake to make and will happen again.    
> > > 
> > > There is
> > > https://lore.kernel.org/linux-i2c/20241203173640.1648939-2-u.kleine-koenig@baylibre.com
> > > that moves the DEFAULT_SYMBOL_NAMESPACE above the #include block for the
> > > i2c driver. Though it seems I missed ...master.c. (I'll address that.)
> > >   
> > > > and does - I missed drivers/pwm/pwm-lpss.c drivers/hwmon/nct6775-core.c
> > > > and drivers/pwm/pwm-lpss.c    
> > > 
> > > drivers/pwm/pwm-lpss.c is addressed by
> > > https://lore.kernel.org/linux-pwm/cover.1733245406.git.ukleinek@kernel.org
> > > 
> > > the hwmon driver is addressed by
> > > https://lore.kernel.org/linux-hwmon/20241203173149.1648456-2-u.kleine-koenig@baylibre.com
> > > (and applied in next)
> > > 
> > > There is also drivers/gpio/gpio-idio-16.c (which I guess you intended to
> > > list instead of the pwm driver twice), which I sent a patch for at
> > > https://lore.kernel.org/linux-gpio/20241203172631.1647792-2-u.kleine-koenig@baylibre.com
> > > (also already applied in next).  
> > 
> > 
> > With all those applied it is probably worth applying my change to export.h
> > (which is all I really wanted to do - until the build failures.)
> > 
> > diff --git a/include/linux/export.h b/include/linux/export.h
> > index 2633df4d31e6..6cea1c3982cd 100644
> > --- a/include/linux/export.h
> > +++ b/include/linux/export.h
> > @@ -59,14 +59,12 @@
> > 
> >  #endif
> > 
> > -#ifdef DEFAULT_SYMBOL_NAMESPACE
> > -#define _EXPORT_SYMBOL(sym, license)   __EXPORT_SYMBOL(sym, license, DEFAULT_SYMBOL_NAMESPACE)  
> 
> If you keep the above definition (without the #ifdef), you don't need to
> touch the definitions of EXPORT_SYMBOL and EXPORT_SYMBOL_GPL below.
> Probably a matter of taste.

The extra wrapper just makes it harder to read (and will be immeasurably slower to
compile).

> > -#else
> > -#define _EXPORT_SYMBOL(sym, license)   __EXPORT_SYMBOL(sym, license, "")
> > +#ifndef DEFAULT_SYMBOL_NAMESPACE
> > +#define DEFAULT_SYMBOL_NAMESPACE ""
> >  #endif
> > 
> > -#define EXPORT_SYMBOL(sym)             _EXPORT_SYMBOL(sym, "")
> > -#define EXPORT_SYMBOL_GPL(sym)         _EXPORT_SYMBOL(sym, "GPL")
> > +#define EXPORT_SYMBOL(sym)             __EXPORT_SYMBOL(sym, "", DEFAULT_SYMBOL_NAMESPACE)
> > +#define EXPORT_SYMBOL_GPL(sym)         __EXPORT_SYMBOL(sym, "GPL", DEFAULT_SYMBOL_NAMESPACE)
> >  #define EXPORT_SYMBOL_NS(sym, ns)      __EXPORT_SYMBOL(sym, "", ns)
> >  #define EXPORT_SYMBOL_NS_GPL(sym, ns)  __EXPORT_SYMBOL(sym, "GPL", ns)
> > 
> > It would be 'nice' to get that into 6.13 (along with the other changes that
> > remove __stringify()) - but it is getting late in the rc cycle now.  
> 
> I'm pretty sure we won't get all my changes into v6.13.

Indeed: Linus would have to like them and 'just apply them' :-)

	David

> 
> Best regards
> Uwe


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ