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: <CAAhV-H5oHPG+etNawAmVwyDtg80iKUrAM_m3Vj57bBO0scHqvQ@mail.gmail.com>
Date: Tue, 24 Jun 2025 20:31:12 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Kees Cook <kees@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>, WANG Xuerui <kernel@...0n.name>, 
	Thomas Gleixner <tglx@...utronix.de>, Tianyang Zhang <zhangtianyang@...ngson.cn>, 
	Bibo Mao <maobibo@...ngson.cn>, Jiaxun Yang <jiaxun.yang@...goat.com>, loongarch@...ts.linux.dev, 
	"Gustavo A. R. Silva" <gustavoars@...nel.org>, Christoph Hellwig <hch@....de>, Marco Elver <elver@...gle.com>, 
	Andrey Konovalov <andreyknvl@...il.com>, Andrey Ryabinin <ryabinin.a.a@...il.com>, 
	Ard Biesheuvel <ardb@...nel.org>, Masahiro Yamada <masahiroy@...nel.org>, 
	Nathan Chancellor <nathan@...nel.org>, Nicolas Schier <nicolas.schier@...ux.dev>, 
	Nick Desaulniers <nick.desaulniers+lkml@...il.com>, Bill Wendling <morbo@...gle.com>, 
	Justin Stitt <justinstitt@...gle.com>, linux-kernel@...r.kernel.org, x86@...nel.org, 
	kasan-dev@...glegroups.com, linux-doc@...r.kernel.org, 
	linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.linux.dev, 
	linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org, 
	linux-efi@...r.kernel.org, linux-hardening@...r.kernel.org, 
	linux-kbuild@...r.kernel.org, linux-security-module@...r.kernel.org, 
	linux-kselftest@...r.kernel.org, sparclinux@...r.kernel.org, 
	llvm@...ts.linux.dev
Subject: Re: [PATCH v2 10/14] loongarch: Handle KCOV __init vs inline mismatches

Hi, Kees,

On Thu, Jun 19, 2025 at 4:55 PM Huacai Chen <chenhuacai@...nel.org> wrote:
>
> Hi, Kees,
>
> On Fri, May 23, 2025 at 12:39 PM Kees Cook <kees@...nel.org> wrote:
> >
> > When KCOV is enabled all functions get instrumented, unless
> > the __no_sanitize_coverage attribute is used. To prepare for
> > __no_sanitize_coverage being applied to __init functions, we have to
> > handle differences in how GCC's inline optimizations get resolved. For
> > loongarch this exposed several places where __init annotations were
> > missing but ended up being "accidentally correct". Fix these cases and
> > force one function to be inline with __always_inline.
> >
> > Signed-off-by: Kees Cook <kees@...nel.org>
> > ---
> > Cc: Huacai Chen <chenhuacai@...nel.org>
> > Cc: WANG Xuerui <kernel@...0n.name>
> > Cc: Thomas Gleixner <tglx@...utronix.de>
> > Cc: Tianyang Zhang <zhangtianyang@...ngson.cn>
> > Cc: Bibo Mao <maobibo@...ngson.cn>
> > Cc: Jiaxun Yang <jiaxun.yang@...goat.com>
> > Cc: <loongarch@...ts.linux.dev>
> > ---
> >  arch/loongarch/include/asm/smp.h | 2 +-
> >  arch/loongarch/kernel/time.c     | 2 +-
> >  arch/loongarch/mm/ioremap.c      | 4 ++--
> >  3 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/loongarch/include/asm/smp.h b/arch/loongarch/include/asm/smp.h
> > index ad0bd234a0f1..88e19d8a11f4 100644
> > --- a/arch/loongarch/include/asm/smp.h
> > +++ b/arch/loongarch/include/asm/smp.h
> > @@ -39,7 +39,7 @@ int loongson_cpu_disable(void);
> >  void loongson_cpu_die(unsigned int cpu);
> >  #endif
> >
> > -static inline void plat_smp_setup(void)
> > +static __always_inline void plat_smp_setup(void)
> Similar to x86 and arm, I prefer to mark it as __init rather than
> __always_inline.
If you have no objections, I will apply this patch with the above modification.


Huacai

>
> Huacai
>
> >  {
> >         loongson_smp_setup();
> >  }
> > diff --git a/arch/loongarch/kernel/time.c b/arch/loongarch/kernel/time.c
> > index bc75a3a69fc8..367906b10f81 100644
> > --- a/arch/loongarch/kernel/time.c
> > +++ b/arch/loongarch/kernel/time.c
> > @@ -102,7 +102,7 @@ static int constant_timer_next_event(unsigned long delta, struct clock_event_dev
> >         return 0;
> >  }
> >
> > -static unsigned long __init get_loops_per_jiffy(void)
> > +static unsigned long get_loops_per_jiffy(void)
> >  {
> >         unsigned long lpj = (unsigned long)const_clock_freq;
> >
> > diff --git a/arch/loongarch/mm/ioremap.c b/arch/loongarch/mm/ioremap.c
> > index 70ca73019811..df949a3d0f34 100644
> > --- a/arch/loongarch/mm/ioremap.c
> > +++ b/arch/loongarch/mm/ioremap.c
> > @@ -16,12 +16,12 @@ void __init early_iounmap(void __iomem *addr, unsigned long size)
> >
> >  }
> >
> > -void *early_memremap_ro(resource_size_t phys_addr, unsigned long size)
> > +void * __init early_memremap_ro(resource_size_t phys_addr, unsigned long size)
> >  {
> >         return early_memremap(phys_addr, size);
> >  }
> >
> > -void *early_memremap_prot(resource_size_t phys_addr, unsigned long size,
> > +void * __init early_memremap_prot(resource_size_t phys_addr, unsigned long size,
> >                     unsigned long prot_val)
> >  {
> >         return early_memremap(phys_addr, size);
> > --
> > 2.34.1
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ