Skip to content
  1. Jun 15, 2017
    • Yonghong Song's avatar
      selftests/bpf: Add test cases to test narrower ctx field loads · 18f3d6be
      Yonghong Song authored
      
      
      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: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      18f3d6be
    • Yonghong Song's avatar
      bpf: permits narrower load from bpf program context fields · 31fd8581
      Yonghong Song authored
      
      
      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: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      31fd8581
    • Zhang Shengju's avatar
      macvlan: propagate the mac address change status for lowerdev · a88e2676
      Zhang Shengju authored
      
      
      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: default avatarZhang Shengju <zhangshengju@cmss.chinamobile.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a88e2676
    • David S. Miller's avatar
      Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 55ce889f
      David S. Miller authored
      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: default avatarDavid S. Miller <davem@davemloft.net>
      55ce889f
  2. Jun 14, 2017
  3. Jun 13, 2017