shithub: front

Download patch

ref: a664cf0bb19c82286560bb5114192d524b63d9f4
parent: 08db422fff2437d6c50f836249995f1ff47c1095
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Jun 18 16:49:16 EDT 2025

kernel: lock segment in segpage()

In the way it segpage() is currently used, it should
not strictly be required, however for consistency,
we should lock the segment when manipulating ptes.

--- a/sys/src/9/port/segment.c
+++ b/sys/src/9/port/segment.c
@@ -222,6 +222,7 @@
 	uintptr soff;
 	Page **pg;
 
+	qlock(s);
 	if(p->va < s->base || p->va >= s->top || s->mapsize == 0)
 		panic("segpage");
 
@@ -236,6 +237,7 @@
 		etp->first = pg;
 	if(pg > etp->last)
 		etp->last = pg;
+	qunlock(s);
 }
 
 Image*
--