Re: [PATCH v1 0/3] module: Don't fail module loading when setting ro_after_init section RO failed

From: Petr Pavlu
Date: Mon Jan 06 2025 - 09:01:57 EST


On 1/4/25 08:39, Christophe Leroy wrote:
> Le 03/01/2025 à 17:13, Petr Pavlu a écrit :
>> On 12/5/24 20:46, Christophe Leroy wrote:
>>> This series reworks module loading to avoid leaving the module in a
>>> stale state when protecting ro_after_init section fails.
>>>
>>> Once module init has succeded it is too late to cancel loading.
>>> If setting ro_after_init data section to read-only fails, all we can
>>> do is to inform the user through a warning. This is what patch 2 does.
>>>
>>> Then patch 3 tries to go a bit further by testing the ability to write
>>> protect ro-after-init section prior to initialising the module.
>>
>> I've been holding off on applying this series to modules-next because
>> there was still some discussion on the previous RFC version [1], and
>> I wanted to give people more time to potentially comment.
>>
>> Mike Rapoport also recently posted a series with a patch [2] that
>> proposes restoring of large pages after fragmentation. Should the last
>> patch here be then dropped?
>
> Indeed, if the large pages are restored when bringing back the
> ro_after_init to RW, it defeats the purpose of patch 3.
>
> So I agree, let's first apply patches 1 and 2 in order to fix the actual
> bug then see how we can improve as a second step.

I've now queued the first two patches on modules-next.

--
Thanks,
Petr