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: <CAFULd4b2azU-oBOTTXgQ6ahkVeYWHTJrnmJ97vtLm3P6jMOeug@mail.gmail.com>
Date: Sun, 6 Apr 2025 17:36:13 +0200
From: Uros Bizjak <ubizjak@...il.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-modules@...r.kernel.org, linux-kbuild@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Paul Menzel <pmenzel@...gen.mpg.de>, 
	Sami Tolvanen <samitolvanen@...gle.com>, Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] compiler.h: Avoid the usage of __typeof_unqual__() when
 __GENKSYMS__ is defined

On Fri, Apr 4, 2025 at 9:14 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> On Fri, Apr 4, 2025 at 11:37 PM Uros Bizjak <ubizjak@...il.com> wrote:
> >
> > On Fri, Apr 4, 2025 at 4:06 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
> >
> > > > > > Current version of genksyms doesn't know anything about __typeof_unqual__()
> > > > > > operator.  Avoid the usage of __typeof_unqual__() with genksyms to prevent
> > > > > > errors when symbols are versioned.
> > > > > >
> > > > > > There were no problems with gendwarfksyms.
> > > > > >
> > > > > > Signed-off-by: Uros Bizjak <ubizjak@...il.com>
> > > > > > Fixes: ac053946f5c40 ("compiler.h: introduce TYPEOF_UNQUAL() macro")
> > > > > > Reported-by: Paul Menzel <pmenzel@...gen.mpg.de>
> > > > > > Closes: https://lore.kernel.org/lkml/81a25a60-de78-43fb-b56a-131151e1c035@molgen.mpg.de/
> > > > > > Cc: Sami Tolvanen <samitolvanen@...gle.com>
> > > > > > Cc: Andrew Morton <akpm@...ux-foundation.org>
> > > > > > ---
> > > > >
> > > > >
> > > > > Why don't you add it to the genksyms keyword table?
> > > >
> > > > It doesn't work, even if I patch it with an even more elaborate patch
> > > > (attached).
> > > >
> > > > I guess some more surgery will be needed, but for now a fallback works
> > > > as expected.
> > > >
> > > > Uros.
> > >
> > > The attached patch looks good to me.
> >
> > FAOD - do you refer to the submitted one for compiler.h or to the one
> > for scripts/genksyms/keywords.c? (The latter doesn't fix the warning,
> > though).
>
>
>
> You are still seeing the warnings because __typeof_unqual__
> is not only the issue.
>
> Hint:
>
> $ make -s KCFLAGS=-D__GENKSYMS__  arch/x86/kernel/setup_percpu.i
> $ grep  'this_cpu_off;'  arch/x86/kernel/setup_percpu.i

I see.

With my workaround, this_cpu_off is declared as:

extern __attribute__((section(".data..percpu" "..hot.."
"this_cpu_off"))) __typeof__(unsigned long) this_cpu_off;

while without workaround, the same variable is declared as:

extern __seg_gs __attribute__((section(".data..percpu" "..hot.."
"this_cpu_off"))) __typeof__(unsigned long) this_cpu_off;

It looks that genksyms should be extended to handle (or ignore)
__seg_gs/__seg_fs named address prefix. Somewhat surprising, because
genksyms can process:

extern __attribute__((section(".data..percpu" "..hot.."
"const_current_task"))) __typeof__(struct task_struct * const
__seg_gs) const_current_task

without problems.

I'm sorry, but I'm not able to extend genksyms with a new keyword by myself...

Uros.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ