[PATCH 01/13] bpf: Guard against accessing NULL pt_regs in bpf_get_task_stack()

Daniel Borkmann daniel at iogearbox.net
Fri Jan 7 21:21:59 AEDT 2022


On 1/6/22 12:45 PM, Naveen N. Rao wrote:
> task_pt_regs() can return NULL on powerpc for kernel threads. This is
> then used in __bpf_get_stack() to check for user mode, resulting in a
> kernel oops. Guard against this by checking return value of
> task_pt_regs() before trying to obtain the call chain.
> 
> Fixes: fa28dcb82a38f8 ("bpf: Introduce helper bpf_get_task_stack()")
> Cc: stable at vger.kernel.org # v5.9+
> Signed-off-by: Naveen N. Rao <naveen.n.rao at linux.vnet.ibm.com>

Acked-by: Daniel Borkmann <daniel at iogearbox.net>


More information about the Linuxppc-dev mailing list