Skip to content
  1. Nov 19, 2022
    • Linus Torvalds's avatar
      Merge tag 'driver-core-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · 63c8c0d7
      Linus Torvalds authored
      Pull driver core fixes from Greg KH:
       "Here are two small driver core fixes for 6.1-rc6:
      
         - utsname fix, this one should already be in your tree as it came
           from a different tree earlier.
      
         - kernfs bugfix for a much reported syzbot report that seems to keep
           getting triggered.
      
        Both of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'driver-core-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        kernfs: Fix spurious lockdep warning in kernfs_find_and_get_node_by_id()
        kernel/utsname_sysctl.c: Add missing enum uts_proc value
      63c8c0d7
    • Linus Torvalds's avatar
      Merge tag 'char-misc-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 1f63d1a1
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are some small char/misc and other driver fixes for 6.1-rc6 to
        resolve some reported problems. Included in here are:
      
         - iio driver fixes
      
         - binder driver fix
      
         - nvmem driver fix
      
         - vme_vmci information leak fix
      
         - parport fix
      
         - slimbus configuration fix
      
         - coreboot firmware bugfix
      
         - speakup build fix and crash fix
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'char-misc-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (22 commits)
        firmware: coreboot: Register bus in module init
        nvmem: u-boot-env: fix crc32_data_offset on redundant u-boot-env
        slimbus: qcom-ngd: Fix build error when CONFIG_SLIM_QCOM_NGD_CTRL=y && CONFIG_QCOM_RPROC_COMMON=m
        docs: update mediator contact information in CoC doc
        slimbus: stream: correct presence rate frequencies
        nvmem: lan9662-otp: Fix compatible string
        binder: validate alloc->mm in ->mmap() handler
        parport_pc: Avoid FIFO port location truncation
        siox: fix possible memory leak in siox_device_add()
        misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram()
        speakup: replace utils' u_char with unsigned char
        speakup: fix a segfault caused by switching consoles
        tools: iio: iio_generic_buffer: Fix read size
        iio: imu: bno055: uninitialized variable bug in bno055_trigger_handler()
        iio: adc: at91_adc: fix possible memory leak in at91_adc_allocate_trigger()
        iio: adc: mp2629: fix potential array out of bound access
        iio: adc: mp2629: fix wrong comparison of channel
        iio: pressure: ms5611: changed hardcoded SPI speed to value limited
        iio: pressure: ms5611: fixed value compensation bug
        iio: accel: bma400: Ensure VDDIO is enable defore reading the chip ID.
        ...
      1f63d1a1
    • Linus Torvalds's avatar
      Merge tag 'sound-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · ae558268
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A fair amount of commits at this time due to ASoC PR merge, but all
        look small and easy, mostly device-specific fixes spanned in various
        drivers. Hopefully this should be the last big chunk for 6.1"
      
      * tag 'sound-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (21 commits)
        ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360
        ALSA: hda/realtek: fix speakers for Samsung Galaxy Book Pro
        ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open()
        ASoC: stm32: dfsdm: manage cb buffers cleanup
        ASoC: sof_es8336: reduce pop noise on speaker
        ASoC: SOF: topology: No need to assign core ID if token parsing failed
        ASoC: soc-utils: Remove __exit for snd_soc_util_exit()
        ASoC: rt5677: fix legacy dai naming
        ASoC: rt5514: fix legacy dai naming
        ASoC: SOF: ipc3-topology: use old pipeline teardown flow with SOF2.1 and older
        ASoC: hda: intel-dsp-config: add ES83x6 quirk for IceLake
        ASoC: Intel: soc-acpi: add ES83x6 support to IceLake
        ASoC: tas2780: Fix set_tdm_slot in case of single slot
        ASoC: tas2764: Fix set_tdm_slot in case of single slot
        ASoC: tas2770: Fix set_tdm_slot in case of single slot
        ASoC: fsl_asrc fsl_esai fsl_sai: allow CONFIG_PM=N
        ASoC: core: Fix use-after-free in snd_soc_exit()
        MAINTAINERS: update Tzung-Bi's email address
        ASoC: Intel: bytcht_es8316: Add quirk for the Nanote UMPC-01
        ASoC: amd: yc: Add Alienware m17 R5 AMD into DMI table
        ...
      ae558268
    • Linus Torvalds's avatar
      Merge tag 'mmc-v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 4ab9ffda
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "MMC core:
         - Fixup VDD/VMMC voltage-range negotiation
      
        MMC host:
         - sdhci-pci: Fix memory leak by adding a missing pci_dev_put()
         - sdhci-pci-o2micro: Fix card detect by tuning the debounce timeout"
      
      * tag 'mmc-v6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put()
        mmc: sdhci-pci-o2micro: fix card detect fail issue caused by CD# debounce timeout
        mmc: core: properly select voltage range without power cycle
      4ab9ffda
  2. Nov 18, 2022
    • Linus Torvalds's avatar
      Merge tag 'soc-fixes-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 84368d88
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "Another set of devicetree and code changes for SoC platforms, notably:
      
         - DT schema warning fixes for i.MX
      
         - Functional fixes for i.MX tqma8mqml-mba8mx USB and i.MX8M OCOTP
      
         - MAINTAINERS updates for Hisilicon and RISC-V, documenting which
           RISC-V SoC specific patches will now get merged through the SoC
           tree in the future.
      
         - A code fix for at91 suspend, to work around broken hardware
      
         - A devicetree fix for lan966x/pcb8291 LED support
      
         - Lots of DT fixes for Qualcomm SoCs, mostly fixing minor problems
           like incorrect register sizes and schema warnings. One fix makes
           the UFS controller work on sc8280xp, and six fixes address the same
           regulator problem in a variety of platforms"
      
      * tag 'soc-fixes-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (31 commits)
        MAINTAINERS: repair Microchip corei2c driver entry
        MAINTAINERS: add an entry for StarFive devicetrees
        MAINTAINERS: generify the Microchip RISC-V entry name
        MAINTAINERS: add entries for misc. RISC-V SoC drivers and devicetrees
        MAINTAINERS: git://github.com -> https://github.com for HiSilicon
        soc: imx8m: Enable OCOTP clock before reading the register
        arm64: dts: imx93-pinfunc: drop execution permission
        arm64: dts: imx8mn: Fix NAND controller size-cells
        arm64: dts: imx8mm: Fix NAND controller size-cells
        ARM: dts: imx7: Fix NAND controller size-cells
        arm64: dts: imx8mm-tqma8mqml-mba8mx: Fix USB DR
        ARM: at91: pm: avoid soft resetting AC DLL
        ARM: dts: lan966x: Enable sgpio on pcb8291
        arm64: dts: qcom: sm8250: Disable the not yet supported cluster idle state
        ARM: dts: at91: sama7g5: fix signal name of pin PB2
        arm64: dts: qcom: sc7280: Add the reset reg for lpass audiocc on SC7280
        arm64: dts: qcom: sc8280xp: fix UFS PHY serdes size
        arm64: dts: qcom: sc8280xp: drop broken DP PHY nodes
        arm64: dts: qcom: sc8280xp: fix USB PHY PCS registers
        arm64: dts: qcom: sc8280xp: fix USB1 PHY RX1 registers
        ...
      84368d88
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-6.1-rc6' of https://github.com/ceph/ceph-client · ae753340
      Linus Torvalds authored
      Pull ceph fixes from Ilya Dryomov:
       "Three filesystem bug fixes, intended for stable"
      
      * tag 'ceph-for-6.1-rc6' of https://github.com/ceph/ceph-client:
        ceph: fix NULL pointer dereference for req->r_session
        ceph: avoid putting the realm twice when decoding snaps fails
        ceph: fix a NULL vs IS_ERR() check when calling ceph_lookup_inode()
        MAINTAINERS: git://github.com -> https://github.com for ceph
      ae753340
    • Linus Torvalds's avatar
      Merge tag 'nfsd-6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux · 81ac2565
      Linus Torvalds authored
      Pull nfsd fix from Chuck Lever:
      
       - Fix another tracepoint crash
      
      * tag 'nfsd-6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
        NFSD: Fix trace_nfsd_fh_verify_err() crasher
      81ac2565
    • Linus Torvalds's avatar
      Merge tag 'net-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 847ccab8
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from bpf.
      
        Current release - regressions:
      
         - tls: fix memory leak in tls_enc_skb() and tls_sw_fallback_init()
      
        Previous releases - regressions:
      
         - bridge: fix memory leaks when changing VLAN protocol
      
         - dsa: make dsa_master_ioctl() see through port_hwtstamp_get() shims
      
         - dsa: don't leak tagger-owned storage on switch driver unbind
      
         - eth: mlxsw: avoid warnings when not offloaded FDB entry with IPv6
           is removed
      
         - eth: stmmac: ensure tx function is not running in
           stmmac_xdp_release()
      
         - eth: hns3: fix return value check bug of rx copybreak
      
        Previous releases - always broken:
      
         - kcm: close race conditions on sk_receive_queue
      
         - bpf: fix alignment problem in bpf_prog_test_run_skb()
      
         - bpf: fix writing offset in case of fault in
           strncpy_from_kernel_nofault
      
         - eth: macvlan: use built-in RCU list checking
      
         - eth: marvell: add sleep time after enabling the loopback bit
      
         - eth: octeon_ep: fix potential memory leak in octep_device_setup()
      
        Misc:
      
         - tcp: configurable source port perturb table size
      
         - bpf: Convert BPF_DISPATCHER to use static_call() (not ftrace)"
      
      * tag 'net-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (51 commits)
        net: use struct_group to copy ip/ipv6 header addresses
        net: usb: smsc95xx: fix external PHY reset
        net: usb: qmi_wwan: add Telit 0x103a composition
        netdevsim: Fix memory leak of nsim_dev->fa_cookie
        tcp: configurable source port perturb table size
        l2tp: Serialize access to sk_user_data with sk_callback_lock
        net: thunderbolt: Fix error handling in tbnet_init()
        net: microchip: sparx5: Fix potential null-ptr-deref in sparx_stats_init() and sparx5_start()
        net: lan966x: Fix potential null-ptr-deref in lan966x_stats_init()
        net: dsa: don't leak tagger-owned storage on switch driver unbind
        net/x25: Fix skb leak in x25_lapb_receive_frame()
        net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open()
        bridge: switchdev: Fix memory leaks when changing VLAN protocol
        net: hns3: fix setting incorrect phy link ksettings for firmware in resetting process
        net: hns3: fix return value check bug of rx copybreak
        net: hns3: fix incorrect hw rss hash type of rx packet
        net: phy: marvell: add sleep time after enabling the loopback bit
        net: ena: Fix error handling in ena_init()
        kcm: close race conditions on sk_receive_queue
        net: ionic: Fix error handling in ionic_init_module()
        ...
      847ccab8
  3. Nov 17, 2022
    • Hangbin Liu's avatar
      net: use struct_group to copy ip/ipv6 header addresses · 58e0be1e
      Hangbin Liu authored
      
      
      kernel test robot reported warnings when build bonding module with
      make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/bonding/:
      
                       from ../drivers/net/bonding/bond_main.c:35:
      In function ‘fortify_memcpy_chk’,
          inlined from ‘iph_to_flow_copy_v4addrs’ at ../include/net/ip.h:566:2,
          inlined from ‘bond_flow_ip’ at ../drivers/net/bonding/bond_main.c:3984:3:
      ../include/linux/fortify-string.h:413:25: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of f
      ield (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
        413 |                         __read_overflow2_field(q_size_field, size);
            |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘fortify_memcpy_chk’,
          inlined from ‘iph_to_flow_copy_v6addrs’ at ../include/net/ipv6.h:900:2,
          inlined from ‘bond_flow_ip’ at ../drivers/net/bonding/bond_main.c:3994:3:
      ../include/linux/fortify-string.h:413:25: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of f
      ield (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
        413 |                         __read_overflow2_field(q_size_field, size);
            |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      This is because we try to copy the whole ip/ip6 address to the flow_key,
      while we only point the to ip/ip6 saddr. Note that since these are UAPI
      headers, __struct_group() is used to avoid the compiler warnings.
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Fixes: c3f83241
      
       ("net: Add full IPv6 addresses to flow_keys")
      Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Link: https://lore.kernel.org/r/20221115142400.1204786-1-liuhangbin@gmail.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      58e0be1e
    • Alexandru Tachici's avatar
      net: usb: smsc95xx: fix external PHY reset · 809ff97a
      Alexandru Tachici authored
      An external PHY needs settling time after power up or reset.
      In the bind() function an mdio bus is registered. If at this point
      the external PHY is still initialising, no valid PHY ID will be
      read and on phy_find_first() the bind() function will fail.
      
      If an external PHY is present, wait the maximum time specified
      in 802.3 45.2.7.1.1.
      
      Fixes: 05b35e7e
      
       ("smsc95xx: add phylib support")
      Signed-off-by: default avatarAlexandru Tachici <alexandru.tachici@analog.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Link: https://lore.kernel.org/r/20221115114434.9991-2-alexandru.tachici@analog.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      809ff97a
    • Enrico Sau's avatar
      net: usb: qmi_wwan: add Telit 0x103a composition · e103ba33
      Enrico Sau authored
      
      
      Add the following Telit LE910C4-WWX composition:
      
      0x103a: rmnet
      
      Signed-off-by: default avatarEnrico Sau <enrico.sau@gmail.com>
      Acked-by: default avatarBjørn Mork <bjorn@mork.no>
      Link: https://lore.kernel.org/r/20221115105859.14324-1-enrico.sau@gmail.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      e103ba33
    • Arnd Bergmann's avatar
      Merge tag 'imx-fixes-6.1-2' of... · 0d6a10dc
      Arnd Bergmann authored
      
      Merge tag 'imx-fixes-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes
      
      i.MX fixes for 6.1, 2nd round:
      
      - Switch to usb-role-switch for fixing USB device mode on
        tqma8mqml-mba8mx board, so that Dual Role is fully functional.
      - A series from Marek Vasut to fix dt-schema warning caused by NAND
        controller size-cells.
      - Fix file permission of imx93-pinfunc header.
      - Enable OCOTP clock in soc-imx8m driver to fix a kexec kernel hang
        issue.
      
      * tag 'imx-fixes-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
        soc: imx8m: Enable OCOTP clock before reading the register
        arm64: dts: imx93-pinfunc: drop execution permission
        arm64: dts: imx8mn: Fix NAND controller size-cells
        arm64: dts: imx8mm: Fix NAND controller size-cells
        ARM: dts: imx7: Fix NAND controller size-cells
        arm64: dts: imx8mm-tqma8mqml-mba8mx: Fix USB DR
      
      Link: https://lore.kernel.org/r/20221116090402.GA1274@T480
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      0d6a10dc
    • Arnd Bergmann's avatar
      Merge tag 'hisi-maintainer-fix' of https://github.com/hisilicon/linux-hisi into arm/fixes · f9084ecb
      Arnd Bergmann authored
      
      
      MAINTAINERS file updates for HiSilicon sections
      
      - Use https instead of git for the git trees listed
      
      * tag 'hisi-maintainer-fix' of https://github.com/hisilicon/linux-hisi:
        MAINTAINERS: git://github.com -> https://github.com for HiSilicon
      
      Link: https://lore.kernel.org/r/63744BAB.5020307@hisilicon.com
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      f9084ecb
    • Wang Yufen's avatar
      netdevsim: Fix memory leak of nsim_dev->fa_cookie · 064bc731
      Wang Yufen authored
      kmemleak reports this issue:
      
      unreferenced object 0xffff8881bac872d0 (size 8):
        comm "sh", pid 58603, jiffies 4481524462 (age 68.065s)
        hex dump (first 8 bytes):
          04 00 00 00 de ad be ef                          ........
        backtrace:
          [<00000000c80b8577>] __kmalloc+0x49/0x150
          [<000000005292b8c6>] nsim_dev_trap_fa_cookie_write+0xc1/0x210 [netdevsim]
          [<0000000093d78e77>] full_proxy_write+0xf3/0x180
          [<000000005a662c16>] vfs_write+0x1c5/0xaf0
          [<000000007aabf84a>] ksys_write+0xed/0x1c0
          [<000000005f1d2e47>] do_syscall_64+0x3b/0x90
          [<000000006001c6ec>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      The issue occurs in the following scenarios:
      
      nsim_dev_trap_fa_cookie_write()
        kmalloc() fa_cookie
        nsim_dev->fa_cookie = fa_cookie
      ..
      nsim_drv_remove()
      
      The fa_cookie allocked in nsim_dev_trap_fa_cookie_write() is not freed. To
      fix, add kfree(nsim_dev->fa_cookie) to nsim_drv_remove().
      
      Fixes: d3cbb907
      
       ("netdevsim: add ACL trap reporting cookie as a metadata")
      Signed-off-by: default avatarWang Yufen <wangyufen@huawei.com>
      Cc: Jiri Pirko <jiri@mellanox.com>
      Link: https://lore.kernel.org/r/1668504625-14698-1-git-send-email-wangyufen@huawei.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      064bc731
    • Linus Torvalds's avatar
      Merge tag 'for-linus-6.1-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · cc675d22
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
       "Two trivial cleanups, and three simple fixes"
      
      * tag 'for-linus-6.1-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/platform-pci: use define instead of literal number
        xen/platform-pci: add missing free_irq() in error path
        xen-pciback: Allow setting PCI_MSIX_FLAGS_MASKALL too
        xen/pcpu: fix possible memory leak in register_pcpu()
        x86/xen: Use kstrtobool() instead of strtobool()
      cc675d22
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 31c9c4c5
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "Aere is a hopefully final round of pin control fixes. Nothing special,
        driver fixes and we caught a potential NULL pointer exception.
      
         - Fix a potential NULL dereference in the core!
      
         - Fix all pin mux routes in the Rockchop PX30 driver
      
         - Fix the UFS pins in the Qualcomm SC8280XP driver
      
         - Fix bias disabling in the Mediatek driver
      
         - Fix debounce time settings in the Mediatek driver"
      
      * tag 'pinctrl-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: mediatek: Export debounce time tables
        pinctrl: mediatek: Fix EINT pins input debounce time configuration
        pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map
        pinctrl: mediatek: common-v2: Fix bias-disable for PULL_PU_PD_RSEL_TYPE
        pinctrl: qcom: sc8280xp: Rectify UFS reset pins
        pinctrl: rockchip: list all pins in a possible mux route for PX30
      31c9c4c5
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v6.1-4' of... · 941209ef
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform driver fixes from Hans de Goede:
      
       - Surface Pro 9 and Surface Laptop 5 kbd, battery, etc support (this
         is just a few hw-id additions)
      
       - A couple of other hw-id / DMI-quirk additions
      
       - A few small bug fixes + 1 build fix
      
      * tag 'platform-drivers-x86-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        platform/x86: ideapad-laptop: Add module parameters to match DMI quirk tables
        platform/x86: ideapad-laptop: Fix interrupt storm on fn-lock toggle on some Yoga laptops
        platform/x86: hp-wmi: Ignore Smart Experience App event
        platform/surface: aggregator_registry: Add support for Surface Laptop 5
        platform/surface: aggregator_registry: Add support for Surface Pro 9
        platform/surface: aggregator: Do not check for repeated unsequenced packets
        platform/x86: acer-wmi: Enable SW_TABLET_MODE on Switch V 10 (SW5-017)
        platform/x86: asus-wmi: add missing pci_dev_put() in asus_wmi_set_xusb2pr()
        platform/x86/intel: pmc: Don't unconditionally attach Intel PMC when virtualized
        platform/x86: thinkpad_acpi: Enable s2idle quirk for 21A1 machine type
        platform/x86/amd: pmc: Add new ACPI ID AMDI0009
        platform/x86/amd: pmc: Remove more CONFIG_DEBUG_FS checks
      941209ef
    • Xiongfeng Wang's avatar
      mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put() · 222cfa01
      Xiongfeng Wang authored
      pci_get_device() will increase the reference count for the returned
      pci_dev. We need to use pci_dev_put() to decrease the reference count
      before amd_probe() returns. There is no problem for the 'smbus_dev ==
      NULL' branch because pci_dev_put() can also handle the NULL input
      parameter case.
      
      Fixes: 659c9bc1
      
       ("mmc: sdhci-pci: Build o2micro support in the same module")
      Signed-off-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20221114083100.149200-1-wangxiongfeng2@huawei.com
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      222cfa01
  4. Nov 16, 2022
    • Gleb Mazovetskiy's avatar
      tcp: configurable source port perturb table size · aeac4ec8
      Gleb Mazovetskiy authored
      On embedded systems with little memory and no relevant
      security concerns, it is beneficial to reduce the size
      of the table.
      
      Reducing the size from 2^16 to 2^8 saves 255 KiB
      of kernel RAM.
      
      Makes the table size configurable as an expert option.
      
      The size was previously increased from 2^8 to 2^16
      in commit 4c2c8f03
      
       ("tcp: increase source port perturb table to
      2^16").
      
      Signed-off-by: default avatarGleb Mazovetskiy <glex.spb@gmail.com>
      Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aeac4ec8
    • Chevron Li's avatar
      mmc: sdhci-pci-o2micro: fix card detect fail issue caused by CD# debounce timeout · 096cc0cd
      Chevron Li authored
      
      
      The SD card is recognized failed sometimes when resume from suspend.
      Because CD# debounce time too long then card present report wrong.
      Finally, card is recognized failed.
      
      Signed-off-by: default avatarChevron Li <chevron.li@bayhubtech.com>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20221104095512.4068-1-chevron.li@bayhubtech.com
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      096cc0cd
    • Yann Gautier's avatar
      mmc: core: properly select voltage range without power cycle · 39a72dbf
      Yann Gautier authored
      In mmc_select_voltage(), if there is no full power cycle, the voltage
      range selected at the end of the function will be on a single range
      (e.g. 3.3V/3.4V). To keep a range around the selected voltage (3.2V/3.4V),
      the mask shift should be reduced by 1.
      
      This issue was triggered by using a specific SD-card (Verbatim Premium
      16GB UHS-1) on an STM32MP157C-DK2 board. This board cannot do UHS modes
      and there is no power cycle. And the card was failing to switch to
      high-speed mode. When adding the range 3.2V/3.3V for this card with the
      proposed shift change, the card can switch to high-speed mode.
      
      Fixes: ce69d37b
      
       ("mmc: core: Prevent violation of specs while initializing cards")
      Signed-off-by: default avatarYann Gautier <yann.gautier@foss.st.com>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20221028073740.7259-1-yann.gautier@foss.st.com
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      39a72dbf
    • Jakub Sitnicki's avatar
      l2tp: Serialize access to sk_user_data with sk_callback_lock · b68777d5
      Jakub Sitnicki authored
      sk->sk_user_data has multiple users, which are not compatible with each
      other. Writers must synchronize by grabbing the sk->sk_callback_lock.
      
      l2tp currently fails to grab the lock when modifying the underlying tunnel
      socket fields. Fix it by adding appropriate locking.
      
      We err on the side of safety and grab the sk_callback_lock also inside the
      sk_destruct callback overridden by l2tp, even though there should be no
      refs allowing access to the sock at the time when sk_destruct gets called.
      
      v4:
      - serialize write to sk_user_data in l2tp sk_destruct
      
      v3:
      - switch from sock lock to sk_callback_lock
      - document write-protection for sk_user_data
      
      v2:
      - update Fixes to point to origin of the bug
      - use real names in Reported/Tested-by tags
      
      Cc: Tom Parkin <tparkin@katalix.com>
      Fixes: 3557baab
      
       ("[L2TP]: PPP over L2TP driver core")
      Reported-by: default avatarHaowei Yan <g1042620637@gmail.com>
      Signed-off-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b68777d5
    • Yuan Can's avatar
      net: thunderbolt: Fix error handling in tbnet_init() · f524b728
      Yuan Can authored
      A problem about insmod thunderbolt-net failed is triggered with following
      log given while lsmod does not show thunderbolt_net:
      
       insmod: ERROR: could not insert module thunderbolt-net.ko: File exists
      
      The reason is that tbnet_init() returns tb_register_service_driver()
      directly without checking its return value, if tb_register_service_driver()
      failed, it returns without removing property directory, resulting the
      property directory can never be created later.
      
       tbnet_init()
         tb_register_property_dir() # register property directory
         tb_register_service_driver()
           driver_register()
             bus_add_driver()
               priv = kzalloc(...) # OOM happened
         # return without remove property directory
      
      Fix by remove property directory when tb_register_service_driver() returns
      error.
      
      Fixes: e69b6c02
      
       ("net: Add support for networking over Thunderbolt cable")
      Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
      Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f524b728
    • David S. Miller's avatar
      Merge branch 'microchip-fixes' · e4aa85cf
      David S. Miller authored
      
      
      Shang XiaoJing says:
      
      ====================
      net: microchip: Fix potential null-ptr-deref due to create_singlethread_workqueue()
      
      There are some functions call create_singlethread_workqueue() without
      checking ret value, and the NULL workqueue_struct pointer may causes
      null-ptr-deref. Will be fixed by this patch.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e4aa85cf
    • Shang XiaoJing's avatar
      net: microchip: sparx5: Fix potential null-ptr-deref in sparx_stats_init() and sparx5_start() · 639f5d00
      Shang XiaoJing authored
      sparx_stats_init() calls create_singlethread_workqueue() and not
      checked the ret value, which may return NULL. And a null-ptr-deref may
      happen:
      
      sparx_stats_init()
          create_singlethread_workqueue() # failed, sparx5->stats_queue is NULL
          queue_delayed_work()
              queue_delayed_work_on()
                  __queue_delayed_work()  # warning here, but continue
                      __queue_work()      # access wq->flags, null-ptr-deref
      
      Check the ret value and return -ENOMEM if it is NULL. So as
      sparx5_start().
      
      Fixes: af4b1102 ("net: sparx5: add ethtool configuration and statistics support")
      Fixes: b37a1bae
      
       ("net: sparx5: add mactable support")
      Signed-off-by: default avatarShang XiaoJing <shangxiaojing@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      639f5d00
    • Shang XiaoJing's avatar
      net: lan966x: Fix potential null-ptr-deref in lan966x_stats_init() · ba86af37
      Shang XiaoJing authored
      lan966x_stats_init() calls create_singlethread_workqueue() and not
      checked the ret value, which may return NULL. And a null-ptr-deref may
      happen:
      
      lan966x_stats_init()
          create_singlethread_workqueue() # failed, lan966x->stats_queue is NULL
          queue_delayed_work()
              queue_delayed_work_on()
                  __queue_delayed_work()  # warning here, but continue
                      __queue_work()      # access wq->flags, null-ptr-deref
      
      Check the ret value and return -ENOMEM if it is NULL.
      
      Fixes: 12c2d0a5
      
       ("net: lan966x: add ethtool configuration and statistics")
      Signed-off-by: default avatarShang XiaoJing <shangxiaojing@huawei.com>
      Reviewed-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ba86af37
    • Hans de Goede's avatar
      platform/x86: ideapad-laptop: Add module parameters to match DMI quirk tables · b44fd994
      Hans de Goede authored
      
      
      Add module parameters to allow setting the hw_rfkill_switch and
      set_fn_lock_led feature flags for testing these on laptops which are not
      on the DMI-id based allow lists for these 2 flags.
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20221115193400.376159-1-hdegoede@redhat.com
      b44fd994
    • Arnav Rawat's avatar
      platform/x86: ideapad-laptop: Fix interrupt storm on fn-lock toggle on some Yoga laptops · 81a5603a
      Arnav Rawat authored
      Commit 3ae86d2d
      
       ("platform/x86: ideapad-laptop: Fix Legion 5 Fn lock
      LED") uses the WMI event-id for the fn-lock event on some Legion 5 laptops
      to manually toggle the fn-lock LED because the EC does not do it itself.
      However, the same WMI ID is also sent on some Yoga laptops. Here, setting
      the fn-lock state is not valid behavior, and causes the EC to spam
      interrupts until the laptop is rebooted.
      
      Add a set_fn_lock_led_list[] DMI-id list and only enable the workaround to
      manually set the LED on models on this list.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=212671
      Cc: Meng Dong <whenov@gmail.com>
      Signed-off-by: default avatarArnav Rawat <arnavr3@illinois.edu>
      Link: https://lore.kernel.org/r/12093851.O9o76ZdvQC@fedora
      [hdegoede@redhat.com: Check DMI-id list only once and store the result]
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      81a5603a
    • Kai-Heng Feng's avatar
      platform/x86: hp-wmi: Ignore Smart Experience App event · 8b9b6a04
      Kai-Heng Feng authored
      
      
      Sometimes hp-wmi driver complains on system resume:
      [ 483.116451] hp_wmi: Unknown event_id - 33 - 0x0
      
      According to HP it's a feature called "HP Smart Experience App" and it's
      safe to be ignored.
      
      Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Link: https://lore.kernel.org/r/20221114073842.205392-1-kai.heng.feng@canonical.com
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      8b9b6a04
    • Maximilian Luz's avatar
      platform/surface: aggregator_registry: Add support for Surface Laptop 5 · 4a567d16
      Maximilian Luz authored
      
      
      Add device nodes to enable support for battery and charger status, the
      ACPI platform profile, as well as internal HID devices (including
      touchpad and keyboard) on the Surface Laptop 5.
      
      Signed-off-by: default avatarMaximilian Luz <luzmaximilian@gmail.com>
      Link: https://lore.kernel.org/r/20221115231440.1338142-1-luzmaximilian@gmail.com
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      4a567d16
    • Vladimir Oltean's avatar
      net: dsa: don't leak tagger-owned storage on switch driver unbind · 4e0c19fc
      Vladimir Oltean authored
      In the initial commit dc452a47 ("net: dsa: introduce tagger-owned
      storage for private and shared data"), we had a call to
      tag_ops->disconnect(dst) issued from dsa_tree_free(), which is called at
      tree teardown time.
      
      There were problems with connecting to a switch tree as a whole, so this
      got reworked to connecting to individual switches within the tree. In
      this process, tag_ops->disconnect(ds) was made to be called only from
      switch.c (cross-chip notifiers emitted as a result of dynamic tag proto
      changes), but the normal driver teardown code path wasn't replaced with
      anything.
      
      Solve this problem by adding a function that does the opposite of
      dsa_switch_setup_tag_protocol(), which is called from the equivalent
      spot in dsa_switch_teardown(). The positioning here also ensures that we
      won't have any use-after-free in tagging protocol (*rcv) ops, since the
      teardown sequence is as follows:
      
      dsa_tree_teardown
      -> dsa_tree_teardown_master
         -> dsa_master_teardown
            -> unsets master->dsa_ptr, making no further packets match the
               ETH_P_XDSA packet type handler
      -> dsa_tree_teardown_ports
         -> dsa_port_teardown
            -> dsa_slave_destroy
               -> unregisters DSA net devices, there is even a synchronize_net()
                  in unregister_netdevice_many()
      -> dsa_tree_teardown_switches
         -> dsa_switch_teardown
            -> dsa_switch_teardown_tag_protocol
               -> finally frees the tagger-owned storage
      
      Fixes: 7f297314
      
       ("net: dsa: make tagging protocols connect to individual switches from a tree")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarSaeed Mahameed <saeed@kernel.org>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20221114143551.1906361-1-vladimir.oltean@nxp.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4e0c19fc
    • Wei Yongjun's avatar
      net/x25: Fix skb leak in x25_lapb_receive_frame() · 2929cceb
      Wei Yongjun authored
      x25_lapb_receive_frame() using skb_copy() to get a private copy of
      skb, the new skb should be freed in the undersized/fragmented skb
      error handling path. Otherwise there is a memory leak.
      
      Fixes: cb101ed2
      
       ("x25: Handle undersized/fragmented skbs")
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Acked-by: default avatarMartin Schiller <ms@dev.tdt.de>
      Link: https://lore.kernel.org/r/20221114110519.514538-1-weiyongjun@huaweicloud.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2929cceb
    • Liu Jian's avatar
      net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open() · c9b895c6
      Liu Jian authored
      If ag71xx_hw_enable() fails, call phylink_disconnect_phy() to clean up.
      And if phylink_of_phy_connect() fails, nothing needs to be done.
      Compile tested only.
      
      Fixes: 892e0915
      
       ("net: ag71xx: port to phylink")
      Signed-off-by: default avatarLiu Jian <liujian56@huawei.com>
      Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Link: https://lore.kernel.org/r/20221114095549.40342-1-liujian56@huawei.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c9b895c6
    • Linus Torvalds's avatar
      AMerge tag 'netfs-fixes-20221115' of... · 59d0d52c
      Linus Torvalds authored
      AMerge tag 'netfs-fixes-20221115' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
      
      Pull netfx fixes from David Howells:
       "Two fixes, affecting the functions that iterates over the pagecache
        unmarking or unlocking pages after an op is complete:
      
         - xas_for_each() loops must call xas_retry() first thing and
           immediately do a "continue" in the case that the extracted value is
           a special value that indicates that the walk raced with a
           modification. Fix the unlock and unmark loops to do this.
      
         - The maths in the unlock loop is dodgy as it could, theoretically,
           at some point in the future end up with a starting file pointer
           that is in the middle of a folio. This will cause a subtraction to
           go negative - but the number is unsigned. Fix the maths to use
           absolute file positions instead of relative page indices"
      
      * tag 'netfs-fixes-20221115' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
        netfs: Fix dodgy maths
        netfs: Fix missing xas_retry() calls in xarray iteration
      59d0d52c
    • Linus Torvalds's avatar
      Merge tag 'erofs-for-6.1-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs · 81e7cfa3
      Linus Torvalds authored
      Pull erofs fixes from Gao Xiang:
       "Most patches randomly fix error paths or corner cases in fscache mode
        reported recently. One fixes an invalid access relating to fragments
        on crafted images.
      
        Summary:
      
         - Fix packed_inode invalid access when reading fragments on crafted
           images
      
         - Add a missing erofs_put_metabuf() in an error path in fscache mode
      
         - Fix incorrect `count' for unmapped extents in fscache mode
      
         - Fix use-after-free of fsid and domain_id string when remounting
      
         - Fix missing xas_retry() in fscache mode"
      
      * tag 'erofs-for-6.1-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
        erofs: fix missing xas_retry() in fscache mode
        erofs: fix use-after-free of fsid and domain_id string
        erofs: get correct count for unmapped range in fscache mode
        erofs: put metabuf in error path in fscache mode
        erofs: fix general protection fault when reading fragment
      81e7cfa3
    • Borislav Petkov's avatar
      x86/cpu: Restore AMD's DE_CFG MSR after resume · 2632daeb
      Borislav Petkov authored
      DE_CFG contains the LFENCE serializing bit, restore it on resume too.
      This is relevant to older families due to the way how they do S3.
      
      Unify and correct naming while at it.
      
      Fixes: e4d0e84e
      
       ("x86/cpu/AMD: Make LFENCE a serializing instruction")
      Reported-by: default avatarAndrew Cooper <Andrew.Cooper3@citrix.com>
      Reported-by: default avatarPawan Gupta <pawan.kumar.gupta@linux.intel.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2632daeb
    • Takashi Iwai's avatar
      ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360 · 1abfd71e
      Takashi Iwai authored
      
      
      Samsung Galaxy Book Pro 360 (13" 2021 NP930QBD-ke1US) with codec SSID
      144d:c1a6 requires the same workaround for enabling the speaker amp
      like other Samsung models with ALC298 codec.
      
      Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1205100
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20221115170235.18875-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      1abfd71e
    • Emil Flink's avatar
      ALSA: hda/realtek: fix speakers for Samsung Galaxy Book Pro · b18a4563
      Emil Flink authored
      
      
      The Samsung Galaxy Book Pro seems to have the same issue as a few
      other Samsung laptops, detailed in kernel bug report 207423. Sound from
      headphone jack works, but not the built-in speakers.
      
      alsa-info: http://alsa-project.org/db/?f=b40ba609dc6ae28dc84ad404a0d8a4bbcd8bea6d
      
      Signed-off-by: default avatarEmil Flink <emil.flink@gmail.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20221115144500.7782-1-emil.flink@gmail.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      b18a4563
    • David Howells's avatar
      netfs: Fix dodgy maths · 5e51c627
      David Howells authored
      Fix the dodgy maths in netfs_rreq_unlock_folios().  start_page could be
      inside the folio, in which case the calculation of pgpos will be come up
      with a negative number (though for the moment rreq->start is rounded down
      earlier and folios would have to get merged whilst locked)
      
      Alter how this works to just frame the tracking in terms of absolute file
      positions, rather than offsets from the start of the I/O request.  This
      simplifies the maths and makes it easier to follow.
      
      Fix the issue by using folio_pos() and folio_size() to calculate the end
      position of the page.
      
      Fixes: 3d3c9504
      
       ("netfs: Provide readahead and readpage netfs helpers")
      Reported-by: default avatarMatthew Wilcox <willy@infradead.org>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
      Reviewed-by: default avatarJingbo Xu <jefflexu@linux.alibaba.com>
      cc: linux-cachefs@redhat.com
      cc: linux-fsdevel@vger.kernel.org
      Link: https://lore.kernel.org/r/Y2SJw7w1IsIik3nb@casper.infradead.org/
      Link: https://lore.kernel.org/r/166757988611.950645.7626959069846893164.stgit@warthog.procyon.org.uk/ # v2
      5e51c627
    • David Howells's avatar
      netfs: Fix missing xas_retry() calls in xarray iteration · 7e043a80
      David Howells authored
      netfslib has a number of places in which it performs iteration of an xarray
      whilst being under the RCU read lock.  It *should* call xas_retry() as the
      first thing inside of the loop and do "continue" if it returns true in case
      the xarray walker passed out a special value indicating that the walk needs
      to be redone from the root[*].
      
      Fix this by adding the missing retry checks.
      
      [*] I wonder if this should be done inside xas_find(), xas_next_node() and
          suchlike, but I'm told that's not an simple change to effect.
      
      This can cause an oops like that below.  Note the faulting address - this
      is an internal value (|0x2) returned from xarray.
      
      BUG: kernel NULL pointer dereference, address: 0000000000000402
      ...
      RIP: 0010:netfs_rreq_unlock+0xef/0x380 [netfs]
      ...
      Call Trace:
       netfs_rreq_assess+0xa6/0x240 [netfs]
       netfs_readpage+0x173/0x3b0 [netfs]
       ? init_wait_var_entry+0x50/0x50
       filemap_read_page+0x33/0xf0
       filemap_get_pages+0x2f2/0x3f0
       filemap_read+0xaa/0x320
       ? do_filp_open+0xb2/0x150
       ? rmqueue+0x3be/0xe10
       ceph_read_iter+0x1fe/0x680 [ceph]
       ? new_sync_read+0x115/0x1a0
       new_sync_read+0x115/0x1a0
       vfs_read+0xf3/0x180
       ksys_read+0x5f/0xe0
       do_syscall_64+0x38/0x90
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Changes:
      ========
      ver #2)
       - Changed an unsigned int to a size_t to reduce the likelihood of an
         overflow as per Willy's suggestion.
       - Added an additional patch to fix the maths.
      
      Fixes: 3d3c9504
      
       ("netfs: Provide readahead and readpage netfs helpers")
      Reported-by: default avatarGeorge Law <glaw@redhat.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
      Reviewed-by: default avatarJingbo Xu <jefflexu@linux.alibaba.com>
      cc: Matthew Wilcox <willy@infradead.org>
      cc: linux-cachefs@redhat.com
      cc: linux-fsdevel@vger.kernel.org
      Link: https://lore.kernel.org/r/166749229733.107206.17482609105741691452.stgit@warthog.procyon.org.uk/ # v1
      Link: https://lore.kernel.org/r/166757987929.950645.12595273010425381286.stgit@warthog.procyon.org.uk/ # v2
      7e043a80