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] [day] [month] [year] [list]
Date:   Fri, 21 Apr 2017 21:52:54 +0200
From:   Michal Marek <mmarek@...e.com>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>,
        linux-kbuild@...r.kernel.org
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Greg KH <gregkh@...uxfoundation.org>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        x86@...nel.org, Sam Ravnborg <sam@...nborg.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [RFC-b PATCH] kbuild: redefine __FILE__ as relative path from
 $(srctree) if possible

Dne 21.4.2017 v 21:36 Masahiro Yamada napsal(a):
> Since Kbuild runs in the objtree, __FILE__ can be a very long path
> depending of $(srctree).
> 
> Commit 9da0763bdd82 ("kbuild: Use relative path when building in a
> subdir of the source tree") made the situation better for cases
> where objtree is a child of srctree.  ($(srctree) is "..")
> 
> For other cases of out-of-tree build, filenames in WARN_ON() etc.
> are still an absolute path.  It also means the kernel image depends
> on where it was built.
> 
> Here, the idea is to redefine __FILE__ as the relative path from
> $(srctree), but doing so causes a compiler warning:
>   warning: "__FILE__" redefined [-Wbuiltin-macro-redefined]
> 
> We can suppress it with -Wno-builtin-macro-redefined.  However,
> this option is not recognized by old compilers.  So, __FILE__
> is re-defined only when the option is supported.

I actually like the KBUILD_FILE approach more, even if it means patching
various users.


> Please note __FILE__ is always an absolute path for external
> modules.  We can strip KBUILD_EXTMOD from the path if we want,
> but I am not doing that.  It would make it difficult to figure out
> the module in question in case of WARN_ON().

Agreed. OOT modules are potential source of trouble, so let them stand out.

Michal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ