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:   Tue, 04 May 2021 22:17:30 +0200
From:   Johannes Berg <johannes@...solutions.net>
To:     Masahiro Yamada <masahiroy@...nel.org>,
        linux-kbuild@...r.kernel.org
Cc:     Nick Desaulniers <ndesaulniers@...gle.com>,
        Arvind Sankar <nivedita@...m.mit.edu>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Brendan Higgins <brendanhiggins@...gle.com>,
        Catalin Marinas <catalin.marinas@....com>,
        Changbin Du <changbin.du@...el.com>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
        Randy Dunlap <rdunlap@...radead.org>,
        Will Deacon <will@...nel.org>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] kconfig: unify cc-option and as-option

Hi,

So... I realized it's been a while:

On Sun, 2020-06-14 at 23:43 +0900, Masahiro Yamada wrote:
> cc-option and as-option are almost the same; both pass the flag to
> $(CC). The main difference is the cc-option stops before the assemble
> stage (-S option) whereas as-option stops after it (-c option).
> 

But, I had noticed for a while now that M= build for an out-of-tree
driver were causing some trouble. Not really completely "out-of-tree"
but rather backported (https://backports.wiki.kernel.org/).

And then I finally narrowed it down to this commit, specifically this:

>  # Return y if the compiler supports <flag>, n otherwise
> -cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -S -x c /dev/null -o /dev/null)
> +cc-option = $(success,mkdir .tmp_$$$$; trap "rm -rf .tmp_$$$$" EXIT; $(CC) -Werror $(CLANG_FLAGS) $(1) -c -x c /dev/null -o .tmp_$$$$/tmp.o)

What happens is that we're doing

 make -C /path/to/kernel M=/path/to/driver

But /path/to/kernel may be the installed distro kernel headers, and thus
not be writable to the user doing the driver compile. Obviously, the
user may need to 'sudo' anyway to install the result, but if just test-
compiling, or even as better practice to not run everything as root,
this ".tmp_$$" dir cannot be created.

IOW, this broke compiler option detection when KBUILD_EXTMOD=/M= is
used. It seems this is still supported (documented in kbuild docs), so
I'm kind of hoping it could be fixed? But OTOH, I really don't know how,
perhaps just using "mktemp -d" here instead of the hardcoded temp dir?

Thanks,
johannes

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ