02 Dec, 2022

1 commit


09 Nov, 2022

2 commits

  • commit 8e30538eca016de8e252bef174beadecd64239f0 upstream.

    The dma_map_single() doesn't permit zero length mapping. It causes a follow
    panic.

    A panic was reported on arm64:

    [ 60.137988] ------------[ cut here ]------------
    [ 60.142630] kernel BUG at kernel/dma/swiotlb.c:624!
    [ 60.147508] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
    [ 60.152992] Modules linked in: dw_hdmi_cec crct10dif_ce simple_bridge rcar_fdp1 vsp1 rcar_vin videobuf2_vmalloc rcar_csi2 v4l
    2_mem2mem videobuf2_dma_contig videobuf2_memops pci_endpoint_test videobuf2_v4l2 videobuf2_common rcar_fcp v4l2_fwnode v4l2_asyn
    c videodev mc gpio_bd9571mwv max9611 pwm_rcar ccree at24 authenc libdes phy_rcar_gen3_usb3 usb_dmac display_connector pwm_bl
    [ 60.186252] CPU: 0 PID: 508 Comm: pcitest Not tainted 6.0.0-rc1rpci-dev+ #237
    [ 60.193387] Hardware name: Renesas Salvator-X 2nd version board based on r8a77951 (DT)
    [ 60.201302] pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [ 60.208263] pc : swiotlb_tbl_map_single+0x2c0/0x590
    [ 60.213149] lr : swiotlb_map+0x88/0x1f0
    [ 60.216982] sp : ffff80000a883bc0
    [ 60.220292] x29: ffff80000a883bc0 x28: 0000000000000000 x27: 0000000000000000
    [ 60.227430] x26: 0000000000000000 x25: ffff0004c0da20d0 x24: ffff80000a1f77c0
    [ 60.234567] x23: 0000000000000002 x22: 0001000040000010 x21: 000000007a000000
    [ 60.241703] x20: 0000000000200000 x19: 0000000000000000 x18: 0000000000000000
    [ 60.248840] x17: 0000000000000000 x16: 0000000000000000 x15: ffff0006ff7b9180
    [ 60.255977] x14: ffff0006ff7b9180 x13: 0000000000000000 x12: 0000000000000000
    [ 60.263113] x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
    [ 60.270249] x8 : 0001000000000010 x7 : ffff0004c6754b20 x6 : 0000000000000000
    [ 60.277385] x5 : ffff0004c0da2090 x4 : 0000000000000000 x3 : 0000000000000001
    [ 60.284521] x2 : 0000000040000000 x1 : 0000000000000000 x0 : 0000000040000010
    [ 60.291658] Call trace:
    [ 60.294100] swiotlb_tbl_map_single+0x2c0/0x590
    [ 60.298629] swiotlb_map+0x88/0x1f0
    [ 60.302115] dma_map_page_attrs+0x188/0x230
    [ 60.306299] pci_endpoint_test_ioctl+0x5e4/0xd90 [pci_endpoint_test]
    [ 60.312660] __arm64_sys_ioctl+0xa8/0xf0
    [ 60.316583] invoke_syscall+0x44/0x108
    [ 60.320334] el0_svc_common.constprop.0+0xcc/0xf0
    [ 60.325038] do_el0_svc+0x2c/0xb8
    [ 60.328351] el0_svc+0x2c/0x88
    [ 60.331406] el0t_64_sync_handler+0xb8/0xc0
    [ 60.335587] el0t_64_sync+0x18c/0x190
    [ 60.339251] Code: 52800013 d2e00414 35fff45c d503201f (d4210000)
    [ 60.345344] ---[ end trace 0000000000000000 ]---

    To fix it, this patch adds a checking the payload length if it is zero.

    Fixes: 343dc693f7b7 ("misc: pci_endpoint_test: Prevent some integer overflows")
    Cc: stable
    Signed-off-by: Shunsuke Mie
    Link: https://lore.kernel.org/r/20220907020100.122588-2-mie@igel.co.jp
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Greg Kroah-Hartman
    (cherry picked from commit e5ebcbb4f967af2083d409271aaf7c7d8351603f)

    Shunsuke Mie
     
  • commit 3e42deaac06567c7e86d287c305ccda24db4ae3d upstream.

    Each transfer test functions have same parameter checking code. This patch
    unites those to an introduced function.

    Signed-off-by: Shunsuke Mie
    Cc: stable
    Link: https://lore.kernel.org/r/20220907020100.122588-1-mie@igel.co.jp
    Signed-off-by: Greg Kroah-Hartman
    (cherry picked from commit cb9defecf381415f6aeb433a05a6c4374775e9d6)

    Shunsuke Mie
     

26 Oct, 2022

1 commit


27 Sep, 2022

1 commit

  • This is the 5.15.70 stable release

    * tag 'v5.15.70': (2444 commits)
    Linux 5.15.70
    ALSA: hda/sigmatel: Fix unused variable warning for beep power change
    cgroup: Add missing cpus_read_lock() to cgroup_attach_task_all()
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm/boot/dts/imx6ul.dtsi
    arch/arm/mm/mmu.c
    arch/arm64/boot/dts/freescale/imx8mp-evk.dts
    drivers/gpu/drm/imx/dcss/dcss-kms.c
    drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
    drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.h
    drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
    drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
    drivers/soc/fsl/Kconfig
    drivers/soc/imx/gpcv2.c
    drivers/usb/dwc3/host.c
    net/dsa/slave.c
    sound/soc/fsl/imx-card.c

    Jason Liu
     

08 Sep, 2022

2 commits

  • commit d245f43aab2b61195d8ebb64cef7b5a08c590ab4 upstream.

    The probe session-duplication overflow check incremented the session
    count also when there were no more available sessions so that memory
    beyond the fixed-size slab-allocated session array could be corrupted in
    fastrpc_session_alloc() on open().

    Fixes: f6f9279f2bf0 ("misc: fastrpc: Add Qualcomm fastrpc basic driver model")
    Cc: stable@vger.kernel.org # 5.1
    Signed-off-by: Johan Hovold
    Link: https://lore.kernel.org/r/20220829080531.29681-3-johan+linaro@kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • commit 9baa1415d9abdd1e08362ea2dcfadfacee8690b5 upstream.

    Add the missing sanity check on the probed-session count to avoid
    corrupting memory beyond the fixed-size slab-allocated session array
    when there are more than FASTRPC_MAX_SESSIONS sessions defined in the
    devicetree.

    Fixes: f6f9279f2bf0 ("misc: fastrpc: Add Qualcomm fastrpc basic driver model")
    Cc: stable@vger.kernel.org # 5.1
    Signed-off-by: Johan Hovold
    Link: https://lore.kernel.org/r/20220829080531.29681-2-johan+linaro@kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     

25 Aug, 2022

4 commits

  • [ Upstream commit 3a15b45b5454da862376b5d69a4967f5c6fa1368 ]

    A bitmap_zalloc() must be balanced by a corresponding bitmap_free() in the
    error handling path of afu_allocate_irqs().

    Acked-by: Andrew Donnellan
    Signed-off-by: Christophe JAILLET
    Link: https://lore.kernel.org/r/ce5869418f5838187946eb6b11a52715a93ece3d.1657566849.git.christophe.jaillet@wanadoo.fr
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Christophe JAILLET
     
  • [ Upstream commit e3f49437a2e0221a387ecd192d742ae1434e1e3a ]

    This fixes a sparse warning of
    "cast truncates bits from constant value"

    Signed-off-by: Oded Gabbay
    Signed-off-by: Sasha Levin

    Oded Gabbay
     
  • [ Upstream commit 01622098aeb05a5efbb727199bbc2a4653393255 ]

    When validating NIC queues, queue offset calculation must be
    performed only for NIC queues.

    Signed-off-by: Ofir Bitton
    Reviewed-by: Oded Gabbay
    Signed-off-by: Oded Gabbay
    Signed-off-by: Sasha Levin

    Ofir Bitton
     
  • [ Upstream commit 80fc671bcc0173836e9032b0c698ea74c13b9d7c ]

    The uacce driver must deal with a possible removal of the parent device
    or parent driver module rmmod at any time.

    Although uacce_remove(), called on device removal and on driver unbind,
    prevents future use of the uacce fops by removing the cdev, fops that
    were called before that point may still be running.

    Serialize uacce_fops_open() and uacce_remove() with uacce->mutex.
    Serialize other fops against uacce_remove() with q->mutex.
    Since we need to protect uacce_fops_poll() which gets called on the fast
    path, replace uacce->queues_lock with q->mutex to improve scalability.
    The other fops are only used during setup.

    uacce_queue_is_valid(), checked under q->mutex or uacce->mutex, denotes
    whether uacce_remove() has disabled all queues. If that is the case,
    don't go any further since the parent device is being removed and
    uacce->ops should not be called anymore.

    Reported-by: Yang Shen
    Signed-off-by: Zhangfei Gao
    Signed-off-by: Jean-Philippe Brucker
    Link: https://lore.kernel.org/r/20220701034843.7502-1-zhangfei.gao@linaro.org
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Jean-Philippe Brucker
     

17 Aug, 2022

2 commits

  • [ Upstream commit 71d46f1ff2212ced4852c7e77c5176382a1bdcec ]

    The simple_write_to_buffer() function will return positive/success if it
    is able to write a single byte anywhere within the buffer. However that
    potentially leaves a lot of the buffer uninitialized.

    In this code it's better to return 0 if the offset is non-zero. This
    code is not written to support partial writes. And then return -EFAULT
    if the buffer is not completely initialized.

    Fixes: cfad6425382e ("eeprom: Add IDT 89HPESx EEPROM/CSR driver")
    Reviewed-by: Serge Semin
    Signed-off-by: Dan Carpenter
    Link: https://lore.kernel.org/r/Ysg1Pu/nzSMe3r1q@kili
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Dan Carpenter
     
  • [ Upstream commit 44fd1917314e9d4f53dd95dd65df1c152f503d3a ]

    If an error occurs after a successful idr_alloc() call, the corresponding
    resource must be released with idr_remove() as already done in the .remove
    function.

    Update the error handling path to add the missing idr_remove() call.

    Fixes: ada8a8a13b13 ("mfd: Add realtek pcie card reader driver")
    Signed-off-by: Christophe JAILLET
    Link: https://lore.kernel.org/r/e8dc41716cbf52fb37a12e70d8972848e69df6d6.1655271216.git.christophe.jaillet@wanadoo.fr
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Christophe JAILLET
     

05 Aug, 2022

1 commit


12 Jul, 2022

3 commits

  • commit 2cd37c2e72449a7add6da1183d20a6247d6db111 upstream.

    Set return value in rsp_buf alloc error path before going to
    error handling.

    drivers/misc/cardreader/rtsx_usb.c:639:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    if (!ucr->rsp_buf)
    ^~~~~~~~~~~~~
    drivers/misc/cardreader/rtsx_usb.c:678:9: note: uninitialized use occurs here
    return ret;
    ^~~
    drivers/misc/cardreader/rtsx_usb.c:639:2: note: remove the 'if' if its condition is always false
    if (!ucr->rsp_buf)
    ^~~~~~~~~~~~~~~~~~
    drivers/misc/cardreader/rtsx_usb.c:622:9: note: initialize the variable 'ret' to silence this warning
    int ret;
    ^
    = 0

    Fixes: 3776c7855985 ("misc: rtsx_usb: use separate command and response buffers")
    Reported-by: kernel test robot
    Cc: stable
    Signed-off-by: Shuah Khan
    Link: https://lore.kernel.org/r/20220701165352.15687-1-skhan@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan
     
  • commit 3776c78559853fd151be7c41e369fd076fb679d5 upstream.

    rtsx_usb uses same buffer for command and response. There could
    be a potential conflict using the same buffer for both especially
    if retries and timeouts are involved.

    Use separate command and response buffers to avoid conflicts.

    Signed-off-by: Shuah Khan
    Cc: stable
    Link: https://lore.kernel.org/r/07e3721804ff07aaab9ef5b39a5691d0718b9ade.1656642167.git.skhan@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan
     
  • commit eb7f8e28420372787933eec079735c35034bda7d upstream.

    rtsx_usb driver allocates coherent dma buffer for urb transfers.
    This buffer is passed to usb_bulk_msg() and usb core tries to
    map already mapped buffer running into a dma mapping error.

    xhci_hcd 0000:01:00.0: rejecting DMA map of vmalloc memory
    WARNING: CPU: 1 PID: 279 at include/linux/dma-mapping.h:326 usb_ hcd_map_urb_for_dma+0x7d6/0x820

    ...

    xhci_map_urb_for_dma+0x291/0x4e0
    usb_hcd_submit_urb+0x199/0x12b0
    ...
    usb_submit_urb+0x3b8/0x9e0
    usb_start_wait_urb+0xe3/0x2d0
    usb_bulk_msg+0x115/0x240
    rtsx_usb_transfer_data+0x185/0x1a8 [rtsx_usb]
    rtsx_usb_send_cmd+0xbb/0x123 [rtsx_usb]
    rtsx_usb_write_register+0x12c/0x143 [rtsx_usb]
    rtsx_usb_probe+0x226/0x4b2 [rtsx_usb]

    Fix it to use kmalloc() to get DMA-able memory region instead.

    Signed-off-by: Shuah Khan
    Cc: stable
    Link: https://lore.kernel.org/r/667d627d502e1ba9ff4f9b94966df3299d2d3c0d.1656642167.git.skhan@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan
     

30 Jun, 2022

2 commits

  • This is the 5.15.50 stable release

    * tag 'v5.15.50': (1395 commits)
    Linux 5.15.50
    arm64: mm: Don't invalidate FROM_DEVICE buffers at start of DMA transfer
    serial: core: Initialize rs485 RTS polarity already on probe
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    drivers/bus/fsl-mc/fsl-mc-bus.c
    drivers/crypto/caam/ctrl.c
    drivers/pci/controller/dwc/pci-imx6.c
    drivers/spi/spi-fsl-qspi.c
    drivers/tty/serial/fsl_lpuart.c
    include/uapi/linux/dma-buf.h

    Jason Liu
     
  • This is the 5.15.41 stable release

    * tag 'v5.15.41': (1977 commits)
    Linux 5.15.41
    usb: gadget: uvc: allow for application to cleanly shutdown
    usb: gadget: uvc: rename function to be more consistent
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
    arch/arm64/configs/defconfig
    drivers/clk/imx/clk-imx8qxp-lpcg.c
    drivers/dma/imx-sdma.c
    drivers/gpu/drm/bridge/nwl-dsi.c
    drivers/mailbox/imx-mailbox.c
    drivers/net/phy/at803x.c
    drivers/tty/serial/fsl_lpuart.c
    security/keys/trusted-keys/trusted_core.c

    Jason Liu
     

22 Jun, 2022

3 commits

  • commit 3ed8c7d39cfef831fe508fc1308f146912fa72e6 upstream.

    Add Raptor (Point) Lake S device id.

    Cc:
    Signed-off-by: Alexander Usyskin
    Signed-off-by: Tomas Winkler
    Link: https://lore.kernel.org/r/20220606144225.282375-3-tomas.winkler@intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Usyskin
     
  • commit 68553650bc9c57c7e530c84e5b2945e9dfe1a560 upstream.

    Drop HBM responses also in the early shutdown phase where
    the usual traffic is allowed.
    Extend the rule that drop HBM responses received during the shutdown
    phase by also in MEI_DEV_POWERING_DOWN state.
    This resolves the stall if the driver is stopping in the middle
    of the link initialization or link reset.

    Drop the capabilities response on early shutdown.

    Fixes: 6d7163f2c49f ("mei: hbm: drop hbm responses on early shutdown")
    Cc:
    Signed-off-by: Alexander Usyskin
    Signed-off-by: Tomas Winkler
    Link: https://lore.kernel.org/r/20220606144225.282375-2-tomas.winkler@intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Usyskin
     
  • [ Upstream commit 1c245358ce0b13669f6d1625f7a4e05c41f28980 ]

    platform_get_irq() returns negative error number instead 0 on failure.
    And the doc of platform_get_irq() provides a usage example:

    int irq = platform_get_irq(pdev, 0);
    if (irq < 0)
    return irq;

    Fix the check of return value to catch errors correctly.

    Fixes: eb1f2930609b ("Driver for the Atmel on-chip SSC on AT32AP and AT91")
    Reviewed-by: Claudiu Beznea
    Signed-off-by: Miaoqian Lin
    Link: https://lore.kernel.org/r/20220601123026.7119-1-linmq006@gmail.com
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Miaoqian Lin
     

15 Jun, 2022

7 commits

  • [ Upstream commit f861d36e021e1ac4a0a2a1f6411d623809975d63 ]

    rtsx_usb_probe() doesn't call usb_set_intfdata() to null out the
    interface pointer when probe fails. This leaves a stale pointer.
    Noticed the missing usb_set_intfdata() while debugging an unrelated
    invalid DMA mapping problem.

    Fix it with a call to usb_set_intfdata(..., NULL).

    Signed-off-by: Shuah Khan
    Link: https://lore.kernel.org/r/20220429210913.46804-1-skhan@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Shuah Khan
     
  • [ Upstream commit f387e86d3a74407bdd9c5815820ac9d060962840 ]

    To be sufficiently out of range for the usercopy test to see the lifetime
    mismatch, expand the size of the "bad" buffer, which will let it be
    beyond current_stack_pointer regardless of stack growth direction.
    Paired with the recent addition of stack depth checking under
    CONFIG_HARDENED_USERCOPY=y, this will correctly start tripping again.

    Reported-by: Muhammad Usama Anjum
    Cc: Arnd Bergmann
    Cc: Greg Kroah-Hartman
    Reviewed-by: Muhammad Usama Anjum
    Link: https://lore.kernel.org/lkml/762faf1b-0443-5ddf-4430-44a20cf2ec4d@collabora.com/
    Signed-off-by: Kees Cook
    Signed-off-by: Sasha Levin

    Kees Cook
     
  • [ Upstream commit e918c10265ef2bc82ce8a6fed6d8123d09ec1db3 ]

    The pvpanic driver relies on panic notifiers to execute a callback
    on panic event. Such function is executed in atomic context - the
    panic function disables local IRQs, preemption and all other CPUs
    that aren't running the panic code.

    With that said, it's dangerous to use regular spinlocks in such path,
    as introduced by commit b3c0f8774668 ("misc/pvpanic: probe multiple instances").
    This patch fixes that by replacing regular spinlocks with the trylock
    safer approach.

    It also fixes an old comment (about a long gone framebuffer code) and
    the notifier priority - we should execute hypervisor notifiers early,
    deferring this way the panic action to the hypervisor, as expected by
    the users that are setting up pvpanic.

    Fixes: b3c0f8774668 ("misc/pvpanic: probe multiple instances")
    Cc: Christophe JAILLET
    Cc: Mihai Carabas
    Cc: Shile Zhang
    Cc: Wang ShaoBo
    Cc: zhenwei pi
    Signed-off-by: Guilherme G. Piccoli
    Link: https://lore.kernel.org/r/20220427224924.592546-6-gpiccoli@igalia.com
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Guilherme G. Piccoli
     
  • [ Upstream commit cc5b392d0f94f27743583140d819fa35a46899db ]

    Fix a few spelling typos in the comments.

    Reviewed-by: Mihai Carabas
    Signed-off-by: Andy Shevchenko
    Link: https://lore.kernel.org/r/20210829124354.81653-2-andriy.shevchenko@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Andy Shevchenko
     
  • [ Upstream commit 5ac11fe03a0a83042d1a040dbce4fa2fb5521e23 ]

    The bug is here:
    if (!buf) {

    The list iterator value 'buf' will *always* be set and non-NULL
    by list_for_each_entry(), so it is incorrect to assume that the
    iterator value will be NULL if the list is empty (in this case, the
    check 'if (!buf) {' will always be false and never exit expectly).

    To fix the bug, use a new variable 'iter' as the list iterator,
    while use the original variable 'buf' as a dedicated pointer to
    point to the found element.

    Fixes: 2419e55e532de ("misc: fastrpc: add mmap/unmap support")
    Signed-off-by: Xiaomeng Tong
    Link: https://lore.kernel.org/r/20220327062202.5720-1-xiam0nd.tong@gmail.com
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Xiaomeng Tong
     
  • [ Upstream commit 8bfdbddd68249e0d8598777cca8249619ee51df0 ]

    When you don't select CONFIG_UBSAN_TRAP, you get:

    # echo ARRAY_BOUNDS > /sys/kernel/debug/provoke-crash/DIRECT
    [ 102.265827] ================================================================================
    [ 102.278433] UBSAN: array-index-out-of-bounds in drivers/misc/lkdtm/bugs.c:342:16
    [ 102.287207] index 8 is out of range for type 'char [8]'
    [ 102.298722] ================================================================================
    [ 102.313712] lkdtm: FAIL: survived array bounds overflow!
    [ 102.318770] lkdtm: Unexpected! This kernel (5.16.0-rc1-s3k-dev-01884-g720dcf79314a ppc) was built with CONFIG_UBSAN_BOUNDS=y

    It is not correct because when CONFIG_UBSAN_TRAP is not selected
    you can't expect array bounds overflow to kill the thread.

    Modify the logic so that when the kernel is built with
    CONFIG_UBSAN_BOUNDS but without CONFIG_UBSAN_TRAP, you get a warning
    about CONFIG_UBSAN_TRAP not been selected instead.

    This also require a fix of pr_expected_config(), otherwise the
    following error is encountered.

    CC drivers/misc/lkdtm/bugs.o
    drivers/misc/lkdtm/bugs.c: In function 'lkdtm_ARRAY_BOUNDS':
    drivers/misc/lkdtm/bugs.c:351:2: error: 'else' without a previous 'if'
    351 | else
    | ^~~~

    Fixes: c75be56e35b2 ("lkdtm/bugs: Add ARRAY_BOUNDS to selftests")
    Signed-off-by: Christophe Leroy
    Signed-off-by: Kees Cook
    Link: https://lore.kernel.org/r/363b58690e907c677252467a94fe49444c80ea76.1649704381.git.christophe.leroy@csgroup.eu
    Signed-off-by: Sasha Levin

    Christophe Leroy
     
  • [ Upstream commit 4a9800c81d2f34afb66b4b42e0330ae8298019a2 ]

    As the possible failure of the kmalloc(), the not_checked and checked
    could be NULL pointer.
    Therefore, it should be better to check it in order to avoid the
    dereference of the NULL pointer.
    Also, we need to kfree the 'not_checked' and 'checked' to avoid
    the memory leak if fails.
    And since it is just a test, it may directly return without error
    number.

    Fixes: ae2e1aad3e48 ("drivers/misc/lkdtm/bugs.c: add arithmetic overflow and array bounds checks")
    Signed-off-by: Jiasheng Jiang
    Acked-by: Dan Carpenter
    Signed-off-by: Kees Cook
    Link: https://lore.kernel.org/r/20220120092936.1874264-1-jiasheng@iscas.ac.cn
    Signed-off-by: Sasha Levin

    Jiasheng Jiang
     

09 Jun, 2022

1 commit

  • [ Upstream commit 950cf957fe34d40d63dfa3bf3968210430b6491e ]

    info_release() will be called in device_unregister() when info->dev's
    reference count is 0. So there is no need to call ocxl_afu_put() and
    kfree() again.

    Fix this by adding free_minor() and return to err_unregister error path.

    Fixes: 75ca758adbaf ("ocxl: Create a clear delineation between ocxl backend & frontend")
    Signed-off-by: Hangyu Hua
    Acked-by: Frederic Barrat
    Signed-off-by: Michael Ellerman
    Link: https://lore.kernel.org/r/20220418085758.38145-1-hbh25y@gmail.com
    Signed-off-by: Sasha Levin

    Hangyu Hua
     

25 May, 2022

1 commit


09 May, 2022

1 commit

  • commit 5b47b751b760ee1c74a51660fd096aa148a362cd upstream.

    Reading EEPROM fails with following warning:

    [ 16.357496] ------------[ cut here ]------------
    [ 16.357529] fsl_spi b01004c0.spi: rejecting DMA map of vmalloc memory
    [ 16.357698] WARNING: CPU: 0 PID: 371 at include/linux/dma-mapping.h:326 fsl_spi_cpm_bufs+0x2a0/0x2d8
    [ 16.357775] CPU: 0 PID: 371 Comm: od Not tainted 5.16.11-s3k-dev-01743-g19beecbfe9d6-dirty #109
    [ 16.357806] NIP: c03fbc9c LR: c03fbc9c CTR: 00000000
    [ 16.357825] REGS: e68d9b20 TRAP: 0700 Not tainted (5.16.11-s3k-dev-01743-g19beecbfe9d6-dirty)
    [ 16.357849] MSR: 00029032 CR: 24002282 XER: 00000000
    [ 16.357931]
    [ 16.357931] GPR00: c03fbc9c e68d9be0 c26d06a0 00000039 00000001 c0d36364 c0e96428 00000027
    [ 16.357931] GPR08: 00000001 00000000 00000023 3fffc000 24002282 100d3dd6 100a2ffc 00000000
    [ 16.357931] GPR16: 100cd280 100b0000 00000000 aff54f7e 100d0000 100d0000 00000001 100cf328
    [ 16.357931] GPR24: 100cf328 00000000 00000003 e68d9e30 c156b410 e67ab4c0 e68d9d38 c24ab278
    [ 16.358253] NIP [c03fbc9c] fsl_spi_cpm_bufs+0x2a0/0x2d8
    [ 16.358292] LR [c03fbc9c] fsl_spi_cpm_bufs+0x2a0/0x2d8
    [ 16.358325] Call Trace:
    [ 16.358336] [e68d9be0] [c03fbc9c] fsl_spi_cpm_bufs+0x2a0/0x2d8 (unreliable)
    [ 16.358388] [e68d9c00] [c03fcb44] fsl_spi_bufs.isra.0+0x94/0x1a0
    [ 16.358436] [e68d9c20] [c03fd970] fsl_spi_do_one_msg+0x254/0x3dc
    [ 16.358483] [e68d9cb0] [c03f7e50] __spi_pump_messages+0x274/0x8a4
    [ 16.358529] [e68d9ce0] [c03f9d30] __spi_sync+0x344/0x378
    [ 16.358573] [e68d9d20] [c03fb52c] spi_sync+0x34/0x60
    [ 16.358616] [e68d9d30] [c03b4dec] at25_ee_read+0x138/0x1a8
    [ 16.358667] [e68d9e50] [c04a8fb8] bin_attr_nvmem_read+0x98/0x110
    [ 16.358725] [e68d9e60] [c0204b14] kernfs_fop_read_iter+0xc0/0x1fc
    [ 16.358774] [e68d9e80] [c0168660] vfs_read+0x284/0x410
    [ 16.358821] [e68d9f00] [c016925c] ksys_read+0x6c/0x11c
    [ 16.358863] [e68d9f30] [c00160e0] ret_from_syscall+0x0/0x28
    ...
    [ 16.359608] ---[ end trace a4ce3e34afef0cb5 ]---
    [ 16.359638] fsl_spi b01004c0.spi: unable to map tx dma

    This is due to the AT25 driver using buffers on stack, which is not
    possible with CONFIG_VMAP_STACK.

    As mentionned in kernel Documentation (Documentation/spi/spi-summary.rst):

    - Follow standard kernel rules, and provide DMA-safe buffers in
    your messages. That way controller drivers using DMA aren't forced
    to make extra copies unless the hardware requires it (e.g. working
    around hardware errata that force the use of bounce buffering).

    Modify the driver to use a buffer located in the at25 device structure
    which is allocated via kmalloc during probe.

    Protect writes in this new buffer with the driver's mutex.

    Fixes: b587b13a4f67 ("[PATCH] SPI eeprom driver")
    Cc: stable
    Signed-off-by: Christophe Leroy
    Link: https://lore.kernel.org/r/230a9486fc68ea0182df46255e42a51099403642.1648032613.git.christophe.leroy@csgroup.eu
    Signed-off-by: Greg Kroah-Hartman

    Christophe Leroy
     

14 Apr, 2022

1 commit

  • [ Upstream commit eb85eec858c1a5c11d3a0bff403f6440b05b40dc ]

    This patch fixes what seems to be copy paste error.

    We will have a memory leak if the host-resident shadow is NULL (which
    will likely happen as the DR and HR are not dependent).

    Signed-off-by: Ohad Sharabi
    Reviewed-by: Oded Gabbay
    Signed-off-by: Oded Gabbay
    Signed-off-by: Sasha Levin

    Ohad Sharabi
     

08 Apr, 2022

6 commits

  • [ Upstream commit 96c9e802c64014a7716865332d732cc9c7f24593 ]

    __setup() handlers should return 1 to indicate that the boot option
    has been handled. A return of 0 causes the boot option/value to be
    listed as an Unknown kernel parameter and added to init's (limited)
    environment strings. So return 1 from kgdbts_option_setup().

    Unknown kernel command line parameters "BOOT_IMAGE=/boot/bzImage-517rc7
    kgdboc=kbd kgdbts=", will be passed to user space.

    Run /sbin/init as init process
    with arguments:
    /sbin/init
    with environment:
    HOME=/
    TERM=linux
    BOOT_IMAGE=/boot/bzImage-517rc7
    kgdboc=kbd
    kgdbts=

    Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
    Fixes: e8d31c204e36 ("kgdb: add kgdb internal test suite")
    Cc: kgdb-bugreport@lists.sourceforge.net
    Cc: Jason Wessel
    Cc: Daniel Thompson
    Cc: Douglas Anderson
    Cc: Arnd Bergmann
    Cc: Greg Kroah-Hartman
    Reported-by: Igor Zhbanov
    Reviewed-by: Douglas Anderson
    Signed-off-by: Randy Dunlap
    Link: https://lore.kernel.org/r/20220308033255.22118-1-rdunlap@infradead.org
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Randy Dunlap
     
  • [ Upstream commit 9c27896ac1bb83ea5c461ce6f7089d02102a2b21 ]

    As the potential failure of the pci_enable_device(),
    it should be better to check the return value and return
    error if fails.

    Fixes: 70b2f993ea4a ("habanalabs: create common folder")
    Signed-off-by: Jiasheng Jiang
    Reviewed-by: Oded Gabbay
    Signed-off-by: Oded Gabbay
    Signed-off-by: Sasha Levin

    Jiasheng Jiang
     
  • [ Upstream commit 5b3dc949f554379edcb8ef6111aa5ecb78feb798 ]

    A successful ida_simple_get() should be balanced by a corresponding
    ida_simple_remove().

    Add the missing call in the error handling path of the probe.

    While at it, switch to ida_alloc()/ida_free() instead to
    ida_simple_get()/ida_simple_remove().
    The latter is deprecated and more verbose.

    Fixes: 4f556bc04e3c ("misc: cardreader: add new Alcor Micro Cardreader PCI driver")
    Reviewed-by: Oleksij Rempel
    Signed-off-by: Christophe JAILLET
    Link: https://lore.kernel.org/r/918a9875b7f67b7f8f123c4446452603422e8c5e.1644136776.git.christophe.jaillet@wanadoo.fr
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Christophe JAILLET
     
  • commit c10187b1c5ebb8681ca467ab7b0ded5ea415d258 upstream.

    Usage of the iterator outside of the list_for_each_entry
    is considered harmful. https://lkml.org/lkml/2022/2/17/1032

    Do not reference the loop variable outside of the loop,
    by rearranging the orders of execution.
    Instead of performing search loop and checking outside the loop
    if the end of the list was hit and no matching element was found,
    the execution is performed inside the loop upon a successful match
    followed by a goto statement to the next step,
    therefore no condition has to be performed after the loop has ended.

    Cc:
    Signed-off-by: Alexander Usyskin
    Signed-off-by: Tomas Winkler
    Link: https://lore.kernel.org/r/20220308095926.300412-1-tomas.winkler@intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Usyskin
     
  • commit 7bbbd0845818cffa9fa8ccfe52fa1cad58e7e4f2 upstream.

    Add Alder Lake N device ID.

    Cc:
    Signed-off-by: Alexander Usyskin
    Signed-off-by: Tomas Winkler
    Link: https://lore.kernel.org/r/20220301071115.96145-1-tomas.winkler@intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Usyskin
     
  • commit ccdf6f806fbf559f7c29ed9302a7c1b4da7fd37f upstream.

    Add a quirk to disable MEI interface on Intel PCH Ignition (IGN)
    as the IGN firmware doesn't support the protocol.

    Cc:
    Signed-off-by: Alexander Usyskin
    Signed-off-by: Tomas Winkler
    Link: https://lore.kernel.org/r/20220215080438.264876-1-tomas.winkler@intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Usyskin
     

11 Mar, 2022

1 commit

  • This is the 5.15.27 stable release

    * tag 'v5.15.27': (3069 commits)
    Linux 5.15.27
    hamradio: fix macro redefine warning
    KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots()
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm/boot/dts/imx7ulp.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
    arch/arm64/boot/dts/freescale/imx8mq.dtsi
    drivers/dma-buf/heaps/cma_heap.c
    drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
    drivers/gpu/drm/mxsfb/mxsfb_kms.c
    drivers/mmc/host/sdhci-esdhc-imx.c
    drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
    drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
    drivers/rpmsg/rpmsg_char.c
    drivers/soc/imx/gpcv2.c
    drivers/thermal/imx_thermal.c

    Jason Liu