1. 22 7月, 2020 4 次提交
    • J
      serial: tegra: drop bogus NULL tty-port checks · 707631ce
      Johan Hovold 提交于
      The struct tty_port is part of the uart state and will never be NULL in
      the receive helpers. Drop the bogus NULL checks and rename the
      pointer-variables "port" to differentiate them from struct tty_struct
      pointers (which can be NULL).
      
      Fixes: 962963e4 ("serial: tegra: Switch to using struct tty_port")
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Acked-by: NThierry Reding <treding@nvidia.com>
      Link: https://lore.kernel.org/r/20200710135947.2737-3-johan@kernel.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      707631ce
    • J
      serial: tegra: fix CREAD handling for PIO · b374c562
      Johan Hovold 提交于
      Commit 33ae787b ("serial: tegra: add support to ignore read") added
      support for dropping input in case CREAD isn't set, but for PIO the
      ignore_status_mask wasn't checked until after the character had been
      put in the receive buffer.
      
      Note that the NULL tty-port test is bogus and will be removed by a
      follow-on patch.
      
      Fixes: 33ae787b ("serial: tegra: add support to ignore read")
      Cc: stable <stable@vger.kernel.org>     # 5.4
      Cc: Shardar Shariff Md <smohammed@nvidia.com>
      Cc: Krishna Yarlagadda <kyarlagadda@nvidia.com>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Acked-by: NThierry Reding <treding@nvidia.com>
      Link: https://lore.kernel.org/r/20200710135947.2737-2-johan@kernel.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b374c562
    • H
      tty: xilinx_uartps: Really fix id assignment · 22a82fa7
      Helmut Grohne 提交于
      The problems started with the revert (18cc7ac8). The
      cdns_uart_console.index is statically assigned -1. When the port is
      registered, Linux assigns consecutive numbers to it. It turned out that
      when using ttyPS1 as console, the index is not updated as we are reusing
      the same cdns_uart_console instance for multiple ports. When registering
      ttyPS0, it gets updated from -1 to 0, but when registering ttyPS1, it
      already is 0 and not updated.
      
      That led to 2ae11c46. It assigns the index prior to registering
      the uart_driver once. Unfortunately, that ended up breaking the
      situation where the probe order does not match the id order. When using
      the same device tree for both uboot and linux, it is important that the
      serial0 alias points to the console. So some boards reverse those
      aliases. This was reported by Jan Kiszka. The proposed fix was reverting
      the index assignment and going back to the previous iteration.
      
      However such a reversed assignement (serial0 -> uart1, serial1 -> uart0)
      was already partially broken by the revert (18cc7ac8). While the
      ttyPS device works, the kmsg connection is already broken and kernel
      messages go missing. Reverting the id assignment does not fix this.
      
      >From the xilinx_uartps driver pov (after reverting the refactoring
      commits), there can be only one console. This manifests in static
      variables console_pprt and cdns_uart_console. These variables are not
      properly linked and can go out of sync. The cdns_uart_console.index is
      important for uart_add_one_port. We call that function for each port -
      one of which hopefully is the console. If it isn't, the CON_ENABLED flag
      is not set and console_port is cleared. The next cdns_uart_probe call
      then tries to register the next port using that same cdns_uart_console.
      
      It is important that console_port and cdns_uart_console (and its index
      in particular) stay in sync. The index assignment implemented by
      Shubhrajyoti Datta is correct in principle. It just may have to happen a
      second time if the first cdns_uart_probe call didn't encounter the
      console device. And we shouldn't change the index once the console uart
      is registered.
      Reported-by: NShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
      Reported-by: NJan Kiszka <jan.kiszka@web.de>
      Link: https://lore.kernel.org/linux-serial/f4092727-d8f5-5f91-2c9f-76643aace993@siemens.com/
      Fixes: 18cc7ac8 ("Revert "serial: uartps: Register own uart console and driver structures"")
      Fixes: 2ae11c46 ("tty: xilinx_uartps: Fix missing id assignment to the console")
      Fixes: 76ed2e10 ("Revert "tty: xilinx_uartps: Fix missing id assignment to the console"")
      Signed-off-by: NHelmut Grohne <helmut.grohne@intenta.de>
      Cc: stable <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200713073227.GA3805@laureti-devSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      22a82fa7
    • T
      vt: Reject zero-sized screen buffer size. · ce684552
      Tetsuo Handa 提交于
      syzbot is reporting general protection fault in do_con_write() [1] caused
      by vc->vc_screenbuf == ZERO_SIZE_PTR caused by vc->vc_screenbuf_size == 0
      caused by vc->vc_cols == vc->vc_rows == vc->vc_size_row == 0 caused by
      fb_set_var() from ioctl(FBIOPUT_VSCREENINFO) on /dev/fb0 , for
      gotoxy(vc, 0, 0) from reset_terminal() from vc_init() from vc_allocate()
       from con_install() from tty_init_dev() from tty_open() on such console
      causes vc->vc_pos == 0x10000000e due to
      ((unsigned long) ZERO_SIZE_PTR) + -1U * 0 + (-1U << 1).
      
      I don't think that a console with 0 column or 0 row makes sense. And it
      seems that vc_do_resize() does not intend to allow resizing a console to
      0 column or 0 row due to
      
        new_cols = (cols ? cols : vc->vc_cols);
        new_rows = (lines ? lines : vc->vc_rows);
      
      exception.
      
      Theoretically, cols and rows can be any range as long as
      0 < cols * rows * 2 <= KMALLOC_MAX_SIZE is satisfied (e.g.
      cols == 1048576 && rows == 2 is possible) because of
      
        vc->vc_size_row = vc->vc_cols << 1;
        vc->vc_screenbuf_size = vc->vc_rows * vc->vc_size_row;
      
      in visual_init() and kzalloc(vc->vc_screenbuf_size) in vc_allocate().
      
      Since we can detect cols == 0 or rows == 0 via screenbuf_size = 0 in
      visual_init(), we can reject kzalloc(0). Then, vc_allocate() will return
      an error, and con_write() will not be called on a console with 0 column
      or 0 row.
      
      We need to make sure that integer overflow in visual_init() won't happen.
      Since vc_do_resize() restricts cols <= 32767 and rows <= 32767, applying
      1 <= cols <= 32767 and 1 <= rows <= 32767 restrictions to vc_allocate()
      will be practically fine.
      
      This patch does not touch con_init(), for returning -EINVAL there
      does not help when we are not returning -ENOMEM.
      
      [1] https://syzkaller.appspot.com/bug?extid=017265e8553724e514e8Reported-and-tested-by: Nsyzbot <syzbot+017265e8553724e514e8@syzkaller.appspotmail.com>
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: stable <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200712111013.11881-1-penguin-kernel@I-love.SAKURA.ne.jpSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ce684552
  2. 20 7月, 2020 8 次提交
    • L
      Linux 5.8-rc6 · ba47d845
      Linus Torvalds 提交于
      ba47d845
    • L
      Merge tag 'perf-tools-fixes-2020-07-19' of... · 92188b41
      Linus Torvalds 提交于
      Merge tag 'perf-tools-fixes-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into master
      
      Pull perf tooling fixes from Arnaldo Carvalho de Melo:
      
       - Update hashmap.h from libbpf and kvm.h from x86's kernel UAPI.
      
       - Set opt->set in libsubcmd's OPT_CALLBACK_SET(). This fixes
         'perf record --switch-output-event event-name' usage"
      
      * tag 'perf-tools-fixes-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        tools arch kvm: Sync kvm headers with the kernel sources
        perf tools: Sync hashmap.h with libbpf's
        libsubcmd: Fix OPT_CALLBACK_SET()
      92188b41
    • L
      Merge tag 'x86-urgent-2020-07-19' of... · efb9666e
      Linus Torvalds 提交于
      Merge tag 'x86-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master
      
      Pull x86 fixes from Thomas Gleixner:
       "A pile of fixes for x86:
      
         - Fix the I/O bitmap invalidation on XEN PV, which was overlooked in
           the recent ioperm/iopl rework. This caused the TSS and XEN's I/O
           bitmap to get out of sync.
      
         - Use the proper vectors for HYPERV.
      
         - Make disabling of stack protector for the entry code work with GCC
           builds which enable stack protector by default. Removing the option
           is not sufficient, it needs an explicit -fno-stack-protector to
           shut it off.
      
         - Mark check_user_regs() noinstr as it is called from noinstr code.
           The missing annotation causes it to be placed in the text section
           which makes it instrumentable.
      
         - Add the missing interrupt disable in exc_alignment_check()
      
         - Fixup a XEN_PV build dependency in the 32bit entry code
      
         - A few fixes to make the Clang integrated assembler happy
      
         - Move EFI stub build to the right place for out of tree builds
      
         - Make prepare_exit_to_usermode() static. It's not longer called from
           ASM code"
      
      * tag 'x86-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/boot: Don't add the EFI stub to targets
        x86/entry: Actually disable stack protector
        x86/ioperm: Fix io bitmap invalidation on Xen PV
        x86: math-emu: Fix up 'cmp' insn for clang ias
        x86/entry: Fix vectors to IDTENTRY_SYSVEC for CONFIG_HYPERV
        x86/entry: Add compatibility with IAS
        x86/entry/common: Make prepare_exit_to_usermode() static
        x86/entry: Mark check_user_regs() noinstr
        x86/traps: Disable interrupts in exc_aligment_check()
        x86/entry/32: Fix XEN_PV build dependency
      efb9666e
    • L
      Merge tag 'timers-urgent-2020-07-19' of... · 66e4b636
      Linus Torvalds 提交于
      Merge tag 'timers-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master
      
      Pull timer fixes from Thomas Gleixner:
       "Two fixes for the timer wheel:
      
         - A timer which is already expired at enqueue time can set the
           base->next_expiry value backwards. As a consequence base->clk can
           be set back as well. This can lead to timers expiring early. Add a
           sanity check to prevent this.
      
         - When a timer is queued with an expiry time beyond the wheel
           capacity then it should be queued in the bucket of the last wheel
           level which is expiring last.
      
           The code adjusted the expiry time to the maximum wheel capacity,
           which is only correct when the wheel clock is 0. Aside of that the
           check whether the delta is larger than wheel capacity does not
           check the delta, it checks the expiry value itself. As a result
           timers can expire at random.
      
           Fix this by checking the right variable and adjust expiry time so
           it becomes base->clock plus capacity which places it into the
           outmost bucket in the last wheel level"
      
      * tag 'timers-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        timer: Fix wheel index calculation on last level
        timer: Prevent base->clk from moving backward
      66e4b636
    • L
      Merge tag 'sched-urgent-2020-07-19' of... · 43768f7c
      Linus Torvalds 提交于
      Merge tag 'sched-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master
      
      Pull scheduler fixes from Thomas Gleixner:
       "A set of scheduler fixes:
      
         - Plug a load average accounting race which was introduced with a
           recent optimization casing load average to show bogus numbers.
      
         - Fix the rseq CPU id initialization for new tasks. sched_fork() does
           not update the rseq CPU id so the id is the stale id of the parent
           task, which can cause user space data corruption.
      
         - Handle a 0 return value of task_h_load() correctly in the load
           balancer, which does not decrease imbalance and therefore pulls
           until the maximum number of loops is reached, which might be all
           tasks just created by a fork bomb"
      
      * tag 'sched-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/fair: handle case of task_h_load() returning 0
        sched: Fix unreliable rseq cpu_id for new tasks
        sched: Fix loadavg accounting race
      43768f7c
    • L
      Merge tag 'irq-urgent-2020-07-19' of... · 9413cd77
      Linus Torvalds 提交于
      Merge tag 'irq-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master
      
      Pull irq fixes from Thomas Gleixner:
       "Two fixes for the interrupt subsystem:
      
         - Make the handling of the firmware node consistent and do not free
           the node after the domain has been created successfully. The core
           code stores a pointer to it which can lead to a use after free or
           double free.
      
           This used to "work" because the pointer was not stored when the
           initial code was written, but at some point later it was required
           to store it. Of course nobody noticed that the existing users break
           that way.
      
         - Handle affinity setting on inactive interrupts correctly when
           hierarchical irq domains are enabled.
      
           When interrupts are inactive with the modern hierarchical irqdomain
           design, the interrupt chips are not necessarily in a state where
           affinity changes can be handled. The legacy irq chip design allowed
           this because interrupts are immediately fully initialized at
           allocation time. X86 has a hacky workaround for this, but other
           implementations do not.
      
           This cased malfunction on GIC-V3. Instead of playing whack a mole
           to find all affected drivers, change the core code to store the
           requested affinity setting and then establish it when the interrupt
           is allocated, which makes the X86 hack go away"
      
      * tag 'irq-urgent-2020-07-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq/affinity: Handle affinity setting on inactive interrupts correctly
        irqdomain/treewide: Keep firmware node unconditionally allocated
      9413cd77
    • L
      Merge tag 'usb-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb into master · ce20d7bf
      Linus Torvalds 提交于
      Pull USB fixes from Greg KH:
       "Here are a few small USB fixes, and one thunderbolt fix, for 5.8-rc6.
      
        Nothing huge in here, just the normal collection of gadget, dwc2/3,
        serial, and other minor USB driver fixes and id additions. Full
        details are in the shortlog.
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'usb-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        USB: serial: iuu_phoenix: fix memory corruption
        USB: c67x00: fix use after free in c67x00_giveback_urb
        usb: gadget: function: fix missing spinlock in f_uac1_legacy
        usb: gadget: udc: atmel: fix uninitialized read in debug printk
        usb: gadget: udc: atmel: remove outdated comment in usba_ep_disable()
        usb: dwc2: Fix shutdown callback in platform
        usb: cdns3: trace: fix some endian issues
        usb: cdns3: ep0: fix some endian issues
        usb: gadget: udc: gr_udc: fix memleak on error handling path in gr_ep_init()
        usb: gadget: fix langid kernel-doc warning in usbstring.c
        usb: dwc3: pci: add support for the Intel Jasper Lake
        usb: dwc3: pci: add support for the Intel Tiger Lake PCH -H variant
        usb: chipidea: core: add wakeup support for extcon
        USB: serial: option: add Quectel EG95 LTE modem
        thunderbolt: Fix path indices used in USB3 tunnel discovery
        USB: serial: ch341: add new Product ID for CH340
        USB: serial: option: add GosunCn GM500 series
        USB: serial: cypress_m8: enable Simply Automated UPB PIM
      ce20d7bf
    • L
      Merge tag 'dma-mapping-5.8-6' of git://git.infradead.org/users/hch/dma-mapping into master · 8c18fc63
      Linus Torvalds 提交于
      Pull dma-mapping fixes from Christoph Hellwig:
       "Ensure we always have fully addressable memory in the dma coherent
        pool (Nicolas Saenz Julienne)"
      
      * tag 'dma-mapping-5.8-6' of git://git.infradead.org/users/hch/dma-mapping:
        dma-pool: do not allocate pool memory from CMA
        dma-pool: make sure atomic pool suits device
        dma-pool: introduce dma_guess_pool()
        dma-pool: get rid of dma_in_atomic_pool()
        dma-direct: provide function to check physical memory area validity
      8c18fc63
  3. 19 7月, 2020 6 次提交
  4. 18 7月, 2020 19 次提交
  5. 17 7月, 2020 3 次提交
    • L
      Merge tag 'sound-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound into master · a238ac2d
      Linus Torvalds 提交于
      Pull sound fixes from Takashi Iwai:
       "No surprise here, just a few device-specific small fixes: two fixes
        for USB LINE6 and one for USB-audio drivers wrt syzkaller fuzzer
        issues, while the rest are all HD-audio Realtek quirks"
      
      * tag 'sound-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda/realtek - fixup for yet another Intel reference board
        ALSA: hda/realtek - Enable Speaker for ASUS UX563
        ALSA: hda/realtek - Enable Speaker for ASUS UX533 and UX534
        ALSA: hda/realtek: Enable headset mic of Acer TravelMate B311R-31 with ALC256
        ALSA: hda/realtek: enable headset mic of ASUS ROG Zephyrus G14(G401) series with ALC289
        ALSA: hda/realtek - change to suitable link model for ASUS platform
        ALSA: usb-audio: Fix race against the error recovery URB submission
        ALSA: line6: Sync the pending work cancel at disconnection
        ALSA: line6: Perform sanity check for each URB creation
      a238ac2d
    • A
      tools arch kvm: Sync kvm headers with the kernel sources · 25d4e7f5
      Arnaldo Carvalho de Melo 提交于
      To pick up the changes from:
      
        83d31e52 ("KVM: nVMX: fixes for preemption timer migration")
      
      That don't entail changes in tooling.
      
      This silences these tools/perf build warnings:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/kvm.h' differs from latest version at 'arch/x86/include/uapi/asm/kvm.h'
        diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      25d4e7f5
    • A
      perf tools: Sync hashmap.h with libbpf's · 94fddb7a
      Arnaldo Carvalho de Melo 提交于
      To pick up the changes in:
      
        b2f9f153 ("libbpf: Fix libbpf hashmap on (I)LP32 architectures")
      
      Silencing this warning:
      
        Warning: Kernel ABI header at 'tools/perf/util/hashmap.h' differs from latest version at 'tools/lib/bpf/hashmap.h'
        diff -u tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h
      
      I'll eventually update the warning to remove the "Kernel ABI" part
      and instead state libbpf when noticing that the original is at
      "tools/lib/something".
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrii Nakryiko <andriin@fb.com>
      Cc: Jakub Bogusz <qboosh@pld-linux.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Ian Rogers <irogers@google.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      94fddb7a