1. 20 May, 2013 1 commit
  2. 21 Mar, 2013 1 commit
    • Daniel Borkmann's avatar
      filter: bpf_jit_comp: refactor and unify BPF JIT image dump output · 79617801
      Daniel Borkmann authored
      
      
      If bpf_jit_enable > 1, then we dump the emitted JIT compiled image
      after creation. Currently, only SPARC and PowerPC has similar output
      as in the reference implementation on x86_64. Make a small helper
      function in order to reduce duplicated code and make the dump output
      uniform across architectures x86_64, SPARC, PPC, ARM (e.g. on ARM
      flen, pass and proglen are currently not shown, but would be
      interesting to know as well), also for future BPF JIT implementations
      on other archs.
      
      Cc: Mircea Gherzan <mgherzan@gmail.com>
      Cc: Matt Evans <matt@ozlabs.org>
      Cc: Eric Dumazet <eric.dumazet@google.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      79617801
  3. 12 Mar, 2013 1 commit
  4. 14 Feb, 2013 1 commit
  5. 11 Dec, 2012 2 commits
    • Schichan Nicolas's avatar
      ARM: 7598/1: net: bpf_jit_32: fix sp-relative load/stores offsets. · fe15f3f1
      Schichan Nicolas authored
      The offset must be multiplied by 4 to be sure to access the correct
      32bit word in the stack scratch space.
      
      For instance, a store at scratch memory cell #1 was generating the
      following:
      
      st	r4, [sp, #1]
      
      While the correct code for this is:
      
      st	r4, [sp, #4]
      
      To reproduce the bug (assuming your system has a NIC with the mac
      address 52:54:00:12:34:56):
      
      echo 0 > /proc/sys/net/core/bpf_jit_enable
      tcpdump -ni eth0 "ether[1] + ether[2] - ether[3] * ether[4] - ether[5] \
      	== -0x3AA" # this will capture packets as expected
      
      echo 1 > /proc/sys/net/core/bpf_jit_enable
      tcpdump -ni eth0 "ether[1] + ether[2] - ether[3] * ether[4] - ether[5] \
      	== -0x3AA" # this will not.
      
      This bug was present since the original inclusion of bpf_jit for ARM
      (ddecdfce
      
      : ARM: 7259/3: net: JIT compiler for packet filters).
      
      Signed-off-by: default avatarNicolas Schichan <nschichan@freebox.fr>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      fe15f3f1
    • Schichan Nicolas's avatar
      ARM: 7597/1: net: bpf_jit_32: fix kzalloc gfp/size mismatch. · 89c2e009
      Schichan Nicolas authored
      Official prototype for kzalloc is:
      
      void *kzalloc(size_t, gfp_t);
      
      The ARM bpf_jit code was having the assumption that it was:
      
      void *kzalloc(gfp_t, size);
      
      This was resulting the use of some random GFP flags depending on the
      size requested and some random overflows once the really needed size
      was more than the value of GFP_KERNEL.
      
      This bug was present since the original inclusion of bpf_jit for ARM
      (ddecdfce
      
      : ARM: 7259/3: net: JIT compiler for packet filters).
      
      Signed-off-by: default avatarNicolas Schichan <nschichan@freebox.fr>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      89c2e009
  6. 13 Nov, 2012 2 commits
  7. 14 Jun, 2012 1 commit
  8. 24 Mar, 2012 1 commit