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]
Date:   Tue, 20 Sep 2022 18:31:24 -0700
From:   Nadav Amit <nadav.amit@...il.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     "Steven Rostedt (Google)" <rostedt@...dmis.org>,
        LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Borislav Petkov <bp@...en8.de>, Ingo Molnar <mingo@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [RFC PATCH] x86/syscalls: allow tracing of __do_sys_[syscall]
 functions

Just following my questions with the answers I figured out, just to save
others time.

On Sep 20, 2022, at 9:48 AM, Nadav Amit <nadav.amit@...il.com> wrote:

> On Sep 20, 2022, at 4:02 AM, Peter Zijlstra <peterz@...radead.org> wrote:
> 
>> On Mon, Sep 19, 2022 at 07:35:42PM -0700, Nadav Amit wrote:
>> 
>>> 1. What is the reason that inline functions are marked with notrace?
>> 
>> IIRC the concern is that a notrace function using an inline function;
>> GCC deciding to not inline and then still hitting tracing.
>> 
>> For noinstr we've mandated __always_inline to avoid this problem. The
>> direct advantage is that those inlined into instrumented code get, well,
>> instrumented.

Commit 45959ee7aa645 (“ftrace: Do not function trace inlined functions”)
gives two reasons which correspond with what you were saying: (1)
consistency and (2) function that should not be traced are mostly marked as
inline.

I am not sure I fully agree with the arguments, specifically the consistency
(any function might be inlined and not traceable). But I am too afraid/lazy
to cause damage and fix it. I will remove the inline and play a bit with the
kernel to see how it behaves.

>>> 2. Is probing function that is called from do_idle() supposed to work, or
>>>  should the kernel prevent it?
>> 
>> Should work for some :-) Specifically it doesn't work for those that
>> disable RCU, and that's (largely) being fixed here:
>> 
>> https://lore.kernel.org/all/20220919095939.761690562@infradead.org/T/#u
>> 
>> Although looking at it just now, I think I missed a spot.. lemme go fix
>> ;-)

I did not try your patches, but I do think I figured out what’s wrong and
sent a patch.

https://lore.kernel.org/lkml/EECE6FD7-FC3D-40E2-A957-151A1BE2B2F9@vmware.com/T/#t

Thanks again,
Nadav

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ