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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 14 Jul 2023 16:34:45 +0200
From:   Michal Suchánek <msuchanek@...e.de>
To:     Nicolas Schier <nicolas@...sle.eu>
Cc:     linux-modules@...r.kernel.org, Takashi Iwai <tiwai@...e.com>,
        Lucas De Marchi <lucas.de.marchi@...il.com>,
        Michal KoutnĂ˝ <mkoutny@...e.com>,
        Jiri Slaby <jslaby@...e.com>, Jan Engelhardt <jengelh@...i.de>,
        Masahiro Yamada <masahiroy@...nel.org>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH kmod v2 2/4] libkmod, depmod: Load modprobe.d, depmod.d
 from $prefix/lib.

On Fri, Jul 14, 2023 at 04:16:44PM +0200, Nicolas Schier wrote:
> On Wed, Jul 12, 2023 at 04:00:46PM +0200 Michal Suchanek wrote:
> > There is an ongoing effort to limit use of files outside of /usr (or
> > $prefix on general). Currently all modprobe.d paths are hardcoded to
> > outside of $prefix. Teach kmod to load modprobe.d from $prefix/lib.
> > 
> > On some distributions /usr/lib and /lib are the same directory because
> > of a compatibility symlink, and it is possible to craft configuration
> > files with sideeffects that would behave differently when loaded twice.
> > However, the override semantic ensures that one 'overrides' the other,
> > and only one configuration file of the same name is loaded from any of
> > the search directories.
> > 
> > Signed-off-by: Michal Suchanek <msuchanek@...e.de>
> > ---
> > v2: Fix commit message typo
> > ---
> >  Makefile.am        | 1 +
> >  libkmod/libkmod.c  | 3 ++-
> >  man/Makefile.am    | 9 +++++++--
> >  man/depmod.d.xml   | 1 +
> >  man/modprobe.d.xml | 1 +
> >  tools/depmod.c     | 1 +
> >  6 files changed, 13 insertions(+), 3 deletions(-)
> > 
> > diff --git a/Makefile.am b/Makefile.am
> > index 8ba85c91a0f3..7aa5bfa5638d 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -19,6 +19,7 @@ AM_CPPFLAGS = \
> >  	-include $(top_builddir)/config.h \
> >  	-I$(top_srcdir) \
> >  	-DSYSCONFDIR=\""$(sysconfdir)"\" \
> > +	-DPREFIX=\""$(prefix)"\" \
> >  	${zlib_CFLAGS}
> >  
> >  AM_CFLAGS = $(OUR_CFLAGS)
> > diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c
> > index 2670f9a4611a..13c82b069e84 100644
> > --- a/libkmod/libkmod.c
> > +++ b/libkmod/libkmod.c
> > @@ -65,6 +65,7 @@ static const char *const default_config_paths[] = {
> >  	SYSCONFDIR "/modprobe.d",
> >  	"/run/modprobe.d",
> >  	"/usr/local/lib/modprobe.d",
> > +	PREFIX "/lib/modprobe.d",
> >  	"/lib/modprobe.d",
> >  	NULL
> >  };
> > @@ -237,7 +238,7 @@ static char *get_kernel_release(const char *dirname)
> >   *                to load from user-defined configuration parameters such as
> >   *                alias, blacklists, commands (install, remove). If NULL
> >   *                defaults to /etc/modprobe.d, /run/modprobe.d,
> > - *                /usr/local/lib/modprobe.d and /lib/modprobe.d. Give an empty
> > + *                /usr/local/lib/modprobe.d and PREFIX/lib/modprobe.d. Give an empty
> 
> In the chunk above, there still is /lib/modprobe.d included in the
> default_config_paths array.

Indeed, if this is rendered as documentation somewhere this would be
misleading.

Thanks

Michal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ