Fix: lttng_kvmalloc helper NULL pointer OOPS
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 7 Nov 2017 21:44:36 +0000 (16:44 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 7 Nov 2017 21:44:36 +0000 (16:44 -0500)
commit20eb87c94b862d82c5c5eb279a2dc085045059b5
tree81867d95cfe41244966459a5bc4f1a1024fc3482
parent998c8844edee55bdfbb2f3eed13fc8da9b4a2f71
Fix: lttng_kvmalloc helper NULL pointer OOPS

The static function __vmalloc_node is not visible by KALLSYMS_ALL on at
least some kernels, which leads to a call to a NULL function when trying
to perform allocation of lttng buffer memory under memory fragmentation
conditions (kmalloc_node failure).

Use __vmalloc_node_range instead, and check that the returned pointer
is non-NULL to ensure this type of failure does not happen in any
condition.

Fallback to __vmalloc(), even though it is not NUMA-aware, in case
we fail to find __vmalloc_node_range, and print an explicit warning
to the user console about the need to enable KALLSYMS_ALL.

This affects kernels < 4.12. Later kernels provide kvmalloc(), which
we use.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
wrapper/vmalloc.h
This page took 0.025598 seconds and 4 git commands to generate.