Skip to content
  1. Mar 02, 2022
  2. Feb 23, 2022
    • Greg Kroah-Hartman's avatar
    • Jing Leng's avatar
      kconfig: fix failing to generate auto.conf · 3e73b02a
      Jing Leng authored
      [ Upstream commit 1b9e740a
      
       ]
      
      When the KCONFIG_AUTOCONFIG is specified (e.g. export \
      KCONFIG_AUTOCONFIG=output/config/auto.conf), the directory of
      include/config/ will not be created, so kconfig can't create deps
      files in it and auto.conf can't be generated.
      
      Signed-off-by: default avatarJing Leng <jleng@ambarella.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      3e73b02a
    • Marc St-Amand's avatar
      net: macb: Align the dma and coherent dma masks · 90c0d3cc
      Marc St-Amand authored
      [ Upstream commit 37f78606
      
       ]
      
      Single page and coherent memory blocks can use different DMA masks
      when the macb accesses physical memory directly. The kernel is clever
      enough to allocate pages that fit into the requested address width.
      
      When using the ARM SMMU, the DMA mask must be the same for single
      pages and big coherent memory blocks. Otherwise the translation
      tables turn into one big mess.
      
        [   74.959909] macb ff0e0000.ethernet eth0: DMA bus error: HRESP not OK
        [   74.959989] arm-smmu fd800000.smmu: Unhandled context fault: fsr=0x402, iova=0x3165687460, fsynr=0x20001, cbfrsynra=0x877, cb=1
        [   75.173939] macb ff0e0000.ethernet eth0: DMA bus error: HRESP not OK
        [   75.173955] arm-smmu fd800000.smmu: Unhandled context fault: fsr=0x402, iova=0x3165687460, fsynr=0x20001, cbfrsynra=0x877, cb=1
      
      Since using the same DMA mask does not hurt direct 1:1 physical
      memory mappings, this commit always aligns DMA and coherent masks.
      
      Signed-off-by: default avatarMarc St-Amand <mstamand@ciena.com>
      Signed-off-by: default avatarHarini Katakam <harini.katakam@xilinx.com>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Tested-by: default avatarConor Dooley <conor.dooley@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      90c0d3cc
    • Slark Xiao's avatar
      net: usb: qmi_wwan: Add support for Dell DW5829e · f1c3f412
      Slark Xiao authored
      [ Upstream commit 8ecbb179
      
       ]
      
      Dell DW5829e same as DW5821e except the CAT level.
      DW5821e supports CAT16 but DW5829e supports CAT9.
      Also, DW5829e includes normal and eSIM type.
      Please see below test evidence:
      
      T:  Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  5 Spd=5000 MxCh= 0
      D:  Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs=  1
      P:  Vendor=413c ProdID=81e6 Rev=03.18
      S:  Manufacturer=Dell Inc.
      S:  Product=DW5829e Snapdragon X20 LTE
      S:  SerialNumber=0123456789ABCDEF
      C:  #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA
      I:  If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
      I:  If#=0x1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
      I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      
      T:  Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  7 Spd=5000 MxCh= 0
      D:  Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs=  1
      P:  Vendor=413c ProdID=81e4 Rev=03.18
      S:  Manufacturer=Dell Inc.
      S:  Product=DW5829e-eSIM Snapdragon X20 LTE
      S:  SerialNumber=0123456789ABCDEF
      C:  #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA
      I:  If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
      I:  If#=0x1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
      I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      I:  If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      
      Signed-off-by: default avatarSlark Xiao <slark_xiao@163.com>
      Acked-by: default avatarBjørn Mork <bjorn@mork.no>
      Link: https://lore.kernel.org/r/20220209024717.8564-1-slark_xiao@163.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      f1c3f412
    • JaeSang Yoo's avatar
      tracing: Fix tp_printk option related with tp_printk_stop_on_boot · 6b364ca4
      JaeSang Yoo authored
      [ Upstream commit 3203ce39 ]
      
      The kernel parameter "tp_printk_stop_on_boot" starts with "tp_printk" which is
      the same as another kernel parameter "tp_printk". If "tp_printk" setup is
      called before the "tp_printk_stop_on_boot", it will override the latter
      and keep it from being set.
      
      This is similar to other kernel parameter issues, such as:
        Commit 745a600c ("um: console: Ignore console= option")
      or init/do_mounts.c:45 (setup function of "ro" kernel param)
      
      Fix it by checking for a "_" right after the "tp_printk" and if that
      exists do not process the parameter.
      
      Link: https://lkml.kernel.org/r/20220208195421.969326-1-jsyoo5b@gmail.com
      
      
      
      Signed-off-by: default avatarJaeSang Yoo <jsyoo5b@gmail.com>
      [ Fixed up change log and added space after if condition ]
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      6b364ca4
    • Sascha Hauer's avatar
      drm/rockchip: dw_hdmi: Do not leave clock enabled in error case · 8bf73d5e
      Sascha Hauer authored
      [ Upstream commit c0cfbb12
      
       ]
      
      The driver returns an error when devm_phy_optional_get() fails leaving
      the previously enabled clock turned on. Change order and enable the
      clock only after the phy has been acquired.
      
      Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220126145549.617165-3-s.hauer@pengutronix.de
      
      
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      8bf73d5e
    • Zoltán Böszörményi's avatar
      ata: libata-core: Disable TRIM on M88V29 · 5a21d507
      Zoltán Böszörményi authored
      [ Upstream commit c8ea23d5
      
       ]
      
      This device is a CF card, or possibly an SSD in CF form factor.
      It supports NCQ and high speed DMA.
      
      While it also advertises TRIM support, I/O errors are reported
      when the discard mount option fstrim is used. TRIM also fails
      when disabling NCQ and not just as an NCQ command.
      
      TRIM must be disabled for this device.
      
      Signed-off-by: default avatarZoltán Böszörményi <zboszor@gmail.com>
      Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      5a21d507
    • Brenda Streiff's avatar
      kconfig: let 'shell' return enough output for deep path names · 41da9115
      Brenda Streiff authored
      [ Upstream commit 8a4c5b2a ]
      
      The 'shell' built-in only returns the first 256 bytes of the command's
      output. In some cases, 'shell' is used to return a path; by bumping up
      the buffer size to 4096 this lets us capture up to PATH_MAX.
      
      The specific case where I ran into this was due to commit 1e860048
      
      
      ("gcc-plugins: simplify GCC plugin-dev capability test"). After this
      change, we now use `$(shell,$(CC) -print-file-name=plugin)` to return
      a path; if the gcc path is particularly long, then the path ends up
      truncated at the 256 byte mark, which makes the HAVE_GCC_PLUGINS
      depends test always fail.
      
      Signed-off-by: default avatarBrenda Streiff <brenda.streiff@ni.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      41da9115
    • Christian Hewitt's avatar
      arm64: dts: meson-g12: drop BL32 region from SEI510/SEI610 · 913932a3
      Christian Hewitt authored
      [ Upstream commit f26573e2
      
       ]
      
      The BL32/TEE reserved-memory region is now inherited from the common
      family dtsi (meson-g12-common) so we can drop it from board files.
      
      Signed-off-by: default avatarChristian Hewitt <christianshewitt@gmail.com>
      Reviewed-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
      Reviewed-by: default avatarKevin Hilman <khilman@baylibre.com>
      Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
      Link: https://lore.kernel.org/r/20220126044954.19069-4-christianshewitt@gmail.com
      
      
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      913932a3
    • Christian Hewitt's avatar
      arm64: dts: meson-g12: add ATF BL32 reserved-memory region · d2fd1c78
      Christian Hewitt authored
      [ Upstream commit 08982a1b
      
       ]
      
      Add an additional reserved memory region for the BL32 trusted firmware
      present in many devices that boot from Amlogic vendor u-boot.
      
      Signed-off-by: default avatarChristian Hewitt <christianshewitt@gmail.com>
      Reviewed-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
      Reviewed-by: default avatarKevin Hilman <khilman@baylibre.com>
      Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
      Link: https://lore.kernel.org/r/20220126044954.19069-3-christianshewitt@gmail.com
      
      
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      d2fd1c78
    • Christian Hewitt's avatar
      arm64: dts: meson-gx: add ATF BL32 reserved-memory region · daa86808
      Christian Hewitt authored
      [ Upstream commit 76577c91
      
       ]
      
      Add an additional reserved memory region for the BL32 trusted firmware
      present in many devices that boot from Amlogic vendor u-boot.
      
      Suggested-by: default avatarMateusz Krzak <kszaquitto@gmail.com>
      Signed-off-by: default avatarChristian Hewitt <christianshewitt@gmail.com>
      Reviewed-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
      Reviewed-by: default avatarKevin Hilman <khilman@baylibre.com>
      Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
      Link: https://lore.kernel.org/r/20220126044954.19069-2-christianshewitt@gmail.com
      
      
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      daa86808
    • Florian Westphal's avatar
      netfilter: conntrack: don't refresh sctp entries in closed state · ba4b4035
      Florian Westphal authored
      [ Upstream commit 77b33719
      
       ]
      
      Vivek Thrivikraman reported:
       An SCTP server application which is accessed continuously by client
       application.
       When the session disconnects the client retries to establish a connection.
       After restart of SCTP server application the session is not established
       because of stale conntrack entry with connection state CLOSED as below.
      
       (removing this entry manually established new connection):
      
       sctp 9 CLOSED src=10.141.189.233 [..]  [ASSURED]
      
      Just skip timeout update of closed entries, we don't want them to
      stay around forever.
      
      Reported-and-tested-by: default avatarVivek Thrivikraman <vivek.thrivikraman@est.tech>
      Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1579
      
      
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      ba4b4035
    • Guo Ren's avatar
      irqchip/sifive-plic: Add missing thead,c900-plic match string · d4de2bbc
      Guo Ren authored
      [ Upstream commit 1d4df649 ]
      
      The thead,c900-plic has been used in opensbi to distinguish
      PLIC [1]. Although PLICs have the same behaviors in Linux,
      they are different hardware with some custom initializing in
      firmware(opensbi).
      
      Qute opensbi patch commit-msg by Samuel:
      
        The T-HEAD PLIC implementation requires setting a delegation bit
        to allow access from S-mode. Now that the T-HEAD PLIC has its own
        compatible string, set this bit automatically from the PLIC driver,
        instead of reaching into the PLIC's MMIO space from another driver.
      
      [1]: https://github.com/riscv-software-src/opensbi/commit/78c2b19218bd62653b9fb31623a42ced45f38ea6
      
      
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Anup Patel <anup@brainfault.org>
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Samuel Holland <samuel@sholland.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarSamuel Holland <samuel@sholland.org>
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      Link: https://lore.kernel.org/r/20220130135634.1213301-3-guoren@kernel.org
      
      
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      d4de2bbc
    • Ye Guojin's avatar
      ARM: OMAP2+: adjust the location of put_device() call in omapdss_init_of · 2d7a327a
      Ye Guojin authored
      [ Upstream commit 34596ba3
      
       ]
      
      This was found by coccicheck:
      ./arch/arm/mach-omap2/display.c, 272, 1-7, ERROR missing put_device;
      call of_find_device_by_node on line 258, but without a corresponding
      object release within this function.
      
      Move the put_device() call before the if judgment.
      
      Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarYe Guojin <ye.guojin@zte.com.cn>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      2d7a327a
    • Wan Jiabing's avatar
      ARM: OMAP2+: hwmod: Add of_node_put() before break · fff21185
      Wan Jiabing authored
      [ Upstream commit 80c469a0
      
       ]
      
      Fix following coccicheck warning:
      ./arch/arm/mach-omap2/omap_hwmod.c:753:1-23: WARNING: Function
      for_each_matching_node should have of_node_put() before break
      
      Early exits from for_each_matching_node should decrement the
      node reference counter.
      
      Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      fff21185
    • Jim Mattson's avatar
      KVM: x86/pmu: Use AMD64_RAW_EVENT_MASK for PERF_TYPE_RAW · 3deabc3f
      Jim Mattson authored
      [ Upstream commit 710c4765 ]
      
      AMD's event select is 3 nybbles, with the high nybble in bits 35:32 of
      a PerfEvtSeln MSR. Don't mask off the high nybble when configuring a
      RAW perf event.
      
      Fixes: ca724305
      
       ("KVM: x86/vPMU: Implement AMD vPMU code for KVM")
      Signed-off-by: default avatarJim Mattson <jmattson@google.com>
      Message-Id: <20220203014813.2130559-2-jmattson@google.com>
      Reviewed-by: default avatarDavid Dunn <daviddunn@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      3deabc3f
    • Miaoqian Lin's avatar
      Drivers: hv: vmbus: Fix memory leak in vmbus_add_channel_kobj · fe595759
      Miaoqian Lin authored
      [ Upstream commit 8bc69f86 ]
      
      kobject_init_and_add() takes reference even when it fails.
      According to the doc of kobject_init_and_add():
      
         If this function returns an error, kobject_put() must be called to
         properly clean up the memory associated with the object.
      
      Fix memory leak by calling kobject_put().
      
      Fixes: c2e5df61
      
       ("vmbus: add per-channel sysfs info")
      Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
      Reviewed-by: default avatarJuan Vazquez <juvazq@linux.microsoft.com>
      Link: https://lore.kernel.org/r/20220203173008.43480-1-linmq006@gmail.com
      
      
      Signed-off-by: default avatarWei Liu <wei.liu@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      fe595759
    • Rafał Miłecki's avatar
      i2c: brcmstb: fix support for DSL and CM variants · ba71b1b3
      Rafał Miłecki authored
      commit 834cea3a upstream.
      
      DSL and CM (Cable Modem) support 8 B max transfer size and have a custom
      DT binding for that reason. This driver was checking for a wrong
      "compatible" however which resulted in an incorrect setup.
      
      Fixes: e2e5a2c6
      
       ("i2c: brcmstb: Adding support for CM and DSL SoCs")
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ba71b1b3
    • Waiman Long's avatar
      copy_process(): Move fd_install() out of sighand->siglock critical section · 6f08452c
      Waiman Long authored
      commit ddc204b5 upstream.
      
      I was made aware of the following lockdep splat:
      
      [ 2516.308763] =====================================================
      [ 2516.309085] WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
      [ 2516.309433] 5.14.0-51.el9.aarch64+debug #1 Not tainted
      [ 2516.309703] -----------------------------------------------------
      [ 2516.310149] stress-ng/153663 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
      [ 2516.310512] ffff0000e422b198 (&newf->file_lock){+.+.}-{2:2}, at: fd_install+0x368/0x4f0
      [ 2516.310944]
                     and this task is already holding:
      [ 2516.311248] ffff0000c08140d8 (&sighand->siglock){-.-.}-{2:2}, at: copy_process+0x1e2c/0x3e80
      [ 2516.311804] which would create a new lock dependency:
      [ 2516.312066]  (&sighand->siglock){-.-.}-{2:2} -> (&newf->file_lock){+.+.}-{2:2}
      [ 2516.312446]
                     but this new dependency connects a HARDIRQ-irq-safe lock:
      [ 2516.312983]  (&sighand->siglock){-.-.}-{2:2}
         :
      [ 2516.330700]  Possible interrupt unsafe locking scenario:
      
      [ 2516.331075]        CPU0                    CPU1
      [ 2516.331328]        ----                    ----
      [ 2516.331580]   lock(&newf->file_lock);
      [ 2516.331790]                                local_irq_disable();
      [ 2516.332231]                                lock(&sighand->siglock);
      [ 2516.332579]                                lock(&newf->file_lock);
      [ 2516.332922]   <Interrupt>
      [ 2516.333069]     lock(&sighand->siglock);
      [ 2516.333291]
                      *** DEADLOCK ***
      [ 2516.389845]
                     stack backtrace:
      [ 2516.390101] CPU: 3 PID: 153663 Comm: stress-ng Kdump: loaded Not tainted 5.14.0-51.el9.aarch64+debug #1
      [ 2516.390756] Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015
      [ 2516.391155] Call trace:
      [ 2516.391302]  dump_backtrace+0x0/0x3e0
      [ 2516.391518]  show_stack+0x24/0x30
      [ 2516.391717]  dump_stack_lvl+0x9c/0xd8
      [ 2516.391938]  dump_stack+0x1c/0x38
      [ 2516.392247]  print_bad_irq_dependency+0x620/0x710
      [ 2516.392525]  check_irq_usage+0x4fc/0x86c
      [ 2516.392756]  check_prev_add+0x180/0x1d90
      [ 2516.392988]  validate_chain+0x8e0/0xee0
      [ 2516.393215]  __lock_acquire+0x97c/0x1e40
      [ 2516.393449]  lock_acquire.part.0+0x240/0x570
      [ 2516.393814]  lock_acquire+0x90/0xb4
      [ 2516.394021]  _raw_spin_lock+0xe8/0x154
      [ 2516.394244]  fd_install+0x368/0x4f0
      [ 2516.394451]  copy_process+0x1f5c/0x3e80
      [ 2516.394678]  kernel_clone+0x134/0x660
      [ 2516.394895]  __do_sys_clone3+0x130/0x1f4
      [ 2516.395128]  __arm64_sys_clone3+0x5c/0x7c
      [ 2516.395478]  invoke_syscall.constprop.0+0x78/0x1f0
      [ 2516.395762]  el0_svc_common.constprop.0+0x22c/0x2c4
      [ 2516.396050]  do_el0_svc+0xb0/0x10c
      [ 2516.396252]  el0_svc+0x24/0x34
      [ 2516.396436]  el0t_64_sync_handler+0xa4/0x12c
      [ 2516.396688]  el0t_64_sync+0x198/0x19c
      [ 2517.491197] NET: Registered PF_ATMPVC protocol family
      [ 2517.491524] NET: Registered PF_ATMSVC protocol family
      [ 2591.991877] sched: RT throttling activated
      
      One way to solve this problem is to move the fd_install() call out of
      the sighand->siglock critical section.
      
      Before commit 6fd2fe49 ("copy_process(): don't use ksys_close()
      on cleanups"), the pidfd installation was done without holding both
      the task_list lock and the sighand->siglock. Obviously, holding these
      two locks are not really needed to protect the fd_install() call.
      So move the fd_install() call down to after the releases of both locks.
      
      Link: https://lore.kernel.org/r/20220208163912.1084752-1-longman@redhat.com
      Fixes: 6fd2fe49
      
       ("copy_process(): don't use ksys_close() on cleanups")
      Reviewed-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarWaiman Long <longman@redhat.com>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6f08452c
    • 蒋家盛's avatar
      dmaengine: sh: rcar-dmac: Check for error num after setting mask · e52dfd2a
      蒋家盛 authored
      commit 2d21543e upstream.
      
      Because of the possible failure of the dma_supported(), the
      dma_set_mask_and_coherent() may return error num.
      Therefore, it should be better to check it and return the error if
      fails.
      
      Fixes: dc312349
      
       ("dmaengine: rcar-dmac: Widen DMA mask to 40 bits")
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Link: https://lore.kernel.org/r/20220106030939.2644320-1-jiasheng@iscas.ac.cn
      
      
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e52dfd2a
    • Eric Dumazet's avatar
      net: sched: limit TC_ACT_REPEAT loops · c83049cb
      Eric Dumazet authored
      commit 5740d068 upstream.
      
      We have been living dangerously, at the mercy of malicious users,
      abusing TC_ACT_REPEAT, as shown by this syzpot report [1].
      
      Add an arbitrary limit (32) to the number of times an action can
      return TC_ACT_REPEAT.
      
      v2: switch the limit to 32 instead of 10.
          Use net_warn_ratelimited() instead of pr_err_once().
      
      [1] (C repro available on demand)
      
      rcu: INFO: rcu_preempt self-detected stall on CPU
      rcu:    1-...!: (10500 ticks this GP) idle=021/1/0x4000000000000000 softirq=5592/5592 fqs=0
              (t=10502 jiffies g=5305 q=190)
      rcu: rcu_preempt kthread timer wakeup didn't happen for 10502 jiffies! g5305 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402
      rcu:    Possible timer handling issue on cpu=0 timer-softirq=3527
      rcu: rcu_preempt kthread starved for 10505 jiffies! g5305 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 ->cpu=0
      rcu:    Unless rcu_preempt kthread gets sufficient CPU time, OOM is now expected behavior.
      rcu: RCU grace-period kthread stack dump:
      task:rcu_preempt     state:I stack:29344 pid:   14 ppid:     2 flags:0x00004000
      Call Trace:
       <TASK>
       context_switch kernel/sched/core.c:4986 [inline]
       __schedule+0xab2/0x4db0 kernel/sched/core.c:6295
       schedule+0xd2/0x260 kernel/sched/core.c:6368
       schedule_timeout+0x14a/0x2a0 kernel/time/timer.c:1881
       rcu_gp_fqs_loop+0x186/0x810 kernel/rcu/tree.c:1963
       rcu_gp_kthread+0x1de/0x320 kernel/rcu/tree.c:2136
       kthread+0x2e9/0x3a0 kernel/kthread.c:377
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
       </TASK>
      rcu: Stack dump where RCU GP kthread last ran:
      Sending NMI from CPU 1 to CPUs 0:
      NMI backtrace for cpu 0
      CPU: 0 PID: 3646 Comm: syz-executor358 Not tainted 5.17.0-rc3-syzkaller-00149-gbf8e59fd315f #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      RIP: 0010:rep_nop arch/x86/include/asm/vdso/processor.h:13 [inline]
      RIP: 0010:cpu_relax arch/x86/include/asm/vdso/processor.h:18 [inline]
      RIP: 0010:pv_wait_head_or_lock kernel/locking/qspinlock_paravirt.h:437 [inline]
      RIP: 0010:__pv_queued_spin_lock_slowpath+0x3b8/0xb40 kernel/locking/qspinlock.c:508
      Code: 48 89 eb c6 45 01 01 41 bc 00 80 00 00 48 c1 e9 03 83 e3 07 41 be 01 00 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8d 2c 01 eb 0c <f3> 90 41 83 ec 01 0f 84 72 04 00 00 41 0f b6 45 00 38 d8 7f 08 84
      RSP: 0018:ffffc9000283f1b0 EFLAGS: 00000206
      RAX: 0000000000000003 RBX: 0000000000000000 RCX: 1ffff1100fc0071e
      RDX: 0000000000000001 RSI: 0000000000000201 RDI: 0000000000000000
      RBP: ffff88807e0038f0 R08: 0000000000000001 R09: ffffffff8ffbf9ff
      R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000004c1e
      R13: ffffed100fc0071e R14: 0000000000000001 R15: ffff8880b9c3aa80
      FS:  00005555562bf300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007ffdbfef12b8 CR3: 00000000723c2000 CR4: 00000000003506f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       <TASK>
       pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline]
       queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline]
       queued_spin_lock include/asm-generic/qspinlock.h:85 [inline]
       do_raw_spin_lock+0x200/0x2b0 kernel/locking/spinlock_debug.c:115
       spin_lock_bh include/linux/spinlock.h:354 [inline]
       sch_tree_lock include/net/sch_generic.h:610 [inline]
       sch_tree_lock include/net/sch_generic.h:605 [inline]
       prio_tune+0x3b9/0xb50 net/sched/sch_prio.c:211
       prio_init+0x5c/0x80 net/sched/sch_prio.c:244
       qdisc_create.constprop.0+0x44a/0x10f0 net/sched/sch_api.c:1253
       tc_modify_qdisc+0x4c5/0x1980 net/sched/sch_api.c:1660
       rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5594
       netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494
       netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline]
       netlink_unicast+0x539/0x7e0 net/netlink/af_netlink.c:1343
       netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1919
       sock_sendmsg_nosec net/socket.c:705 [inline]
       sock_sendmsg+0xcf/0x120 net/socket.c:725
       ____sys_sendmsg+0x6e8/0x810 net/socket.c:2413
       ___sys_sendmsg+0xf3/0x170 net/socket.c:2467
       __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      RIP: 0033:0x7f7ee98aae99
      Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 15 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
      RSP: 002b:00007ffdbfef12d8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
      RAX: ffffffffffffffda RBX: 00007ffdbfef1300 RCX: 00007f7ee98aae99
      RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000003
      RBP: 0000000000000000 R08: 000000000000000d R09: 000000000000000d
      R10: 000000000000000d R11: 0000000000000246 R12: 00007ffdbfef12f0
      R13: 00000000000f4240 R14: 000000000004ca47 R15: 00007ffdbfef12e4
       </TASK>
      INFO: NMI handler (nmi_cpu_backtrace_handler) took too long to run: 2.293 msecs
      NMI backtrace for cpu 1
      CPU: 1 PID: 3260 Comm: kworker/1:3 Not tainted 5.17.0-rc3-syzkaller-00149-gbf8e59fd315f #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Workqueue: mld mld_ifc_work
      Call Trace:
       <IRQ>
       __dump_stack lib/dump_stack.c:88 [inline]
       dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
       nmi_cpu_backtrace.cold+0x47/0x144 lib/nmi_backtrace.c:111
       nmi_trigger_cpumask_backtrace+0x1b3/0x230 lib/nmi_backtrace.c:62
       trigger_single_cpu_backtrace include/linux/nmi.h:164 [inline]
       rcu_dump_cpu_stacks+0x25e/0x3f0 kernel/rcu/tree_stall.h:343
       print_cpu_stall kernel/rcu/tree_stall.h:604 [inline]
       check_cpu_stall kernel/rcu/tree_stall.h:688 [inline]
       rcu_pending kernel/rcu/tree.c:3919 [inline]
       rcu_sched_clock_irq.cold+0x5c/0x759 kernel/rcu/tree.c:2617
       update_process_times+0x16d/0x200 kernel/time/timer.c:1785
       tick_sched_handle+0x9b/0x180 kernel/time/tick-sched.c:226
       tick_sched_timer+0x1b0/0x2d0 kernel/time/tick-sched.c:1428
       __run_hrtimer kernel/time/hrtimer.c:1685 [inline]
       __hrtimer_run_queues+0x1c0/0xe50 kernel/time/hrtimer.c:1749
       hrtimer_interrupt+0x31c/0x790 kernel/time/hrtimer.c:1811
       local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1086 [inline]
       __sysvec_apic_timer_interrupt+0x146/0x530 arch/x86/kernel/apic/apic.c:1103
       sysvec_apic_timer_interrupt+0x8e/0xc0 arch/x86/kernel/apic/apic.c:1097
       </IRQ>
       <TASK>
       asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638
      RIP: 0010:__sanitizer_cov_trace_const_cmp4+0xc/0x70 kernel/kcov.c:286
      Code: 00 00 00 48 89 7c 30 e8 48 89 4c 30 f0 4c 89 54 d8 20 48 89 10 5b c3 0f 1f 80 00 00 00 00 41 89 f8 bf 03 00 00 00 4c 8b 14 24 <89> f1 65 48 8b 34 25 00 70 02 00 e8 14 f9 ff ff 84 c0 74 4b 48 8b
      RSP: 0018:ffffc90002c5eea8 EFLAGS: 00000246
      RAX: 0000000000000007 RBX: ffff88801c625800 RCX: 0000000000000000
      RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
      RBP: ffff8880137d3100 R08: 0000000000000000 R09: 0000000000000000
      R10: ffffffff874fcd88 R11: 0000000000000000 R12: ffff88801d692dc0
      R13: ffff8880137d3104 R14: 0000000000000000 R15: ffff88801d692de8
       tcf_police_act+0x358/0x11d0 net/sched/act_police.c:256
       tcf_action_exec net/sched/act_api.c:1049 [inline]
       tcf_action_exec+0x1a6/0x530 net/sched/act_api.c:1026
       tcf_exts_exec include/net/pkt_cls.h:326 [inline]
       route4_classify+0xef0/0x1400 net/sched/cls_route.c:179
       __tcf_classify net/sched/cls_api.c:1549 [inline]
       tcf_classify+0x3e8/0x9d0 net/sched/cls_api.c:1615
       prio_classify net/sched/sch_prio.c:42 [inline]
       prio_enqueue+0x3a7/0x790 net/sched/sch_prio.c:75
       dev_qdisc_enqueue+0x40/0x300 net/core/dev.c:3668
       __dev_xmit_skb net/core/dev.c:3756 [inline]
       __dev_queue_xmit+0x1f61/0x3660 net/core/dev.c:4081
       neigh_hh_output include/net/neighbour.h:533 [inline]
       neigh_output include/net/neighbour.h:547 [inline]
       ip_finish_output2+0x14dc/0x2170 net/ipv4/ip_output.c:228
       __ip_finish_output net/ipv4/ip_output.c:306 [inline]
       __ip_finish_output+0x396/0x650 net/ipv4/ip_output.c:288
       ip_finish_output+0x32/0x200 net/ipv4/ip_output.c:316
       NF_HOOK_COND include/linux/netfilter.h:296 [inline]
       ip_output+0x196/0x310 net/ipv4/ip_output.c:430
       dst_output include/net/dst.h:451 [inline]
       ip_local_out+0xaf/0x1a0 net/ipv4/ip_output.c:126
       iptunnel_xmit+0x628/0xa50 net/ipv4/ip_tunnel_core.c:82
       geneve_xmit_skb drivers/net/geneve.c:966 [inline]
       geneve_xmit+0x10c8/0x3530 drivers/net/geneve.c:1077
       __netdev_start_xmit include/linux/netdevice.h:4683 [inline]
       netdev_start_xmit include/linux/netdevice.h:4697 [inline]
       xmit_one net/core/dev.c:3473 [inline]
       dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3489
       __dev_queue_xmit+0x2985/0x3660 net/core/dev.c:4116
       neigh_hh_output include/net/neighbour.h:533 [inline]
       neigh_output include/net/neighbour.h:547 [inline]
       ip6_finish_output2+0xf7a/0x14f0 net/ipv6/ip6_output.c:126
       __ip6_finish_output net/ipv6/ip6_output.c:191 [inline]
       __ip6_finish_output+0x61e/0xe90 net/ipv6/ip6_output.c:170
       ip6_finish_output+0x32/0x200 net/ipv6/ip6_output.c:201
       NF_HOOK_COND include/linux/netfilter.h:296 [inline]
       ip6_output+0x1e4/0x530 net/ipv6/ip6_output.c:224
       dst_output include/net/dst.h:451 [inline]
       NF_HOOK include/linux/netfilter.h:307 [inline]
       NF_HOOK include/linux/netfilter.h:301 [inline]
       mld_sendpack+0x9a3/0xe40 net/ipv6/mcast.c:1826
       mld_send_cr net/ipv6/mcast.c:2127 [inline]
       mld_ifc_work+0x71c/0xdc0 net/ipv6/mcast.c:2659
       process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307
       worker_thread+0x657/0x1110 kernel/workqueue.c:2454
       kthread+0x2e9/0x3a0 kernel/kthread.c:377
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
       </TASK>
      ----------------
      Code disassembly (best guess):
         0:   48 89 eb                mov    %rbp,%rbx
         3:   c6 45 01 01             movb   $0x1,0x1(%rbp)
         7:   41 bc 00 80 00 00       mov    $0x8000,%r12d
         d:   48 c1 e9 03             shr    $0x3,%rcx
        11:   83 e3 07                and    $0x7,%ebx
        14:   41 be 01 00 00 00       mov    $0x1,%r14d
        1a:   48 b8 00 00 00 00 00    movabs $0xdffffc0000000000,%rax
        21:   fc ff df
        24:   4c 8d 2c 01             lea    (%rcx,%rax,1),%r13
        28:   eb 0c                   jmp    0x36
      * 2a:   f3 90                   pause <-- trapping instruction
        2c:   41 83 ec 01             sub    $0x1,%r12d
        30:   0f 84 72 04 00 00       je     0x4a8
        36:   41 0f b6 45 00          movzbl 0x0(%r13),%eax
        3b:   38 d8                   cmp    %bl,%al
        3d:   7f 08                   jg     0x47
        3f:   84                      .byte 0x84
      
      Fixes: 1da177e4
      
       ("Linux-2.6.12-rc2")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Link: https://lore.kernel.org/r/20220215235305.3272331-1-eric.dumazet@gmail.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c83049cb
    • Max Kellermann's avatar
      lib/iov_iter: initialize "flags" in new pipe_buffer · 87c575d2
      Max Kellermann authored
      commit 9d2231c5 upstream.
      
      The functions copy_page_to_iter_pipe() and push_pipe() can both
      allocate a new pipe_buffer, but the "flags" member initializer is
      missing.
      
      Fixes: 241699cd
      
       ("new iov_iter flavour: pipe-backed")
      To: Alexander Viro <viro@zeniv.linux.org.uk>
      To: linux-fsdevel@vger.kernel.org
      To: linux-kernel@vger.kernel.org
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMax Kellermann <max.kellermann@ionos.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      87c575d2