bpf-kmsan-initialize-bpf-registers-with-zeroes.patch removed from -mm tree
The quilt patch titled
Subject: bpf: kmsan: initialize BPF registers with zeroes
has been removed from the -mm tree. Its filename was
bpf-kmsan-initialize-bpf-registers-with-zeroes.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Alexander Potapenko <[email protected]>
Subject: bpf: kmsan: initialize BPF registers with zeroes
Date: Thu, 15 Sep 2022 17:04:15 +0200
When executing BPF programs, certain registers may get passed uninitialized to helper functions. E.g. when performing a JMP_CALL, registers BPF_R1-BPF_R5 are always passed to the helper, no matter how many of them are actually used.
Passing uninitialized values as function parameters is technically undefined behavior, so we work around it by always initializing the registers.
---
kernel/bpf/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/core.c renamed from kernel/bpf/core.c~bpf-kmsan-initialize-bpf-registers-with-zeroes +1 -1
@@ -2002,7 +2002,7 @@ out:static unsigned int PROG_NAME (stack_size )(const void *ctx,const struct bpf_insn *insn) \ { \u64 stack[stack_size /sizeof (u64)]; \ -u64 regs[MAX_BPF_EXT_REG ]; \ +u64 regs[MAX_BPF_EXT_REG ] = {}; \ \FP = (u64 ) (unsigned long ) &stack[ARRAY_SIZE (stack)]; \ARG1 = (u64 ) (unsigned long ) ctx; \
_
Patches currently in -mm which might be from [email protected] are