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]
Message-ID: <Y1ewrRpHBwg2wJnb@FVFF77S0Q05N>
Date:   Tue, 25 Oct 2022 10:47:25 +0100
From:   Mark Rutland <mark.rutland@....com>
To:     Guo Ren <guoren@...nel.org>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Lai Jiangshan <laijs@...ux.alibaba.com>, arnd@...db.de,
        palmer@...osinc.com, tglx@...utronix.de, luto@...nel.org,
        conor.dooley@...rochip.com, heiko@...ech.de, jszhang@...nel.org,
        lazyparser@...il.com, falcon@...ylab.org, chenhuacai@...nel.org,
        apatel@...tanamicro.com, atishp@...shpatra.org, palmer@...belt.com,
        paul.walmsley@...ive.com, zouyipeng@...wei.com,
        bigeasy@...utronix.de, David.Laight@...lab.com,
        chenzhongjin@...wei.com, linux-arch@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
        Borislav Petkov <bp@...en8.de>,
        Miguel Ojeda <ojeda@...nel.org>,
        Kees Cook <keescook@...omium.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: [PATCH V6 04/11] compiler_types.h: Add __noinstr_section() for
 noinstr

On Tue, Oct 25, 2022 at 10:51:02AM +0800, Guo Ren wrote:
> On Mon, Oct 24, 2022 at 8:14 PM Mark Rutland <mark.rutland@....com> wrote:
> >
> > On Mon, Oct 24, 2022 at 02:06:04PM +0200, Peter Zijlstra wrote:
> > > On Mon, Oct 24, 2022 at 12:56:03PM +0100, Mark Rutland wrote:
> > >
> > > > How about we split this like:
> > > >
> > > > | /*
> > > > |  * Prevent the compiler from instrumenting this code in any way
> > > > |  * This does not prevent instrumentation via KPROBES, which must be
> > > > |  * prevented through other means if necessary.
> > >
> > > Perhaps point to NOINSTR_TEXT in vmlinux.lds.h
> >
> > Makes sense, will do.
> Do I need to update the comment with NOINSTR_TEXT? eg:
> 
>  * Prevent the compiler from instrumenting this code in any way
>  * This does not prevent instrumentation via KPROBES, which must be
>  * prevented through other means if necessary. See NOINSTR_TEXT
>  * in vmlinux.lds.h.

I think given Peter's reply we can leave the patch as-is for now, and we can
leave commentary or other changes to a later follow up. I'm happy to propose
patches for that once the existing bits are merged.

Sorry for confusing matters!

> > > > |  */
> > > > | #define __no_compiler_instrument                          \
> > > > |   noinline notrace noinline notrace __no_kcsan            \
> > > > |   __no_sanitize_address __no_sanitize_coverage
> > > > |
> > > > | /*
> > > > |  * Section for code which can't be instrumented at all.
> > > > |  * Any code in this section cannot be instrumented with KPROBES.
> > > > |  */
> > > > | #define noinstr __no_compiler_instrument section(".noinstr.text")
> > > >
> > > > ... then we don't need __noinstr_section(), and IMO the split is
> > > > clearer.
> > >
> > > Yeah, perhaps, no strong feelings. Note I have this in the sched-idle
> > > series as well (which I still need to rebase and repost :/).
> >
> > Ah; I'll sit on this for now then, and once that's all in I can send a
> > cleanup/rework patch. Sorry for the noise!
> We still keep __noinstr_section(), right?

Yes -- for now this patch can stay as-is, and __noinstr_section() will remain.

Thanks,
Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ