Skip to content
  1. Jan 20, 2018
  2. Jan 19, 2018
  3. Jan 18, 2018
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 7155f8f3
      David S. Miller authored
      
      
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2018-01-18
      
      The following pull-request contains BPF updates for your *net* tree.
      
      The main changes are:
      
      1) Fix a divide by zero due to wrong if (src_reg == 0) check in
         64-bit mode. Properly handle this in interpreter and mask it
         also generically in verifier to guard against similar checks
         in JITs, from Eric and Alexei.
      
      2) Fix a bug in arm64 JIT when tail calls are involved and progs
         have different stack sizes, from Daniel.
      
      3) Reject stores into BPF context that are not expected BPF_STX |
         BPF_MEM variant, from Daniel.
      
      4) Mark dst reg as unknown on {s,u}bounds adjustments when the
         src reg has derived bounds from dead branches, from Daniel.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7155f8f3
    • Marc Kleine-Budde's avatar
      can: af_can: canfd_rcv(): replace WARN_ONCE by pr_warn_once · d4689846
      Marc Kleine-Budde authored
      
      
      If an invalid CANFD frame is received, from a driver or from a tun
      interface, a Kernel warning is generated.
      
      This patch replaces the WARN_ONCE by a simple pr_warn_once, so that a
      kernel, bootet with panic_on_warn, does not panic. A printk seems to be
      more appropriate here.
      
      Reported-by: default avatar <syzbot+e3b775f40babeff6e68b@syzkaller.appspotmail.com>
      Suggested-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Acked-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      d4689846
    • Marc Kleine-Budde's avatar
      can: af_can: can_rcv(): replace WARN_ONCE by pr_warn_once · 8cb68751
      Marc Kleine-Budde authored
      
      
      If an invalid CAN frame is received, from a driver or from a tun
      interface, a Kernel warning is generated.
      
      This patch replaces the WARN_ONCE by a simple pr_warn_once, so that a
      kernel, bootet with panic_on_warn, does not panic. A printk seems to be
      more appropriate here.
      
      Reported-by: default avatar <syzbot+4386709c0c1284dca827@syzkaller.appspotmail.com>
      Suggested-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Acked-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      8cb68751
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2018-01-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · 75f195f4
      Dave Airlie authored
      Final 4.15 drm-misc pull:
      
      Just 3 sun4i patches to fix clock computation/checks.
      
      * tag 'drm-misc-fixes-2018-01-17' of git://anongit.freedesktop.org/drm/drm-misc:
        drm/sun4i: hdmi: Add missing rate halving check in sun4i_tmds_determine_rate
        drm/sun4i: hdmi: Fix incorrect assignment in sun4i_tmds_determine_rate
        drm/sun4i: hdmi: Check for unset best_parent in sun4i_tmds_determine_rate
      75f195f4
    • Dave Airlie's avatar
      Merge branch 'vmwgfx-fixes-4.15' of git://people.freedesktop.org/~thomash/linux into drm-fixes · 894219d7
      Dave Airlie authored
      Last minute fixes for vmwgfx.
      One fix for a drm helper warning introduced in 4.15
      One important fix for a longer standing memory corruption issue on older
      hardware versions.
      
      * 'vmwgfx-fixes-4.15' of git://people.freedesktop.org/~thomash/linux:
        drm/vmwgfx: fix memory corruption with legacy/sou connectors
        drm/vmwgfx: Fix a boot time warning
      894219d7
    • Daniel Borkmann's avatar
      bpf: mark dst unknown on inconsistent {s, u}bounds adjustments · 6f16101e
      Daniel Borkmann authored
      
      
      syzkaller generated a BPF proglet and triggered a warning with
      the following:
      
        0: (b7) r0 = 0
        1: (d5) if r0 s<= 0x0 goto pc+0
         R0=inv0 R1=ctx(id=0,off=0,imm=0) R10=fp0
        2: (1f) r0 -= r1
         R0=inv0 R1=ctx(id=0,off=0,imm=0) R10=fp0
        verifier internal error: known but bad sbounds
      
      What happens is that in the first insn, r0's min/max value
      are both 0 due to the immediate assignment, later in the jsle
      test the bounds are updated for the min value in the false
      path, meaning, they yield smin_val = 1, smax_val = 0, and when
      ctx pointer is subtracted from r0, verifier bails out with the
      internal error and throwing a WARN since smin_val != smax_val
      for the known constant.
      
      For min_val > max_val scenario it means that reg_set_min_max()
      and reg_set_min_max_inv() (which both refine existing bounds)
      demonstrated that such branch cannot be taken at runtime.
      
      In above scenario for the case where it will be taken, the
      existing [0, 0] bounds are kept intact. Meaning, the rejection
      is not due to a verifier internal error, and therefore the
      WARN() is not necessary either.
      
      We could just reject such cases in adjust_{ptr,scalar}_min_max_vals()
      when either known scalars have smin_val != smax_val or
      umin_val != umax_val or any scalar reg with bounds
      smin_val > smax_val or umin_val > umax_val. However, there
      may be a small risk of breakage of buggy programs, so handle
      this more gracefully and in adjust_{ptr,scalar}_min_max_vals()
      just taint the dst reg as unknown scalar when we see ops with
      such kind of src reg.
      
      Reported-by: default avatar <syzbot+6d362cadd45dc0a12ba4@syzkaller.appspotmail.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      6f16101e
    • Daniel Borkmann's avatar
      bpf: fix cls_bpf on filter replace · ad9294db
      Daniel Borkmann authored
      Running the following sequence is currently broken:
      
        # tc qdisc add dev foo clsact
        # tc filter replace dev foo ingress prio 1 handle 1 bpf da obj bar.o
        # tc filter replace dev foo ingress prio 1 handle 1 bpf da obj bar.o
        RTNETLINK answers: Invalid argument
      
      The normal expectation on kernel side is that the second command
      succeeds replacing the existing program. However, what happens is
      in cls_bpf_change(), we bail out with err in the second run in
      cls_bpf_offload(). The EINVAL comes directly in cls_bpf_offload()
      when comparing prog vs oldprog's gen_flags. In case of above
      replace the new prog's gen_flags are 0, but the old ones are 8,
      which means TCA_CLS_FLAGS_NOT_IN_HW is set (e.g. drivers not having
      cls_bpf offload).
      
      Fix 102740bd ("cls_bpf: fix offload assumptions after callback
      conversion") in the following way: gen_flags from user space passed
      down via netlink cannot include status flags like TCA_CLS_FLAGS_IN_HW
      or TCA_CLS_FLAGS_NOT_IN_HW as opposed to oldprog that we previously
      loaded. Therefore, it doesn't make any sense to include them in the
      gen_flags comparison with the new prog before we even attempt to
      offload. Thus, lets fix this before 4.15 goes out.
      
      Fixes: 102740bd
      
       ("cls_bpf: fix offload assumptions after callback conversion")
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ad9294db
    • Rex Chang's avatar
      Net: ethernet: ti: netcp: Fix inbound ping crash if MTU size is greater than 1500 · 5a717843
      Rex Chang authored
      
      
      In the receive queue for 4096 bytes fragments, the page address
      set in the SW data0 field of the descriptor is not the one we got
      when doing the reassembly in receive. The page structure was retrieved
      from the wrong descriptor into SW data0 which is then causing a
      page fault when UDP checksum is accessing data above 1500.
      
      Signed-off-by: default avatarRex Chang <rchang@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5a717843
    • Sabrina Dubroca's avatar
      tls: reset crypto_info when do_tls_setsockopt_tx fails · 6db959c8
      Sabrina Dubroca authored
      The current code copies directly from userspace to ctx->crypto_send, but
      doesn't always reinitialize it to 0 on failure. This causes any
      subsequent attempt to use this setsockopt to fail because of the
      TLS_CRYPTO_INFO_READY check, eventhough crypto_info is not actually
      ready.
      
      This should result in a correctly set up socket after the 3rd call, but
      currently it does not:
      
          size_t s = sizeof(struct tls12_crypto_info_aes_gcm_128);
          struct tls12_crypto_info_aes_gcm_128 crypto_good = {
              .info.version = TLS_1_2_VERSION,
              .info.cipher_type = TLS_CIPHER_AES_GCM_128,
          };
      
          struct tls12_crypto_info_aes_gcm_128 crypto_bad_type = crypto_good;
          crypto_bad_type.info.cipher_type = 42;
      
          setsockopt(sock, SOL_TLS, TLS_TX, &crypto_bad_type, s);
          setsockopt(sock, SOL_TLS, TLS_TX, &crypto_good, s - 1);
          setsockopt(sock, SOL_TLS, TLS_TX, &crypto_good, s);
      
      Fixes: 3c4d7559
      
       ("tls: kernel TLS support")
      Signed-off-by: default avatarSabrina Dubroca <sd@queasysnail.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6db959c8
    • Sabrina Dubroca's avatar
      tls: return -EBUSY if crypto_info is already set · 877d17c7
      Sabrina Dubroca authored
      do_tls_setsockopt_tx returns 0 without doing anything when crypto_info
      is already set. Silent failure is confusing for users.
      
      Fixes: 3c4d7559
      
       ("tls: kernel TLS support")
      Signed-off-by: default avatarSabrina Dubroca <sd@queasysnail.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      877d17c7