1. 15 6月, 2017 7 次提交
    • D
      test_bpf: Add test to make conditional jump cross a large number of insns. · b7127cfe
      David Daney 提交于
      On MIPS, conditional branches can only span 32k instructions.  To
      exceed this limit in the JIT with the BPF maximum of 4k insns, we need
      to choose eBPF insns that expand to more than 8 machine instructions.
      Use BPF_LD_ABS as it is quite complex.  This forces the JIT to invert
      the sense of the branch to branch around a long jump to the end.
      
      This (somewhat) verifies that the branch inversion logic and target
      address calculation of the long jumps are done correctly.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b7127cfe
    • D
      tools: bpf_jit_disasm: Handle large images. · e274da1a
      David Daney 提交于
      Dynamically allocate memory so that JIT images larger than the size of
      the statically allocated array can be handled.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e274da1a
    • D
      Merge branch 'bpf-ctx-narrow' · 2fae5d0e
      David S. Miller 提交于
      Yonghong Song says:
      
      ====================
      bpf: permit bpf program narrower loads for ctx fields
      
      Today, if users try to access a ctx field through a narrower load, e.g.,
      __be16 prot = __sk_buff->protocol, verifier will fail.
      This set contains the verifier change to permit such loads for
      certain ctx fields as well as the new test cases in selftests/bpf.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2fae5d0e
    • Y
      selftests/bpf: Add test cases to test narrower ctx field loads · 18f3d6be
      Yonghong Song 提交于
      Add test cases in test_verifier and test_progs.
      Negative tests are added in test_verifier as well.
      The test in test_progs will compare the value of narrower ctx field
      load result vs. the masked value of normal full-field load result,
      and will fail if they are not the same.
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NYonghong Song <yhs@fb.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      18f3d6be
    • Y
      bpf: permits narrower load from bpf program context fields · 31fd8581
      Yonghong Song 提交于
      Currently, verifier will reject a program if it contains an
      narrower load from the bpf context structure. For example,
              __u8 h = __sk_buff->hash, or
              __u16 p = __sk_buff->protocol
              __u32 sample_period = bpf_perf_event_data->sample_period
      which are narrower loads of 4-byte or 8-byte field.
      
      This patch solves the issue by:
        . Introduce a new parameter ctx_field_size to carry the
          field size of narrower load from prog type
          specific *__is_valid_access validator back to verifier.
        . The non-zero ctx_field_size for a memory access indicates
          (1). underlying prog type specific convert_ctx_accesses
               supporting non-whole-field access
          (2). the current insn is a narrower or whole field access.
        . In verifier, for such loads where load memory size is
          less than ctx_field_size, verifier transforms it
          to a full field load followed by proper masking.
        . Currently, __sk_buff and bpf_perf_event_data->sample_period
          are supporting narrowing loads.
        . Narrower stores are still not allowed as typical ctx stores
          are just normal stores.
      
      Because of this change, some tests in verifier will fail and
      these tests are removed. As a bonus, rename some out of bound
      __sk_buff->cb access to proper field name and remove two
      redundant "skb cb oob" tests.
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NYonghong Song <yhs@fb.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      31fd8581
    • Z
      macvlan: propagate the mac address change status for lowerdev · a88e2676
      Zhang Shengju 提交于
      The macvlan dev should propagate the return value of mac address change for
      lower device in the passthru mode, instead of always return 0.
      Signed-off-by: NZhang Shengju <zhangshengju@cmss.chinamobile.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a88e2676
    • D
      Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 55ce889f
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      10GbE Intel Wired LAN Driver Updates 2017-06-13
      
      This series contains updates to ixgbe and ixgbevf only.
      
      Jake completes his fix ups for our drivers with the ixgbe changes to
      resolve a race condition in processing timestamp requests.  These fixes
      are the same fixes Jake applied earlier to the other drivers, including
      the added statistic to help administrators know when an application
      timestamp request is ignored.
      
      With all the recent ixgbe/ixgbevf changes and fixes, Tony bumps the
      the driver versions.  Then Tony provides a fix to resolve a static
      analysis warning by changing a variable to unsigned integer since the
      value can never be negative.
      
      Emil fixes an issue for X550 devices where the qde parameter was being
      ignored, so PFQDE.HIDE_VLAN was not being set.
      
      Jeff Mahoney from SuSE fixes a possible kernel crash, where there was
      a small window where tasks writing to the sriov_numvfs sysfs attribute
      can sneak in after we call register_netdev().  So we need to call
      pci_set_drvdata() before and not after register_netdev() to preserve the
      intent of commit 0fb6a55c ("ixgbe: fix crash on rmmod after probe
      fail").
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      55ce889f
  2. 14 6月, 2017 28 次提交
  3. 13 6月, 2017 5 次提交