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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <F3E94528-EA85-4A15-8452-EA2DE20EEB88@gmail.com>
Date: Mon, 6 May 2024 10:04:26 +0800
From: zhang warden <zhangwarden@...il.com>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: mbenes@...e.cz,
 jikos@...nel.org,
 pmladek@...e.com,
 joe.lawrence@...hat.com,
 live-patching@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] livepatch.h: Add comment to klp transition state



> On May 6, 2024, at 05:00, Josh Poimboeuf <jpoimboe@...nel.org> wrote:
> 
> On Mon, Apr 29, 2024 at 03:26:28PM +0800, zhangwarden@...il.com wrote:
>> From: Wardenjohn <zhangwarden@...il.com>
>> 
>> livepatch.h use KLP_UNDEFINED\KLP_UNPATCHED\KLP_PATCHED for klp transition state.
>> When livepatch is ready but idle, using KLP_UNDEFINED seems very confusing.
>> In order not to introduce potential risks to kernel, just update comment
>> to these state.
>> ---
>> include/linux/livepatch.h | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h
>> index 9b9b38e89563..b6a214f2f8e3 100644
>> --- a/include/linux/livepatch.h
>> +++ b/include/linux/livepatch.h
>> @@ -18,9 +18,9 @@
>> #if IS_ENABLED(CONFIG_LIVEPATCH)
>> 
>> /* task patch states */
>> -#define KLP_UNDEFINED -1
>> -#define KLP_UNPATCHED  0
>> -#define KLP_PATCHED  1
>> +#define KLP_UNDEFINED -1 /* idle, no transition in progress */
>> +#define KLP_UNPATCHED  0 /* transitioning to unpatched state */
>> +#define KLP_PATCHED  1 /* transitioning to patched state */
> 
> Instead of the comments, how about we just rename them to
> 
>  KLP_TRANSITION_IDLE
>  KLP_TRANSITION_UNPATCHED
>  KLP_TRANSITION_PATCHED
> 
> which shouldn't break userspace AFAIK.
> 
> -- 
> Josh

Hi Josh!

Renaming them may be a better way as my previous patch. I would like to know why renaming KLP_*** into 
KLP_TRANSITION_*** will not break userspace while 
Renaming KLP_UNDEWFINED to KLP_IDLE would break the userspace.

Meanwhile, I will resubmit another patch renaming the macros as your suggestion ASAP. Thank ~~ :)

--
Wardenjohn


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ