You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rules: require structural provenance for module-derived text bounds
module_text_bound moves Q_VIRT_IMAGE_BASE at the sound floor but accepted
REGION_MODULE_REGION, which means "assumed to be a module because it fell
inside the band". On both architectures it runs on, that band contains the
whole kernel-text range — riscv64 [ffffffde.., ffffffffc0000000] over text
[ffffffe0.., ffffffffc0000000], s390 [0, 20000000000000] over text
[100000, 20000000000000] — so a range-classified kernel address is
indistinguishable from a module one and arrives as a text-base bound.
sysfs_iscsi_transport_handle reaches that state: it tests the band before
text, so on those arches its kernel-image branch is unreachable and a
built-in transport's .data pointer is tagged as module region. On s390
modules sit below the image, so such an address raises the C_LOWER_BOUND
above the true _text and carves truth out of the guaranteed window.
Read REGION_MODULE only, as module_text_bracket and module_base_bounds
already do, removing the class rather than relying on every emitter to
filter. The iscsi ordering is left alone and documented: reversing it would
tag genuine riscv64 module addresses KERNEL_DATA and feed
image_size_text_data_gap the bogus gap that ordering exists to prevent.
Where the two ranges overlap, no ordering is correct; what makes the
ambiguity harmless is that the weak tag no longer reaches a text base.
Separately, module_base_bounds discarded the best answer it had. The
mem_init() layout block prints "modules : 0x..." and the landmark parser
emits it as POS_BASE on the region — the region's start stated by the
kernel itself. Consume it as a pin. This is the one place the weak tag is
the right thing to read: with POS_BASE it means "this IS where the band
starts", and only the landmark parser emits that pair.
The two riscv64 tests that fed module-region leaks now feed REGION_MODULE,
which is what proc_modules and sysfs_module_sections emit; they were
written before those components were reclassified, and the tag was
incidental to what they assert.
0 commit comments