You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
the latest LLVM will also check the 512 byte BPF stack size. So we fails earlier at compiling the object instead of loading to verifier. Patch llvm and kernel net-next to 4096.
diff--gita/lib/Target/BPF/BPFRegisterInfo.cppb/lib/Target/BPF/BPFRegisterInfo.cppindex7925bee..2636acb100644---a/lib/Target/BPF/BPFRegisterInfo.cpp+++b/lib/Target/BPF/BPFRegisterInfo.cpp
@@ -44,7+44,7 @@ BitVectorBPFRegisterInfo::getReservedRegs(constMachineFunction&MF) const {
staticvoidWarnSize(intOffset, MachineFunction&MF, DebugLoc&DL)
{
-if (Offset <= -512) {
+if (Offset <= -4096) {
auto F=MF.getFunction();
DiagnosticInfoUnsupportedDiagStackSize(*F,
"Looks like the BPF stack limit of 512 bytes is exceeded. "
patch kernel net-next
---a/arch/x86/net/bpf_jit.S+++b/arch/x86/net/bpf_jit.S
@@ -19,7+19,7 @@
*/
#defineSKBDATA %r10#defineSKF_MAX_NEG_OFF $(-0x200000) /* SKF_LL_OFF from filter.h */
-#defineMAX_BPF_STACK (512 /* from filter.h */ + \
+#define MAX_BPF_STACK (4096 /* from filter.h */ + \
32 /* space for rbx,r13,r14,r15 */ + \
8 /* space for skb_copy_bits */)
diff--gita/include/linux/filter.hb/include/linux/filter.hindexe4eb254..fb532fc100644---a/include/linux/filter.h+++b/include/linux/filter.h
@@ -55,7+55,8 @@ structbpf_prog_aux;
#defineMAX_BPF_JIT_REG (MAX_BPF_REG + 1)
/* BPF program can access up to 512 bytes of stack space. */-#defineMAX_BPF_STACK 512
+//#define MAX_BPF_STACK 512+#defineMAX_BPF_STACK 4096
#defineBPF_TAG_SIZE 8
The text was updated successfully, but these errors were encountered:
the latest LLVM will also check the 512 byte BPF stack size. So we fails earlier at compiling the object instead of loading to verifier. Patch llvm and kernel net-next to 4096.
patch kernel net-next
The text was updated successfully, but these errors were encountered: