[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202210241031.4BB6E70FB@keescook>
Date: Mon, 24 Oct 2022 10:32:58 -0700
From: Kees Cook <keescook@...omium.org>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Xin Li <xin3.li@...el.com>, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, linux-kbuild@...r.kernel.org, x86@...nel.org,
andrew.cooper3@...rix.com, hpa@...or.com, peterz@...radead.org
Subject: Re: [PATCH 1/1] kbuild: upgrade the orphan section warning to an
error if CONFIG_WERROR is set
On Mon, Oct 24, 2022 at 10:29:55AM -0700, Nathan Chancellor wrote:
> On Fri, Oct 21, 2022 at 08:05:19PM -0700, Xin Li wrote:
> > Andrew Cooper suggested upgrading the orphan section warning to a hard link
> > error. However Nathan Chancellor said outright turning the warning into an
> > error with no escape hatch might be too aggressive, as we have had these
> > warnings triggered by new compiler generated sections, and suggested turning
> > orphan sections into an error only if CONFIG_WERROR is set. Kees Cook echoed
> > and emphasized that the mandate from Linus is that we should avoid breaking
> > builds. It wrecks bisection, it causes problems across compiler versions, etc.
> >
> > Thus upgrade the orphan section warning to a hard link error only if
> > CONFIG_WERROR is set.
> >
> > Suggested-by: Andrew Cooper <andrew.cooper3@...rix.com>
> > Suggested-by: Nathan Chancellor <nathan@...nel.org>
> > Signed-off-by: Xin Li <xin3.li@...el.com>
>
> Thanks for the patch!
>
> Reviewed-by: Nathan Chancellor <nathan@...nel.org>
> Tested-by: Nathan Chancellor <nathan@...nel.org>
>
> We could deduplicate the '$(if $(CONFIG_WERROR),error,warn)' logic if we
> hoisted it into Kconfig by having something like
>
> config LD_ORPHAN_WARN_LEVEL
> string
> depends on LD_ORPHAN_WARN
> default "error" if WERROR
> default "warn"
>
> in init/Kconfig then using it everywhere like
>
> --orphan-handling=$(CONFIG_LD_ORPHAN_WARN_LEVEL)
>
> but I will let others decide if they would prefer that over the
> direction we went here.
I think this makes it look cleaner, yeah.
--
Kees Cook
Powered by blists - more mailing lists