1. 29 Nov, 2017 1 commit
  2. 27 Nov, 2017 1 commit
    • Linus Torvalds's avatar
      Rename superblock flags (MS_xyz -> SB_xyz) · 1751e8a6
      Linus Torvalds authored
      This is a pure automated search-and-replace of the internal kernel
      superblock flags.
      
      The s_flags are now called SB_*, with the names and the values for the
      moment mirroring the MS_* flags that they're equivalent to.
      
      Note how the MS_xyz flags are the ones passed to the mount system call,
      while the SB_xyz flags are what we then use in sb->s_flags.
      
      The script to do this was:
      
          # places to look in; re security/*: it generally should *not* be
          # touched (that stuff parses mount(2) arguments directly), but
          # there are two places where we really deal with superblock flags.
          FILES="drivers/mtd drivers/staging/lustre fs ipc mm \
                  include/linux/fs.h include/uapi/linux/bfs_fs.h \
                  security/apparmor/apparmorfs.c security/apparmor/include/lib.h"
          # the list of MS_... constants
          SYMS="RDONLY NOSUID NODEV NOEXEC SYNCHRONOUS REMOUNT MANDLOCK \
                DIRSYNC NOATIME NODIRATIME BIND MOVE REC VERBOSE SILENT \
                POSIXACL UNBINDABLE PRIVATE SLAVE SHARED RELATIME KERNMOUNT \
                I_VERSION STRICTATIME LAZYTIME SUBMOUNT NOREMOTELOCK NOSEC BORN \
                ACTIVE NOUSER"
      
          SED_PROG=
          for i in $SYMS; do SED_PROG="$SED_PROG -e s/MS_$i/SB_$i/g"; done
      
          # we want files that contain at least one of MS_...,
          # with fs/namespace.c and fs/pnode.c excluded.
          L=$(for i in $SYMS; do git grep -w -l MS_$i $FILES; done| sort|uniq|grep -v '^fs/namespace.c'|grep -v '^fs/pnode.c')
      
          for f in $L; do sed -i $f $SED_PROG; done
      Requested-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1751e8a6
  3. 26 Nov, 2017 1 commit
    • Dmitry V. Levin's avatar
      uapi: fix linux/kfd_ioctl.h userspace compilation errors · b4d08520
      Dmitry V. Levin authored
      Consistently use types provided by <linux/types.h> via <drm/drm.h>
      to fix the following linux/kfd_ioctl.h userspace compilation errors:
      
      /usr/include/linux/kfd_ioctl.h:236:2: error: unknown type name 'uint64_t'
        uint64_t va_addr; /* to KFD */
      /usr/include/linux/kfd_ioctl.h:237:2: error: unknown type name 'uint32_t'
        uint32_t gpu_id; /* to KFD */
      /usr/include/linux/kfd_ioctl.h:238:2: error: unknown type name 'uint32_t'
        uint32_t pad;
      /usr/include/linux/kfd_ioctl.h:243:2: error: unknown type name 'uint64_t'
        uint64_t tile_config_ptr;
      /usr/include/linux/kfd_ioctl.h:245:2: error: unknown type name 'uint64_t'
        uint64_t macro_tile_config_ptr;
      /usr/include/linux/kfd_ioctl.h:249:2: error: unknown type name 'uint32_t'
        uint32_t num_tile_configs;
      /usr/include/linux/kfd_ioctl.h:253:2: error: unknown type name 'uint32_t'
        uint32_t num_macro_tile_configs;
      /usr/include/linux/kfd_ioctl.h:255:2: error: unknown type name 'uint32_t'
        uint32_t gpu_id;  /* to KFD */
      /usr/include/linux/kfd_ioctl.h:256:2: error: unknown type name 'uint32_t'
        uint32_t gb_addr_config; /* from KFD */
      /usr/include/linux/kfd_ioctl.h:257:2: error: unknown type name 'uint32_t'
        uint32_t num_banks;  /* from KFD */
      /usr/include/linux/kfd_ioctl.h:258:2: error: unknown type name 'uint32_t'
        uint32_t num_ranks;  /* from KFD */
      
      Fixes: 6a1c9510 ("drm/amdkfd: Adding new IOCTL for scratch memory v2")
      Fixes: 5d71dbc3 ("drm/amdkfd: Implement image tiling mode support v2")
      Signed-off-by: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
      b4d08520
  4. 24 Nov, 2017 1 commit
    • Thomas Gleixner's avatar
      sched/debug: Fix task state recording/printout · 3f5fe9fe
      Thomas Gleixner authored
      The recent conversion of the task state recording to use task_state_index()
      broke the sched_switch tracepoint task state output.
      
      task_state_index() returns surprisingly an index (0-7) which is then
      printed with __print_flags() applying bitmasks. Not really working and
      resulting in weird states like 'prev_state=t' instead of 'prev_state=I'.
      
      Use TASK_REPORT_MAX instead of TASK_STATE_MAX to report preemption. Build a
      bitmask from the return value of task_state_index() and store it in
      entry->prev_state, which makes __print_flags() work as expected.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: stable@vger.kernel.org
      Fixes: efb40f58 ("sched/tracing: Fix trace_sched_switch task-state printing")
      Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1711221304180.1751@nanosSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      3f5fe9fe
  5. 23 Nov, 2017 5 commits
    • Bjorn Helgaas's avatar
      x86/PCI: Remove unused HyperTransport interrupt support · fd2fa6c1
      Bjorn Helgaas authored
      There are no in-tree callers of ht_create_irq(), the driver interface for
      HyperTransport interrupts, left.  Remove the unused entry point and all the
      supporting code.
      
      See 8b955b0d ("[PATCH] Initial generic hypertransport interrupt
      support").
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: linux-pci@vger.kernel.org
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Link: https://lkml.kernel.org/r/20171122221337.3877.23362.stgit@bhelgaas-glaptop.roam.corp.google.com
      fd2fa6c1
    • Willem de Bruijn's avatar
      net: accept UFO datagrams from tuntap and packet · 0c19f846
      Willem de Bruijn authored
      Tuntap and similar devices can inject GSO packets. Accept type
      VIRTIO_NET_HDR_GSO_UDP, even though not generating UFO natively.
      
      Processes are expected to use feature negotiation such as TUNSETOFFLOAD
      to detect supported offload types and refrain from injecting other
      packets. This process breaks down with live migration: guest kernels
      do not renegotiate flags, so destination hosts need to expose all
      features that the source host does.
      
      Partially revert the UFO removal from 182e0b6b~1..d9d30adf.
      This patch introduces nearly(*) no new code to simplify verification.
      It brings back verbatim tuntap UFO negotiation, VIRTIO_NET_HDR_GSO_UDP
      insertion and software UFO segmentation.
      
      It does not reinstate protocol stack support, hardware offload
      (NETIF_F_UFO), SKB_GSO_UDP tunneling in SKB_GSO_SOFTWARE or reception
      of VIRTIO_NET_HDR_GSO_UDP packets in tuntap.
      
      To support SKB_GSO_UDP reappearing in the stack, also reinstate
      logic in act_csum and openvswitch. Achieve equivalence with v4.13 HEAD
      by squashing in commit 93991221 ("net: skb_needs_check() removes
      CHECKSUM_UNNECESSARY check for tx.") and reverting commit 8d63bee6
      ("net: avoid skb_warn_bad_offload false positives on UFO").
      
      (*) To avoid having to bring back skb_shinfo(skb)->ip6_frag_id,
      ipv6_proxy_select_ident is changed to return a __be32 and this is
      assigned directly to the frag_hdr. Also, SKB_GSO_UDP is inserted
      at the end of the enum to minimize code churn.
      
      Tested
        Booted a v4.13 guest kernel with QEMU. On a host kernel before this
        patch `ethtool -k eth0` shows UFO disabled. After the patch, it is
        enabled, same as on a v4.13 host kernel.
      
        A UFO packet sent from the guest appears on the tap device:
          host:
            nc -l -p -u 8000 &
            tcpdump -n -i tap0
      
          guest:
            dd if=/dev/zero of=payload.txt bs=1 count=2000
            nc -u 192.16.1.1 8000 < payload.txt
      
        Direct tap to tap transmission of VIRTIO_NET_HDR_GSO_UDP succeeds,
        packets arriving fragmented:
      
          ./with_tap_pair.sh ./tap_send_ufo tap0 tap1
          (from https://github.com/wdebruij/kerneltools/tree/master/tests)
      
      Changes
        v1 -> v2
          - simplified set_offload change (review comment)
          - documented test procedure
      
      Link: http://lkml.kernel.org/r/<CAF=yD-LuUeDuL9YWPJD9ykOZ0QCjNeznPDr6whqZ9NGMNF12Mw@mail.gmail.com>
      Fixes: fb652fdf ("macvlan/macvtap: Remove NETIF_F_UFO advertisement.")
      Reported-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0c19f846
    • Alexei Starovoitov's avatar
      bpf: fix branch pruning logic · c131187d
      Alexei Starovoitov authored
      when the verifier detects that register contains a runtime constant
      and it's compared with another constant it will prune exploration
      of the branch that is guaranteed not to be taken at runtime.
      This is all correct, but malicious program may be constructed
      in such a way that it always has a constant comparison and
      the other branch is never taken under any conditions.
      In this case such path through the program will not be explored
      by the verifier. It won't be taken at run-time either, but since
      all instructions are JITed the malicious program may cause JITs
      to complain about using reserved fields, etc.
      To fix the issue we have to track the instructions explored by
      the verifier and sanitize instructions that are dead at run time
      with NOPs. We cannot reject such dead code, since llvm generates
      it for valid C code, since it doesn't do as much data flow
      analysis as the verifier does.
      
      Fixes: 17a52670 ("bpf: verifier (add verifier core)")
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      c131187d
    • Rob Clark's avatar
      dt-bindings: remove file that was added accidentally · 98ecf1a3
      Rob Clark authored
      I think this snuck in when I applied the patch for f97decac (didn't
      apply cleanly, required some manual applying + git-add).  It is unused
      and shouldn't be here.  My bad.
      
      Fixes: f97decac "drm/msm: Support multiple ringbuffers"
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      98ecf1a3
    • Dave Airlie's avatar
      drm: add connector info/property for non-desktop displays [v2] · 66660d4c
      Dave Airlie authored
      This adds the infrastructure needed to quirk displays
      using edid and to mark them a non-desktop.
      
      A non-desktop display is one which shouldn't normally be included
      as a part of a desktop environment.
      
      This is meant to cover head mounted devices like HTC Vive.
      
      v2: Change description from non-standard to non-desktop, add docs
      Reviewed-by: default avatarKeith Packard <keithp@keithp.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      fixup docs
      66660d4c
  6. 22 Nov, 2017 3 commits
    • Gianluca Borello's avatar
      bpf: introduce ARG_PTR_TO_MEM_OR_NULL · db1ac496
      Gianluca Borello authored
      With the current ARG_PTR_TO_MEM/ARG_PTR_TO_UNINIT_MEM semantics, an helper
      argument can be NULL when the next argument type is ARG_CONST_SIZE_OR_ZERO
      and the verifier can prove the value of this next argument is 0. However,
      most helpers are just interested in handling <!NULL, 0>, so forcing them to
      deal with <NULL, 0> makes the implementation of those helpers more
      complicated for no apparent benefits, requiring them to explicitly handle
      those corner cases with checks that bpf programs could start relying upon,
      preventing the possibility of removing them later.
      
      Solve this by making ARG_PTR_TO_MEM/ARG_PTR_TO_UNINIT_MEM never accept NULL
      even when ARG_CONST_SIZE_OR_ZERO is set, and introduce a new argument type
      ARG_PTR_TO_MEM_OR_NULL to explicitly deal with the NULL case.
      
      Currently, the only helper that needs this is bpf_csum_diff_proto(), so
      change arg1 and arg3 to this new type as well.
      
      Also add a new battery of tests that explicitly test the
      !ARG_PTR_TO_MEM_OR_NULL combination: all the current ones testing the
      various <NULL, 0> variations are focused on bpf_csum_diff, so cover also
      other helpers.
      Signed-off-by: default avatarGianluca Borello <g.borello@gmail.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      db1ac496
    • Takashi Iwai's avatar
      ALSA: hda - Fix yet remaining issue with vmaster 0dB initialization · d6c0615f
      Takashi Iwai authored
      The previous fix for addressing the breakage in vmaster slave
      initialization, commit a91d6612 ("ALSA: hda - Fix incorrect TLV
      callback check introduced during set_fs() removal"), introduced a new
      helper to process over each slave kctl.  However, this helper passes
      only the original kctl, not the virtual slave kctl.  As a result,
      HD-audio driver (which is the only user so far) couldn't initialize
      the slave correctly because it's trying to update the value directly
      with the original kctl, not with the mapped kctl.
      
      This patch fixes the situation again by passing both the mapped slaved
      and original slave kctls to the function.  Luckily there is a single
      caller as of now, so changing the call signature is no big matter.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197959
      Fixes: a91d6612 ("ALSA: hda - Fix incorrect TLV callback check introduced during set_fs() removal")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d6c0615f
    • Kees Cook's avatar
      treewide: Remove TIMER_FUNC_TYPE and TIMER_DATA_TYPE casts · 841b86f3
      Kees Cook authored
      With all callbacks converted, and the timer callback prototype
      switched over, the TIMER_FUNC_TYPE cast is no longer needed,
      so remove it. Conversion was done with the following scripts:
      
          perl -pi -e 's|\(TIMER_FUNC_TYPE\)||g' \
              $(git grep TIMER_FUNC_TYPE | cut -d: -f1 | sort -u)
      
          perl -pi -e 's|\(TIMER_DATA_TYPE\)||g' \
              $(git grep TIMER_DATA_TYPE | cut -d: -f1 | sort -u)
      
      The now unused macros are also dropped from include/linux/timer.h.
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      841b86f3
  7. 21 Nov, 2017 9 commits
  8. 20 Nov, 2017 5 commits
  9. 19 Nov, 2017 8 commits
  10. 18 Nov, 2017 6 commits