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:49:45 +0000 (16:49 -0500)
commit264c4d3bba4c4c3ccb9c32759ef1fd616f7ccdb3
tree8c2735021127e8376e962300995086ee8039c2a4
parent2e8be614c0491757ff343ff42611417b9af25246
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.025448 seconds and 4 git commands to generate.