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]
Message-ID: <CABVgOSnATzfTnk0q_PRxwuS79+P-sGNRAfa_JyT_yTVxQPOjUw@mail.gmail.com>
Date: Thu, 8 May 2025 14:12:21 +0800
From: David Gow <davidgow@...gle.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Shuah Khan <skhan@...uxfoundation.org>, Anton Ivanov <anton.ivanov@...bridgegreys.com>, 
	Johannes Berg <johannes@...solutions.net>, Richard Weinberger <richard@....at>, linux-um@...ts.infradead.org
Subject: Re: [PATCH] um: let 'make clean' properly clean underlying SUBARCH as well

On Wed, 7 May 2025 at 16:43, Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> Building the kernel with O= is affected by stale in-tree build artifacts.
>
> So, if the source tree is not clean, Kbuild displays the following:
>
>   $ make ARCH=um O=build defconfig
>   make[1]: Entering directory '/.../linux/build'
>   ***
>   *** The source tree is not clean, please run 'make ARCH=um mrproper'
>   *** in /.../linux
>   ***
>   make[2]: *** [/.../linux/Makefile:673: outputmakefile] Error 1
>   make[1]: *** [/.../linux/Makefile:248: __sub-make] Error 2
>   make[1]: Leaving directory '/.../linux/build'
>   make: *** [Makefile:248: __sub-make] Error 2
>
> Usually, running 'make mrproper' is sufficient for cleaning the source
> tree for out-of-tree builds.
>
> However, building UML generates build artifacts not only in arch/um/,
> but also in the SUBARCH directory (i.e., arch/x86/). If in-tree stale
> files remain under arch/x86/, Kbuild will reuse them instead of creating
> new ones under the specified build directory.
>
> This commit makes 'make ARCH=um clean' recurse into the SUBARCH directory.
>
> Reported-by: Shuah Khan <skhan@...uxfoundation.org>
> Closes: https://lore.kernel.org/lkml/20250502172459.14175-1-skhan@linuxfoundation.org/
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> ---

Thanks: thinking about it, I agree that this is the better solution,
as it handles some architecture-switching cases better.

I've tested it here, and it's definitely fixing my KUnit-based repro
case: the "The source tree is not clean, please run 'make ARCH=um
mrproper'" message appears as previously, but make ARCH=um mrproper
(from the source directory) does remove the pasyms.h file correctly.

So:

Reviewed-by: David Gow <davidgow@...gle.com>

Cheers,
-- David


>
>  arch/um/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/um/Makefile b/arch/um/Makefile
> index 1d36a613aad8..9ed792e565c9 100644
> --- a/arch/um/Makefile
> +++ b/arch/um/Makefile
> @@ -154,5 +154,6 @@ MRPROPER_FILES += $(HOST_DIR)/include/generated
>  archclean:
>         @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
>                 -o -name '*.gcov' \) -type f -print | xargs rm -f
> +       $(Q)$(MAKE) -f $(srctree)/Makefile ARCH=$(HEADER_ARCH) clean
>
>  export HEADER_ARCH SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING DEV_NULL_PATH
> --
> 2.43.0
>
>

Download attachment "smime.p7s" of type "application/pkcs7-signature" (5281 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ