ARM: net: add JIT support for loads from struct seccomp_data.
authorNicolas Schichan <nschichan@freebox.fr>
Thu, 7 May 2015 13:00:13 +0000 (15:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 May 2015 22:20:42 +0000 (18:20 -0400)
Signed-off-by: Nicolas Schichan <nschichan@freebox.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/arm/net/bpf_jit_32.c

index e1268f90502682c75dfd7a98e6ed15272ea8d512..b5f470ddab6d73acddfe7101791e9ec5ce5ebe5e 100644 (file)
@@ -852,6 +852,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;
                }