netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ARM: net: add JIT support for loads from struct seccomp_data.
@ 2015-05-07 13:00 Nicolas Schichan
  2015-05-10  2:28 ` David Miller
  2015-05-12 22:20 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Nicolas Schichan @ 2015-05-07 13:00 UTC (permalink / raw)
  To: Russell King, David S. Miller, Daniel Borkmann,
	Alexei Starovoitov, Nicolas Schichan, Mircea Gherzan,
	linux-arm-kernel, linux-kernel, netdev

Signed-off-by: Nicolas Schichan <nschichan@freebox.fr>
---

This patch was first sent as part of a serie modifying the core
seccomp code to allow the use of the classic BPF JIT. As the core
changes have been submitted to netdev by Daniel Borkmann, it is now
time to re-submit this patch separately.

While not physically dependent of the core seccomp changes they are
needed for the code added in this patch to be triggered.

 arch/arm/net/bpf_jit_32.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
index f412b53..6bda637 100644
--- a/arch/arm/net/bpf_jit_32.c
+++ b/arch/arm/net/bpf_jit_32.c
@@ -863,6 +863,16 @@ b_epilogue:
 			off = offsetof(struct sk_buff, queue_mapping);
 			emit(ARM_LDRH_I(r_A, r_skb, off), ctx);
 			break;
+		case BPF_LDX | BPF_W | BPF_ABS:
+			/*
+			 * load a 32bit word from struct seccomp_data.
+			 * seccomp_check_filter() will already have checked
+			 * that k is 32bit aligned and lies within the
+			 * struct seccomp_data.
+			 */
+			ctx->seen |= SEEN_SKB;
+			emit(ARM_LDR_I(r_A, r_skb, k), ctx);
+			break;
 		default:
 			return -1;
 		}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-12 22:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-07 13:00 [PATCH v2] ARM: net: add JIT support for loads from struct seccomp_data Nicolas Schichan
2015-05-10  2:28 ` David Miller
2015-05-10 19:40   ` Russell King - ARM Linux
2015-05-10 23:20     ` David Miller
2015-05-12 22:20 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).