Re: [PATCH 1/2] livepatch: introduce 'order' sysfs interface to klp_patch

From: zhang warden
Date: Tue Sep 24 2024 - 22:08:15 EST



Hi! Petr!
> On Sep 24, 2024, at 19:27, Petr Mladek <pmladek@xxxxxxxx> wrote:
>
> This does not work well. It uses the order on the stack when
> the livepatch is being loaded. It is not updated when any livepatch gets
> removed. It might create wrong values.
>
> I have even tried to reproduce this:
>
> # modprobe livepatch-sample
> # modprobe livepatch-shadow-fix1
> # cat /sys/kernel/livepatch/livepatch_sample/order
> 1
> # cat /sys/kernel/livepatch/livepatch_shadow_fix1/order
> 2
>
> # echo 0 >/sys/kernel/livepatch/livepatch_sample/enabled
> # rmmod livepatch_sample
> # cat /sys/kernel/livepatch/livepatch_shadow_fix1/order
> 2
>
> # modprobe livepatch-sample
> # cat /sys/kernel/livepatch/livepatch_shadow_fix1/order
> 2
> # cat /sys/kernel/livepatch/livepatch_sample/order
> 2
>
> BANG: The livepatches have the same order.
>

My bad...lol...
I tested this patch under my env but ignore such important scenario. Thank you very much! Petr!!

This patch do have problem, I need to rewrite it again. I am sorry, again.

Sincerely,
Wardenjohn,