Re: [PATCH 2/9] x86/mm: don't set kernel_set_to_readonly when write protecting fails

From: Mike Rapoport

Date: Thu Nov 26 2026 - 02:43:05 EST


On Wed, Nov 25, 2026 at 08:39:14PM +0000, Edgecombe, Rick P wrote:
> On Wed, 2026-11-25 at 11:05 +0200, Mike Rapoport wrote:
> > On Tue, Nov 24, 2026 at 11:01:06PM +0000, Edgecombe, Rick P wrote:
> > > On Thu, 2026-11-12 at 18:31 +0200, Mike Rapoport (Microsoft) wrote:
> > > > mark_rodata_ro() ignores the result of write protecting the kernel text
> > > > and rodata. It can fail when CPA cannot allocate a page table to split a
> > > > large page, and then a part of the text and rodata stays writable.
> > >
> > > Seems like something very unlikely to happen before the kernel has even finished
> > > booting. Probably other worse problems are coming in that case.
> >
> > Yeah, most probably we'll crash a few cycles later :)
> >  
>
> Is this a low priority AI bug report then?

It's not an AI bug report.

I'm changing how static_protections() checks are done, and this is a
prerequisite to close one of the corner cases there.

And also I want to make set_memory_*() __must_check at some point, so this
is needed for that too.

This entire series are small things I and bots found during my work on the
generic CPA and since they are all small, self contained and have value on
their own, I sent them ahead of that work.

--
Sincerely yours,
Mike.