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:   Thu, 23 Dec 2021 09:35:57 +0100
From:   Petr Vorel <pvorel@...e.cz>
To:     Mimi Zohar <zohar@...ux.ibm.com>
Cc:     linux-integrity@...r.kernel.org,
        Nageswara Sastry <rnsastry@...ux.ibm.com>,
        Takashi Iwai <tiwai@...e.de>, Joey Lee <jlee@...e.com>,
        Shuah Khan <shuah@...nel.org>, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/2] selftests/kexec: update searching for the Kconfig

> First check /lib/modules/`uname -r`/config, before using the IKCONFIG.
> In addition, the configs.ko might be compressed.  Fix the configs.ko
> name.

> Signed-off-by: Mimi Zohar <zohar@...ux.ibm.com>
> ---
> Distros: is storing the Kconfig in /lib/modules/`uname -r`/config common?

>  tools/testing/selftests/kexec/kexec_common_lib.sh | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)

> diff --git a/tools/testing/selftests/kexec/kexec_common_lib.sh b/tools/testing/selftests/kexec/kexec_common_lib.sh
> index 43017cfe88f7..5a1b8ae04c64 100755
> --- a/tools/testing/selftests/kexec/kexec_common_lib.sh
> +++ b/tools/testing/selftests/kexec/kexec_common_lib.sh
> @@ -138,15 +138,20 @@ kconfig_enabled()
>  	return 0
>  }

> -# Attempt to get the kernel config first via proc, and then by
> -# extracting it from the kernel image or the configs.ko using
> -# scripts/extract-ikconfig.
> +# Attempt to get the kernel config first by checking the modules directory
> +# then via proc, and finally by extracting it from the kernel image or the
> +# configs.ko using scripts/extract-ikconfig.
>  # Return 1 for found.
>  get_kconfig()
>  {
>  	local proc_config="/proc/config.gz"
>  	local module_dir="/lib/modules/`uname -r`"
> -	local configs_module="$module_dir/kernel/kernel/configs.ko"
> +	local configs_module="$module_dir/kernel/kernel/configs.ko*"
I wonder if * will later work:

if [ ! -f $configs_module ]; then

But there should be just one variant: either configs.ko or configs.ko.xz
(or something other), so it should work, right?

Thus
Reviewed-by: Petr Vorel <pvorel@...e.cz>

Kind regards,
Petr

> +
> +	if [ -f $module_dir/config ]; then
> +		IKCONFIG=$module_dir/config
> +		return 1
> +	fi

>  	if [ ! -f $proc_config ]; then
>  		modprobe configs > /dev/null 2>&1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ