srcu: Validate ___srcu_struct_ptrs entries against the module range

The entries of the ___srcu_struct_ptrs section are absolute pointers
emitted by DEFINE_SRCU() in module .data. load_info() hands the raw
section to RCU (kernel/module/main.c), and srcu_module_coming()
dereferences each entry and writes through it:

	ssp = *(sspp++);
	ssp->sda = alloc_percpu(struct srcu_data);
	ssp->srcu_ctrp = &ssp->sda->srcu_ctrs[0];

A malicious or corrupted module image can point an entry anywhere in
the kernel address space; nothing on the load path validates it, so
this is an arbitrary-address write primitive (an 8-byte percpu
pointer at offset 8 of the target).

The static-key loader already handles the same shape of section with
a range check (kernel/jump_label.c):

	if (within_module((unsigned long)key, mod))

Apply the same check to both module-notification paths. coming()
rejects the module load outright; going() skips the entry, because
going() runs even for modules that never passed coming(), and those
entries never got per-CPU data allocated.

Signed-off-by: Guikun Yang <yangguikun19@qq.com>
Reviewed-by: Bradley Morgan <bradley.morgan@linux.dev>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 file changed