[PATCH v3 10/12] um: remove force_flush_all from fork_handler

Benjamin Berg benjamin at sipsolutions.net
Wed Jul 3 03:08:53 PDT 2024


On Wed, 2024-07-03 at 11:45 +0200, Johannes Berg wrote:
> On Fri, 2024-05-24 at 23:37 +0200, benjamin at sipsolutions.net wrote:
> > From: Benjamin Berg <benjamin.berg at intel.com>
> > 
> > There should be no need for this.
> 
> "should" ;-)

Hmm, I would have expected the previous patch is what breaks it.

i.e. this line that I added:

+	/* Ensure the new MM is clean and nothing unwanted is mapped
*/
+	unmap(new_id, 0, STUB_START);

> This breaks things if glibc enables rseq. That might even be already
> broken in the sense that it might corrupt memory that's put at the same
> place the rseq was installed? But it at least it appears to still work
> without this patch...

Then it would make sense to me as the previous force_flush_all would
have only unmapped up to TASK_SIZE. While this now uses STUB_START
which clears more memory as TASK_SIZE has some alignment.

> As we discussed, it might thus be better to fix up the execve() patch
> and do that before this.

Yeah, lets just solve this class of issues with execve() first.

Benjamin



More information about the linux-um mailing list