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: <20251031114919.GBaQSiPxZrziOs3RCW@fat_crate.local>
Date: Fri, 31 Oct 2025 12:49:19 +0100
From: Borislav Petkov <bp@...en8.de>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-tip-commits@...r.kernel.org,
	Petr Mladek <pmladek@...e.com>,
	Joe Lawrence <joe.lawrence@...hat.com>, x86@...nel.org,
	Nathan Chancellor <nathan@...nel.org>
Subject: Re: [tip: objtool/core] objtool/klp: Add --debug option to show
 cloning decisions

+ Nathan.

Hey,

On Thu, Oct 16, 2025 at 09:52:15AM -0000, tip-bot2 for Josh Poimboeuf wrote:
> The following commit has been merged into the objtool/core branch of tip:
> 
> Commit-ID:     7c2575a6406fb85946b05d8dcc856686d3156354
> Gitweb:        https://git.kernel.org/tip/7c2575a6406fb85946b05d8dcc856686d3156354
> Author:        Josh Poimboeuf <jpoimboe@...nel.org>
> AuthorDate:    Wed, 17 Sep 2025 09:04:00 -07:00
> Committer:     Josh Poimboeuf <jpoimboe@...nel.org>
> CommitterDate: Tue, 14 Oct 2025 14:50:18 -07:00
> 
> objtool/klp: Add --debug option to show cloning decisions
> 
> Add a --debug option to klp diff which prints cloning decisions and an
> indented dependency tree for all cloned symbols and relocations.  This
> helps visualize which symbols and relocations were included and why.
> 
> Acked-by: Petr Mladek <pmladek@...e.com>
> Tested-by: Joe Lawrence <joe.lawrence@...hat.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
> ---

...

> +#define dbg_indent(args...)						\
> +	int __attribute__((cleanup(unindent))) __dummy_##__COUNTER__;	\

so this compiler:

Ubuntu clang version 15.0.7

doesn't like this, see below. With some configs only, I've attached one.

Newer clang is fine so I guess this old one which we support can't do that
unused var squashing or so.

How about this fix?

Seems to work here.

---

diff --git a/tools/objtool/include/objtool/warn.h b/tools/objtool/include/objtool/warn.h
index e88322d97573..289fbce428c5 100644
--- a/tools/objtool/include/objtool/warn.h
+++ b/tools/objtool/include/objtool/warn.h
@@ -127,7 +127,7 @@ static inline void unindent(int *unused) { indent--; }
 })
 
 #define dbg_indent(args...)                                            \
-       int __attribute__((cleanup(unindent))) __dummy_##__COUNTER__;   \
+       int __attribute__((cleanup(unindent))) __used __dummy_##__COUNTER__; \
        __dbg_indent(args);                                             \
        indent++
 
---

build error:

---

klp-diff.c:601:2: error: unused variable '__dummy___COUNTER__' [-Werror,-Wunused-variable]
        dbg_indent("%s%s", patched_sym->name, data_too ? " [+DATA]" : "");
        ^
/home/amd/kernel/linux/tools/objtool/include/objtool/warn.h:130:41: note: expanded from macro 'dbg_indent'
        int __attribute__((cleanup(unindent))) __dummy_##__COUNTER__;   \
                                               ^
<scratch space>:132:1: note: expanded from here
__dummy___COUNTER__
^
klp-diff.c:1045:2: error: unused variable '__dummy___COUNTER__' [-Werror,-Wunused-variable]
        dbg_clone_reloc(sec, offset, patched_sym, addend, export, klp);
        ^
klp-diff.c:1016:2: note: expanded from macro 'dbg_clone_reloc'
        dbg_indent("%s+0x%lx: %s%s0x%lx [%s%s%s%s%s%s]",                                \
        ^
/home/amd/kernel/linux/tools/objtool/include/objtool/warn.h:130:41: note: expanded from macro 'dbg_indent'
        int __attribute__((cleanup(unindent))) __dummy_##__COUNTER__;   \
                                               ^
<scratch space>:138:1: note: expanded from here
__dummy___COUNTER__
^
2 errors generated.
make[4]: *** [/home/amd/kernel/linux/tools/build/Makefile.build:85: /home/amd/kernel/linux/tools/objtool/klp-diff.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:81: /home/amd/kernel/linux/tools/objtool/objtool-in.o] Error 2
make[2]: *** [Makefile:73: objtool] Error 2
make[1]: *** [/home/amd/kernel/linux/Makefile:1449: tools/objtool] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:248: __sub-make] Error 2

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

View attachment "00-04-02-randconfig-x86_64-16844.cfg" of type "text/plain" (172117 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ