[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20141205.212433.750912400773154348.davem@davemloft.net>
Date: Fri, 05 Dec 2014 21:24:33 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: ast@...mgrid.com
Cc: zlim.lnx@...il.com, edumazet@...gle.com, dborkman@...hat.com,
hpa@...or.com, tglx@...utronix.de, mingo@...nel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 net] bpf: x86: fix epilogue generation for eBPF
programs
From: Alexei Starovoitov <ast@...mgrid.com>
Date: Sat, 29 Nov 2014 14:46:13 -0800
> classic BPF has a restriction that last insn is always BPF_RET.
> eBPF doesn't have BPF_RET instruction and this restriction.
> It has BPF_EXIT insn which can appear anywhere in the program
> one or more times and it doesn't have to be last insn.
> Fix eBPF JIT to emit epilogue when first BPF_EXIT is seen
> and all other BPF_EXIT instructions will be emitted as jump.
>
> Since jump offset to epilogue is computed as:
> jmp_offset = ctx->cleanup_addr - addrs[i]
> we need to change type of cleanup_addr to signed to compute the offset as:
> (long long) ((int)20 - (int)30)
> instead of:
> (long long) ((unsigned int)20 - (int)30)
>
> Fixes: 622582786c9e ("net: filter: x86: internal BPF JIT")
> Signed-off-by: Alexei Starovoitov <ast@...mgrid.com>
Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists