Skip to content
  1. May 27, 2022
    • Vincent Whitchurch's avatar
      um: Fix out-of-bounds read in LDT setup · 2a4a62a1
      Vincent Whitchurch authored
      
      
      syscall_stub_data() expects the data_count parameter to be the number of
      longs, not bytes.
      
       ==================================================================
       BUG: KASAN: stack-out-of-bounds in syscall_stub_data+0x70/0xe0
       Read of size 128 at addr 000000006411f6f0 by task swapper/1
      
       CPU: 0 PID: 1 Comm: swapper Not tainted 5.18.0+ #18
       Call Trace:
        show_stack.cold+0x166/0x2a7
        __dump_stack+0x3a/0x43
        dump_stack_lvl+0x1f/0x27
        print_report.cold+0xdb/0xf81
        kasan_report+0x119/0x1f0
        kasan_check_range+0x3a3/0x440
        memcpy+0x52/0x140
        syscall_stub_data+0x70/0xe0
        write_ldt_entry+0xac/0x190
        init_new_ldt+0x515/0x960
        init_new_context+0x2c4/0x4d0
        mm_init.constprop.0+0x5ed/0x760
        mm_alloc+0x118/0x170
        0x60033f48
        do_one_initcall+0x1d7/0x860
        0x60003e7b
        kernel_init+0x6e/0x3d4
        new_thread_handler+0x1e7/0x2c0
      
       The buggy address belongs to stack of task swapper/1
        and is located at offset 64 in frame:
        init_new_ldt+0x0/0x960
      
       This frame has 2 objects:
        [32, 40) 'addr'
        [64, 80) 'desc'
       ==================================================================
      
      Fixes: 858259cf ("uml: maintain own LDT entries")
      Signed-off-by: default avatarVincent Whitchurch <vincent.whitchurch@axis.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      2a4a62a1
    • Johannes Berg's avatar
      um: chan_user: Fix winch_tramp() return value · 57ae0b67
      Johannes Berg authored
      
      
      The previous fix here was only partially correct, it did
      result in returning a proper error value in case of error,
      but it also clobbered the pid that we need to return from
      this function (not just zero for success).
      
      As a result, it returned 0 here, but later this is treated
      as a pid and used to kill the process, but since it's now
      0 we kill(0, SIGKILL), which makes UML kill itself rather
      than just the helper thread.
      
      Fix that and make it more obvious by using a separate
      variable for the pid.
      
      Fixes: ccf1236e ("um: fix error return code in winch_tramp()")
      Reported-and-tested-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      57ae0b67
    • Johannes Berg's avatar
      um: virtio_uml: Fix broken device handling in time-travel · af9fb41e
      Johannes Berg authored
      
      
      If a device implementation crashes, virtio_uml will mark it
      as dead by calling virtio_break_device() and scheduling the
      work that will remove it.
      
      This still seems like the right thing to do, but it's done
      directly while reading the message, and if time-travel is
      used, this is in the time-travel handler, outside of the
      normal Linux machinery. Therefore, we cannot acquire locks
      or do normal "linux-y" things because e.g. lockdep will be
      confused about the context.
      
      Move handling this situation out of the read function and
      into the actual IRQ handler and response handling instead,
      so that in the case of time-travel we don't call it in the
      wrong context.
      
      Chances are the system will still crash immediately, since
      the device implementation crashing may also cause the time-
      travel controller to go down, but at least all of that now
      happens without strange warnings from lockdep.
      
      Fixes: c8177aba ("um: time-travel: rework interrupt handling in ext mode")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      af9fb41e
    • Johannes Berg's avatar
      um: line: Use separate IRQs per line · d5a9597d
      Johannes Berg authored
      
      
      Today, all possible serial lines (ssl*=) as well as all
      possible consoles (con*=) each share a single interrupt
      (with a fixed number) with others of the same type.
      
      Now, if you have two lines, say ssl0 and ssl1, and one
      of them is connected to an fd you cannot read (e.g. a
      file), but the other gets a read interrupt, then both
      of them get the interrupt since it's shared. Then, the
      read() call will return EOF, since it's a file being
      written and there's nothing to read (at least not at
      the current offset, at the end).
      
      Unfortunately, this is treated as a read error, and we
      close this line, losing all the possible output.
      
      It might be possible to work around this and make the
      IRQ sharing work, however, now that we have dynamically
      allocated IRQs that are easy to use, simply use that to
      achieve separating between the events; then there's no
      interrupt for that line and we never attempt the read
      in the first place, thus not closing the line.
      
      This manifested itself in the wifi hostap/hwsim tests
      where the parallel script communicates via one serial
      console and the kernel messages go to another (a file)
      and sending data on the communication console caused
      the kernel messages to stop flowing into the file.
      
      Reported-by: default avatarJouni Malinen <j@w1.fi>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Acked-By: default avataranton ivanov <anton.ivanov@cambridgegreys.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      d5a9597d
    • Vincent Whitchurch's avatar
      um: Enable ARCH_HAS_GCOV_PROFILE_ALL · 2419ac32
      Vincent Whitchurch authored
      
      
      Enable ARCH_HAS_GCOV_PROFILE_ALL so that CONFIG_GCOV_PROFILE_ALL can be
      selected on UML.  I didn't need to explicitly disable GCOV on anything
      to get this to work on the configs I tested.
      
      Signed-off-by: default avatarVincent Whitchurch <vincent.whitchurch@axis.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      2419ac32
    • Johannes Berg's avatar
      um: Use asm-generic/dma-mapping.h · 36571903
      Johannes Berg authored
      
      
      If DMA (PCI over virtio) is enabled, then some drivers may
      enable CONFIG_DMA_OPS as well, and then we pull in the x86
      definition of get_arch_dma_ops(), which uses the dma_ops
      symbol, which isn't defined.
      
      Since we don't have real DMA ops nor any kind of IOMMU fix
      this in the simplest possible way: pull in the asm-generic
      file instead of inheriting the x86 one. It's not clear why
      those drivers that do (e.g. VDPA) "select DMA_OPS", and if
      they'd even work with this, but chances are nobody will be
      wanting to do that anyway, so fixing the build failure is
      good enough.
      
      Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Fixes: 68f5d3f3 ("um: add PCI over virtio emulation driver")
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      36571903
    • Johannes Berg's avatar
      um: daemon: Make default socket configurable · b0cbccf4
      Johannes Berg authored
      
      
      Even if daemon network is deprecated, some configurations may
      still use it (e.g. Debian), and not want to default to the
      /tmp/uml.ctl socket location. Allow configuring the default
      socket location.
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Acked-By: default avatarAnton Ivanov <anton.ivanov@cambridgegreys.com>
      Tested-by: default avatarRitesh Raj Sarraf <ritesh@collabora.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      b0cbccf4
    • Johannes Berg's avatar
      um: xterm: Make default terminal emulator configurable · 16aa835a
      Johannes Berg authored
      
      
      Make the default terminal emulator configurable so e.g.
      Debian can set it to x-terminal-emulator instead of the
      current default of xterm.
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Acked-By: default avatarAnton Ivanov <anton.ivanov@cambridgegreys.com>
      Tested-by: default avatarRitesh Raj Sarraf <ritesh@collabora.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      16aa835a
  2. May 16, 2022
  3. May 15, 2022
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.18-rc7' of... · 0cdd776e
      Linus Torvalds authored
      Merge tag 'driver-core-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core fixes from Greg KH:
       "Here is one fix, and three documentation updates for 5.18-rc7.
      
        The fix is for the firmware loader which resolves a long-reported
        problem where the credentials of the firmware loader could be set to a
        userspace process without enough permissions to actually load the
        firmware image. Many Android vendors have been reporting this for
        quite some time.
      
        The documentation updates are for the embargoed-hardware-issues.rst
        file to add a new entry, change an existing one, and sort the list to
        make changes easier in the future.
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'driver-core-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        Documentation/process: Update ARM contact for embargoed hardware issues
        Documentation/process: Add embargoed HW contact for Ampere Computing
        Documentation/process: Make groups alphabetical and use tabs consistently
        firmware_loader: use kernel credentials when reading firmware
      0cdd776e
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 5becde60
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are two small driver fixes for 5.18-rc7 that resolve reported
        problems:
      
         - slimbus driver irq bugfix
      
         - interconnect sync state bugfix
      
        Both of these have been in linux-next with no reported problems"
      
      * tag 'char-misc-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        slimbus: qcom: Fix IRQ check in qcom_slim_probe
        interconnect: Restore sync state by ignoring ipa-virt in provider count
      5becde60
    • Linus Torvalds's avatar
      Merge tag 'tty-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 6811a466
      Linus Torvalds authored
      Pull tty/serial driver fixes from Greg KH:
       "Here are some small tty n_gsm and serial driver fixes for 5.18-rc7
        that resolve reported problems. They include:
      
         - n_gsm fixes for reported issues
      
         - 8250_mtk driver fixes for some platforms
      
         - fsl_lpuart driver fix for reported problem.
      
         - digicolor driver fix for reported problem.
      
        All have been in linux-next for a while with no reported problems"
      
      * tag 'tty-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        fsl_lpuart: Don't enable interrupts too early
        tty: n_gsm: fix invalid gsmtty_write_room() result
        tty: n_gsm: fix mux activation issues in gsm_config()
        tty: n_gsm: fix buffer over-read in gsm_dlci_data()
        serial: 8250_mtk: Fix register address for XON/XOFF character
        serial: 8250_mtk: Make sure to select the right FEATURE_SEL
        serial: 8250_mtk: Fix UART_EFR register address
        tty/serial: digicolor: fix possible null-ptr-deref in digicolor_uart_probe()
      6811a466
    • Linus Torvalds's avatar
      Merge tag 'usb-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · fc49583c
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some small fixes for reported issues with some USB drivers.
        They include:
      
         - xhci fixes for xhci-mtk platform driver
      
         - typec driver fixes for reported problems.
      
         - cdc-wdm read-stuck fix
      
         - gadget driver fix for reported race condition
      
         - new usb-serial driver ids
      
        All of these have been in linux-next with no reported problems"
      
      * tag 'usb-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: xhci-mtk: remove bandwidth budget table
        usb: xhci-mtk: fix fs isoc's transfer error
        usb: gadget: fix race when gadget driver register via ioctl
        usb: typec: tcpci_mt6360: Update for BMC PHY setting
        usb: gadget: uvc: allow for application to cleanly shutdown
        usb: typec: tcpci: Don't skip cleanup in .remove() on error
        usb: cdc-wdm: fix reading stuck on device close
        USB: serial: qcserial: add support for Sierra Wireless EM7590
        USB: serial: option: add Fibocom MA510 modem
        USB: serial: option: add Fibocom L610 modem
        USB: serial: pl2303: add device id for HP LM930 Display
      fc49583c
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.18-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · bc403203
      Linus Torvalds authored
      Pull powerpc fix from Michael Ellerman:
      
       - Fix KVM PR on 32-bit, which was broken by some MMU code refactoring.
      
      Thanks to: Alexander Graf, and Matt Evans.
      
      * tag 'powerpc-5.18-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        KVM: PPC: Book3S PR: Enable MSR_DR for switch_mmu_context()
      bc403203
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2022-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 79dc4fc2
      Linus Torvalds authored
      Pull x86 fix from Thomas Gleixner:
       "A single fix for the handling of unpopulated sub-pmd spaces.
      
        The copy & pasta from the corresponding s390 code screwed up the
        address calculation for marking the sub-pmd ranges via memset by
        omitting the ALIGN_DOWN() to calculate the proper start address.
      
        It's a mystery why this code is not generic and shared because there
        is nothing architecture specific in there, but that's too intrusive
        for a backportable fix"
      
      * tag 'x86-urgent-2022-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm: Fix marking of unused sub-pmd ranges
      79dc4fc2
    • Linus Torvalds's avatar
      Merge tag 'sched-urgent-2022-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 990e798d
      Linus Torvalds authored
      Pull scheduler fix from Thomas Gleixner:
       "The recent expansion of the sched switch tracepoint inserted a new
        argument in the middle of the arguments. This reordering broke BPF
        programs which relied on the old argument list.
      
        While tracepoints are not considered stable ABI, it's not trivial to
        make BPF cope with such a change, but it's being worked on. For now
        restore the original argument order and move the new argument to the
        end of the argument list"
      
      * tag 'sched-urgent-2022-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/tracing: Append prev_state to tp args instead
      990e798d
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2022-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · fb756280
      Linus Torvalds authored
      Pull irq fix from Thomas Gleixner:
       "A single fix for a recent (introduced in 5.16) regression in the core
        interrupt code.
      
        The consolidation of the interrupt handler invocation code added an
        unconditional warning when generic_handle_domain_irq() is invoked from
        outside hard interrupt context. That's overbroad as the requirement
        for invoking these handlers in hard interrupt context is only required
        for certain interrupt types. The subsequently called code already
        contains a warning which triggers conditionally for interrupt chips
        which indicate this requirement in their properties.
      
        Remove the overbroad one"
      
      * tag 'irq-urgent-2022-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq: Remove WARN_ON_ONCE() in generic_handle_domain_irq()
      fb756280
  4. May 14, 2022
  5. May 13, 2022
Loading