1. 09 Dec, 2020 18 commits
  2. 05 Dec, 2020 1 commit
  3. 04 Dec, 2020 6 commits
  4. 09 Nov, 2020 4 commits
    • Mauro Carvalho Chehab's avatar
      drivers: base: fix some kernel-doc markups · 33c0c9bd
      Mauro Carvalho Chehab authored
      class_create is actually defined at the header. Fix the
      markup there and add a new one at the right place.
      
      While here, also fix some markups for functions that have
      different names between their prototypes and kernel-doc
      comments.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Link: https://lore.kernel.org/r/2fb6efd6a1f90d69ff73bf579566079cbb051e15.1603469755.git.mchehab+huawei@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      33c0c9bd
    • Saravana Kannan's avatar
      driver core: Fix lockdep warning on wfs_lock · 7008e58c
      Saravana Kannan authored
      There's a potential deadlock with the following cycle:
      wfs_lock --> device_links_lock --> kn->count
      
      Fix this by simply dropping the lock around a list_empty() check that's
      just exported to a sysfs file. The sysfs file output is an instantaneous
      check anyway and the lock doesn't really add any protection.
      
      Lockdep log:
      
      [   48.808132]
      [   48.808132] the existing dependency chain (in reverse order) is:
      [   48.809069]
      [   48.809069] -> #2 (kn->count){++++}:
      [   48.809707]        __kernfs_remove.llvm.7860393000964815146+0x2d4/0x460
      [   48.810537]        kernfs_remove_by_name_ns+0x54/0x9c
      [   48.811171]        sysfs_remove_file_ns+0x18/0x24
      [   48.811762]        device_del+0x2b8/0x5a8
      [   48.812269]        __device_link_del+0x98/0xb8
      [   48.812829]        device_links_driver_bound+0x210/0x2d8
      [   48.813496]        driver_bound+0x44/0xf8
      [   48.814000]        really_probe+0x340/0x6e0
      [   48.814526]        driver_probe_device+0xb8/0x100
      [   48.815117]        device_driver_attach+0x78/0xb8
      [   48.815708]        __driver_attach+0xe0/0x194
      [   48.816255]        bus_for_each_dev+0xa8/0x11c
      [   48.816816]        driver_attach+0x24/0x30
      [   48.817331]        bus_add_driver+0x100/0x1e0
      [   48.817880]        driver_register+0x78/0x114
      [   48.818427]        __platform_driver_register+0x44/0x50
      [   48.819089]        0xffffffdbb3227038
      [   48.819551]        do_one_initcall+0xd8/0x1e0
      [   48.820099]        do_init_module+0xd8/0x298
      [   48.820636]        load_module+0x3afc/0x44c8
      [   48.821173]        __arm64_sys_finit_module+0xbc/0xf0
      [   48.821807]        el0_svc_common+0xbc/0x1d0
      [   48.822344]        el0_svc_handler+0x74/0x98
      [   48.822882]        el0_svc+0x8/0xc
      [   48.823310]
      [   48.823310] -> #1 (device_links_lock){+.+.}:
      [   48.824036]        __mutex_lock_common+0xe0/0xe44
      [   48.824626]        mutex_lock_nested+0x28/0x34
      [   48.825185]        device_link_add+0xd4/0x4ec
      [   48.825734]        of_link_to_suppliers+0x158/0x204
      [   48.826347]        of_fwnode_add_links+0x50/0x64
      [   48.826928]        device_link_add_missing_supplier_links+0x90/0x11c
      [   48.827725]        fw_devlink_resume+0x58/0x130
      [   48.828296]        of_platform_default_populate_init+0xb4/0xd0
      [   48.829030]        do_one_initcall+0xd8/0x1e0
      [   48.829578]        do_initcall_level+0xb8/0xcc
      [   48.830137]        do_basic_setup+0x60/0x7c
      [   48.830662]        kernel_init_freeable+0x128/0x1ac
      [   48.831275]        kernel_init+0x18/0x29c
      [   48.831781]        ret_from_fork+0x10/0x18
      [   48.832297]
      [   48.832297] -> #0 (wfs_lock){+.+.}:
      [   48.832922]        __lock_acquire+0xe04/0x2e20
      [   48.833480]        lock_acquire+0xbc/0xec
      [   48.833984]        __mutex_lock_common+0xe0/0xe44
      [   48.834577]        mutex_lock_nested+0x28/0x34
      [   48.835136]        waiting_for_supplier_show+0x3c/0x98
      [   48.835781]        dev_attr_show+0x48/0xb4
      [   48.836295]        sysfs_kf_seq_show+0xe8/0x184
      [   48.836864]        kernfs_seq_show+0x48/0x8c
      [   48.837401]        seq_read+0x1c8/0x600
      [   48.837884]        kernfs_fop_read+0x68/0x204
      [   48.838431]        __vfs_read+0x60/0x214
      [   48.838925]        vfs_read+0xbc/0x15c
      [   48.839397]        ksys_read+0x78/0xe4
      [   48.839869]        __arm64_sys_read+0x1c/0x28
      [   48.840416]        el0_svc_common+0xbc/0x1d0
      [   48.840953]        el0_svc_handler+0x74/0x98
      [   48.841490]        el0_svc+0x8/0xc
      [   48.841917]
      [   48.841917] other info that might help us debug this:
      [   48.841917]
      [   48.842920] Chain exists of:
      [   48.842920]   wfs_lock --> device_links_lock --> kn->count
      [   48.842920]
      [   48.844152]  Possible unsafe locking scenario:
      [   48.844152]
      [   48.844895]        CPU0                    CPU1
      [   48.845463]        ----                    ----
      [   48.846032]   lock(kn->count);
      [   48.846417]                                lock(device_links_lock);
      [   48.847203]                                lock(kn->count);
      [   48.847902]   lock(wfs_lock);
      [   48.848276]
      [   48.848276]  *** DEADLOCK ***
      
      Reported-by: Cheng-Jui.Wang@mediatek.com
      Signed-off-by: default avatarSaravana Kannan <saravanak@google.com>
      Link: https://lore.kernel.org/r/20201104205431.3795207-1-saravanak@google.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7008e58c
    • Willem de Bruijn's avatar
      kernfs: bring names in comments in line with code · 21774fd8
      Willem de Bruijn authored
      Fix two stragglers in the comments of the below rename operation.
      
      Fixes: adc5e8b5 ("kernfs: drop s_ prefix from kernfs_node members")
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://lore.kernel.org/r/20201015185726.1386868-1-willemdebruijn.kernel@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      21774fd8
    • Linus Torvalds's avatar
      Linux 5.10-rc3 · f8394f23
      Linus Torvalds authored
      f8394f23
  5. 08 Nov, 2020 11 commits
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.10-rc3' of... · 15f5d201
      Linus Torvalds authored
      Merge tag 'driver-core-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core documentation fixes from Greg KH:
       "Some small Documentation fixes that were fallout from the larger
        documentation update we did in 5.10-rc2.
      
        Nothing major here at all, but all of these have been in linux-next
        and resolve build warnings when building the documentation files"
      
      * tag 'driver-core-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        Documentation: remove mic/index from misc-devices/index.rst
        scripts: get_api.pl: Add sub-titles to ABI output
        scripts: get_abi.pl: Don't let ABI files to create subtitles
        docs: leds: index.rst: add a missing file
        docs: ABI: sysfs-class-net: fix a typo
        docs: ABI: sysfs-driver-dma-ioatdma: what starts with /sys
      15f5d201
    • Linus Torvalds's avatar
      Merge tag 'tty-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · bbc82184
      Linus Torvalds authored
      Pull tty/serial fixes from Greg KH:
       "Here are a small number of small tty and serial fixes for some
        reported problems for the tty core, vt code, and some serial drivers.
      
        They include fixes for:
      
         - a buggy and obsolete vt font ioctl removal
      
         - 8250_mtk serial baudrate runtime warnings
      
         - imx serial earlycon build configuration fix
      
         - txx9 serial driver error path cleanup issues
      
         - tty core fix in release_tty that can be triggered by trying to bind
           an invalid serial port name to a speakup console device
      
        Almost all of these have been in linux-next without any problems, the
        only one that hasn't, just deletes code :)"
      
      * tag 'tty-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        vt: Disable KD_FONT_OP_COPY
        tty: fix crash in release_tty if tty->port is not set
        serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init
        tty: serial: imx: enable earlycon by default if IMX_SERIAL_CONSOLE is enabled
        serial: 8250_mtk: Fix uart_get_baud_rate warning
      bbc82184
    • Linus Torvalds's avatar
      Merge tag 'usb-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · df53b815
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some small USB fixes and new device ids:
      
         - USB gadget fixes for some reported issues
      
         - Fixes for the ever-troublesome apple fastcharge driver, hopefully
           we finally have it right.
      
         - More USB core quirks for odd devices
      
         - USB serial driver fixes for some long-standing issues that were
           recently found
      
         - some new USB serial driver device ids
      
        All have been in linux-next with no reported issues"
      
      * tag 'usb-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        USB: apple-mfi-fastcharge: fix reference leak in apple_mfi_fc_set_property
        usb: mtu3: fix panic in mtu3_gadget_stop()
        USB: serial: option: add Telit FN980 composition 0x1055
        USB: serial: option: add LE910Cx compositions 0x1203, 0x1230, 0x1231
        USB: serial: cyberjack: fix write-URB completion race
        USB: Add NO_LPM quirk for Kingston flash drive
        USB: serial: option: add Quectel EC200T module support
        usb: raw-gadget: fix memory leak in gadget_setup
        usb: dwc2: Avoid leaving the error_debugfs label unused
        usb: dwc3: ep0: Fix delay status handling
        usb: gadget: fsl: fix null pointer checking
        usb: gadget: goku_udc: fix potential crashes in probe
        usb: dwc3: pci: add support for the Intel Alder Lake-S
      df53b815
    • Eddy Wu's avatar
      fork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent · b4e00444
      Eddy Wu authored
      current->group_leader->exit_signal may change during copy_process() if
      current->real_parent exits.
      
      Move the assignment inside tasklist_lock to avoid the race.
      Signed-off-by: default avatarEddy Wu <eddy_wu@trendmicro.com>
      Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b4e00444
    • Daniel Vetter's avatar
      vt: Disable KD_FONT_OP_COPY · 3c4e0dff
      Daniel Vetter authored
      It's buggy:
      
      On Fri, Nov 06, 2020 at 10:30:08PM +0800, Minh Yuan wrote:
      > We recently discovered a slab-out-of-bounds read in fbcon in the latest
      > kernel ( v5.10-rc2 for now ).  The root cause of this vulnerability is that
      > "fbcon_do_set_font" did not handle "vc->vc_font.data" and
      > "vc->vc_font.height" correctly, and the patch
      > <https://lkml.org/lkml/2020/9/27/223> for VT_RESIZEX can't handle this
      > issue.
      >
      > Specifically, we use KD_FONT_OP_SET to set a small font.data for tty6, and
      > use  KD_FONT_OP_SET again to set a large font.height for tty1. After that,
      > we use KD_FONT_OP_COPY to assign tty6's vc_font.data to tty1's vc_font.data
      > in "fbcon_do_set_font", while tty1 retains the original larger
      > height. Obviously, this will cause an out-of-bounds read, because we can
      > access a smaller vc_font.data with a larger vc_font.height.
      
      Further there was only one user ever.
      - Android's loadfont, busybox and console-tools only ever use OP_GET
        and OP_SET
      - fbset documentation only mentions the kernel cmdline font: option,
        not anything else.
      - systemd used OP_COPY before release 232 published in Nov 2016
      
      Now unfortunately the crucial report seems to have gone down with
      gmane, and the commit message doesn't say much. But the pull request
      hints at OP_COPY being broken
      
      https://github.com/systemd/systemd/pull/3651
      
      So in other words, this never worked, and the only project which
      foolishly every tried to use it, realized that rather quickly too.
      
      Instead of trying to fix security issues here on dead code by adding
      missing checks, fix the entire thing by removing the functionality.
      
      Note that systemd code using the OP_COPY function ignored the return
      value, so it doesn't matter what we're doing here really - just in
      case a lone server somewhere happens to be extremely unlucky and
      running an affected old version of systemd. The relevant code from
      font_copy_to_all_vcs() in systemd was:
      
      	/* copy font from active VT, where the font was uploaded to */
      	cfo.op = KD_FONT_OP_COPY;
      	cfo.height = vcs.v_active-1; /* tty1 == index 0 */
      	(void) ioctl(vcfd, KDFONTOP, &cfo);
      
      Note this just disables the ioctl, garbage collecting the now unused
      callbacks is left for -next.
      
      v2: Tetsuo found the old mail, which allowed me to find it on another
      archive. Add the link too.
      Acked-by: default avatarPeilin Ye <yepeilin.cs@gmail.com>
      Reported-by: default avatarMinh Yuan <yuanmingbuaa@gmail.com>
      References: https://lists.freedesktop.org/archives/systemd-devel/2016-June/036935.html
      References: https://github.com/systemd/systemd/pull/3651
      Cc: Greg KH <greg@kroah.com>
      Cc: Peilin Ye <yepeilin.cs@gmail.com>
      Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: https://lore.kernel.org/r/20201108153806.3140315-1-daniel.vetter@ffwll.chSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3c4e0dff
    • Linus Torvalds's avatar
      Merge tag 'xfs-5.10-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 9dbc1c03
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
      
       - Fix an uninitialized struct problem
      
       - Fix an iomap problem zeroing unwritten EOF blocks
      
       - Fix some clumsy error handling when writeback fails on filesystems
         with blocksize < pagesize
      
       - Fix a retry loop not resetting loop variables properly
      
       - Fix scrub flagging rtinherit inodes on a non-rt fs, since the kernel
         actually does permit that combination
      
       - Fix excessive page cache flushing when unsharing part of a file
      
      * tag 'xfs-5.10-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: only flush the unshared range in xfs_reflink_unshare
        xfs: fix scrub flagging rtinherit even if there is no rt device
        xfs: fix missing CoW blocks writeback conversion retry
        iomap: clean up writeback state logic on writepage error
        iomap: support partial page discard on writeback block mapping failure
        xfs: flush new eof page on truncate to avoid post-eof corruption
        xfs: set xefi_discard when creating a deferred agfl free log intent item
      9dbc1c03
    • Linus Torvalds's avatar
      Merge branch 'hch' (patches from Christoph) · 6b2c4d52
      Linus Torvalds authored
      Merge procfs splice read fixes from Christoph Hellwig:
       "Greg reported a problem due to the fact that Android tests use procfs
        files to test splice, which stopped working with the changes for
        set_fs() removal.
      
        This series adds read_iter support for seq_file, and uses those for
        various proc files using seq_file to restore splice read support"
      
      [ Side note: Christoph initially had a scripted "move everything over"
        patch, which looks fine, but I personally would prefer us to actively
        discourage splice() on random files.  So this does just the minimal
        basic core set of proc file op conversions.
      
        For completeness, and in case people care, that script was
      
           sed -i -e 's/\.proc_read\(\s*=\s*\)seq_read/\.proc_read_iter\1seq_read_iter/g'
      
        but I'll wait and see if somebody has a strong argument for using
        splice on random small /proc files before I'd run it on the whole
        kernel.   - Linus ]
      
      * emailed patches from Christoph Hellwig <hch@lst.de>:
        proc "seq files": switch to ->read_iter
        proc "single files": switch to ->read_iter
        proc/stat: switch to ->read_iter
        proc/cpuinfo: switch to ->read_iter
        proc: wire up generic_file_splice_read for iter ops
        seq_file: add seq_read_iter
      6b2c4d52
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 40be821d
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A set of x86 fixes:
      
         - Use SYM_FUNC_START_WEAK in the mem* ASM functions instead of a
           combination of .weak and SYM_FUNC_START_LOCAL which makes LLVMs
           integrated assembler upset
      
         - Correct the mitigation selection logic which prevented the related
           prctl to work correctly
      
         - Make the UV5 hubless system work correctly by fixing up the
           malformed table entries and adding the missing ones"
      
      * tag 'x86-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/platform/uv: Recognize UV5 hubless system identifier
        x86/platform/uv: Remove spaces from OEM IDs
        x86/platform/uv: Fix missing OEM_TABLE_ID
        x86/speculation: Allow IBPB to be conditionally enabled on CPUs with always-on STIBP
        x86/lib: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S
      40be821d
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 100e3891
      Linus Torvalds authored
      Pull perf fix from Thomas Gleixner:
       "A single fix for the perf core plugging a memory leak in the address
        filter parser"
      
      * tag 'perf-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/core: Fix a memory leak in perf_event_parse_addr_filter()
      100e3891
    • Linus Torvalds's avatar
      Merge tag 'locking-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · aaaaa7ec
      Linus Torvalds authored
      Pull futex fix from Thomas Gleixner:
       "A single fix for the futex code where an intermediate state in the
        underlying RT mutex was not handled correctly and triggering a BUG()
        instead of treating it as another variant of retry condition"
      
      * tag 'locking-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        futex: Handle transient "ownerless" rtmutex state correctly
      aaaaa7ec
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 15a98444
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "A set of fixes for interrupt chip drivers:
      
         - Fix the fallout of the IPI as interrupt conversion in Kconfig and
           the BCM2836 interrupt chip driver
      
         - Fixes for interrupt affinity setting and the handling of
           hierarchical irq domains in the SiFive PLIC driver
      
         - Make the unmapped event handling in the TI SCI driver work
           correctly
      
         - A few minor fixes and cleanups in various chip drivers and Kconfig"
      
      * tag 'irq-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        dt-bindings: irqchip: ti, sci-inta: Fix diagram indentation for unmapped events
        irqchip/ti-sci-inta: Add support for unmapped event handling
        dt-bindings: irqchip: ti, sci-inta: Update for unmapped event handling
        irqchip/renesas-intc-irqpin: Merge irlm_bit and needs_irlm
        irqchip/sifive-plic: Fix chip_data access within a hierarchy
        irqchip/sifive-plic: Fix broken irq_set_affinity() callback
        irqchip/stm32-exti: Add all LP timer exti direct events support
        irqchip/bcm2836: Fix missing __init annotation
        irqchip/mips: Drop selection of IRQ_DOMAIN_HIERARCHY
        irqchip/mst: Make mst_intc_of_init static
        irqchip/mst: MST_IRQ should depend on ARCH_MEDIATEK or ARCH_MSTARV7
        genirq: Let GENERIC_IRQ_IPI select IRQ_DOMAIN_HIERARCHY
      15a98444