mprotect changes a whole range instead of stopping at the first failing mapping
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- c, linux
- Bereich
- operating-systems
Rechercherichtung
Start by reading sys_mprotect and the range handling around guest_region_range_has_ro_shared_backing; the issue does not name their source files or tests. Trace how mappings are processed in address order, including holes and RLIMIT_DATA refusals. Done means processing stops at the first failing mapping while earlier changes remain, matching the Linux behavior described in the issue.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
sys_mprotect changes a whole range at once, where Linux's mprotect_fixup takes the mappings in address order and stops at the first one that fails, leaving the mappings below it changed.
On 170b5df, mapping three read-only pages, unmapping the middle one, then mprotect(p, 3 pages, PROT_READ | PROT_WRITE) returns 0 and makes the first and third pages writable. Linux 6.12 returns ENOMEM at the hole, with the first page writable and the third unchanged.
The same whole-range step shows up in the RLIMIT_DATA check from #485: the part of a range below the mapping the limit refuses is changed with one sys_mprotect, so guest_region_range_has_ro_shared_backing refuses that whole part with EACCES before any mapping below the shared one changes, and a hole inside it gets page tables and the new permissions.
A fix would walk the range in address order and stop at the first hole, refused mapping or RLIMIT_DATA refusal.
- Vorherrschende Sprache
- C
- Sterne
- 287
- Forks
- 33
- Ø Merge
- 2 T. 17 Std.
- Gemergte PRs (30 T.)
- 18
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus sysprog21/elfuse
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 80/100
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in sysprog21/elfuse
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
libreswan/libreswan#3185 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
category:port-update
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 2 Tagen
-
llvm:instcombine
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
llvm/llvm-project#246503 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag