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: <a0ec3ad3-1e49-42a3-90f2-add786f13b25@gmail.com>
Date: Tue, 18 Mar 2025 09:31:57 -0300
From: Filipe Xavier <felipeaggger@...il.com>
To: Miroslav Benes <mbenes@...e.cz>
Cc: Josh Poimboeuf <jpoimboe@...nel.org>, Jiri Kosina <jikos@...nel.org>,
 Petr Mladek <pmladek@...e.com>, Joe Lawrence <joe.lawrence@...hat.com>,
 Shuah Khan <shuah@...nel.org>, Marcos Paulo de Souza <mpdesouza@...e.com>,
 live-patching@...r.kernel.org, linux-kselftest@...r.kernel.org,
 linux-kernel@...r.kernel.org, felipe_life@...e.com
Subject: Re: [PATCH PATCH 2/2] selftests: livepatch: test if ftrace can trace
 a livepatched function

On 3/17/25 6:07 AM, Miroslav Benes wrote:

> On Fri, 14 Mar 2025, Filipe Xavier wrote:
>
>> On 3/14/25 10:14 AM, Miroslav Benes wrote:
>>
>>> Hi,
>>>
>>>> +start_test "trace livepatched function and check that the live patch
>>>> remains in effect"
>>>> +
>>>> +FUNCTION_NAME="livepatch_cmdline_proc_show"
>>>> +
>>>> +load_lp $MOD_LIVEPATCH
>>>> +trace_function "$FUNCTION_NAME"
>>> trace_funtion() calls cleanup_ftrace() to prepare the test. Ok.
>>>
>>>> +if [[ "$(cat /proc/cmdline)" == "$MOD_LIVEPATCH: this has been live
>>>> patched" ]] ; then
>>>> +	log "livepatch: ok"
>>>> +fi
>>>> +
>>>> +check_traced_function "$FUNCTION_NAME"
>>>> +
>>>> +cleanup_tracing
>>> Here, I suppose, cleanup_tracing() is called to clean up after the check
>>> above so that nothing stays and more tests can be added later. Right?
>>> Would it make sense then to call cleanup_tracing() in
>>> check_traced_function()? I think it would less error prone.
>>> If needed, check_traced_function() can always be upgraded so that it
>>> checks for more traced functions.
>> In cases where we need to check two or more functions with
>> check_traced_function,
>>
>> if there is cleanup_tracing, it will not be possible, make sense?
>>
>> e.g: function1 call -> function2 call -> function3.
> I meant... check_traced_function() (or check_traced_functions() in this
> case) can have multiple arguments. You would loop over them inside and
> then clean up. Or did I misunderstood?

I hadn't thought of it that way, it makes perfect sense. I'll send a new 
version with this adjustment.

>
> Miroslav

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ