Changelog in Linux kernel 6.6.99

 
ALSA: hda/realtek - Enable mute LED on HP Pavilion Laptop 15-eg100 [+ + +]
Author: Yasmin Fitzgerald <[email protected]>
Date:   Sat Jun 21 01:36:14 2025 -0400

    ALSA: hda/realtek - Enable mute LED on HP Pavilion Laptop 15-eg100
    
    [ Upstream commit 68cc9d3c8e44afe90e43cbbd2960da15c2f31e23 ]
    
    The HP Pavilion Laptop 15-eg100 has Realtek HDA codec ALC287.
    It needs the ALC287_FIXUP_HP_GPIO_LED quirk to enable the mute LED.
    
    Signed-off-by: Yasmin Fitzgerald <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
ASoC: amd: yc: add quirk for Acer Nitro ANV15-41 internal mic [+ + +]
Author: Yuzuru10 <[email protected]>
Date:   Sun Jun 22 22:58:00 2025 +0000

    ASoC: amd: yc: add quirk for Acer Nitro ANV15-41 internal mic
    
    [ Upstream commit 7186b81807b4a08f8bf834b6bdc72d6ed8ba1587 ]
    
    This patch adds DMI-based quirk for the Acer Nitro ANV15-41,
    allowing the internal microphone to be detected correctly on
    machines with "RB" as board vendor.
    
    Signed-off-by: Yuzuru <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ASoC: cs35l56: probe() should fail if the device ID is not recognized [+ + +]
Author: Richard Fitzgerald <[email protected]>
Date:   Thu Jul 3 11:25:21 2025 +0100

    ASoC: cs35l56: probe() should fail if the device ID is not recognized
    
    [ Upstream commit 3b3312f28ee2d9c386602f8521e419cfc69f4823 ]
    
    Return an error from driver probe if the DEVID read from the chip is not
    one supported by this driver.
    
    In cs35l56_hw_init() there is a check for valid DEVID, but the invalid
    case was returning the value of ret. At this point in the code ret == 0
    so the caller would think that cs35l56_hw_init() was successful.
    
    Signed-off-by: Richard Fitzgerald <[email protected]>
    Fixes: 84851aa055c8 ("ASoC: cs35l56: Move part of cs35l56_init() to shared library")
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

ASoC: fsl_asrc: use internal measured ratio for non-ideal ratio mode [+ + +]
Author: Shengjiu Wang <[email protected]>
Date:   Wed Jun 25 10:05:04 2025 +0800

    ASoC: fsl_asrc: use internal measured ratio for non-ideal ratio mode
    
    [ Upstream commit cbe876121633dadb2b0ce52711985328638e9aab ]
    
    When USRC=0, there is underrun issue for the non-ideal ratio mode;
    according to the reference mannual, the internal measured ratio can be
    used with USRC=1 and IDRC=0.
    
    Fixes: d0250cf4f2ab ("ASoC: fsl_asrc: Add an option to select internal ratio mode")
    Signed-off-by: Shengjiu Wang <[email protected]>
    Reviewed-by: Daniel Baluta <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
atm: clip: Fix infinite recursive call of clip_push(). [+ + +]
Author: Kuniyuki Iwashima <[email protected]>
Date:   Fri Jul 4 06:23:53 2025 +0000

    atm: clip: Fix infinite recursive call of clip_push().
    
    [ Upstream commit c489f3283dbfc0f3c00c312149cae90d27552c45 ]
    
    syzbot reported the splat below. [0]
    
    This happens if we call ioctl(ATMARP_MKIP) more than once.
    
    During the first call, clip_mkip() sets clip_push() to vcc->push(),
    and the second call copies it to clip_vcc->old_push().
    
    Later, when the socket is close()d, vcc_destroy_socket() passes
    NULL skb to clip_push(), which calls clip_vcc->old_push(),
    triggering the infinite recursion.
    
    Let's prevent the second ioctl(ATMARP_MKIP) by checking
    vcc->user_back, which is allocated by the first call as clip_vcc.
    
    Note also that we use lock_sock() to prevent racy calls.
    
    [0]:
    BUG: TASK stack guard page was hit at ffffc9000d66fff8 (stack is ffffc9000d670000..ffffc9000d678000)
    Oops: stack guard page: 0000 [#1] SMP KASAN NOPTI
    CPU: 0 UID: 0 PID: 5322 Comm: syz.0.0 Not tainted 6.16.0-rc4-syzkaller #0 PREEMPT(full)
    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
    RIP: 0010:clip_push+0x5/0x720 net/atm/clip.c:191
    Code: e0 8f aa 8c e8 1c ad 5b fa eb ae 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 55 <41> 57 41 56 41 55 41 54 53 48 83 ec 20 48 89 f3 49 89 fd 48 bd 00
    RSP: 0018:ffffc9000d670000 EFLAGS: 00010246
    RAX: 1ffff1100235a4a5 RBX: ffff888011ad2508 RCX: ffff8880003c0000
    RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff888037f01000
    RBP: dffffc0000000000 R08: ffffffff8fa104f7 R09: 1ffffffff1f4209e
    R10: dffffc0000000000 R11: ffffffff8a99b300 R12: ffffffff8a99b300
    R13: ffff888037f01000 R14: ffff888011ad2500 R15: ffff888037f01578
    FS:  000055557ab6d500(0000) GS:ffff88808d250000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: ffffc9000d66fff8 CR3: 0000000043172000 CR4: 0000000000352ef0
    Call Trace:
     <TASK>
     clip_push+0x6dc/0x720 net/atm/clip.c:200
     clip_push+0x6dc/0x720 net/atm/clip.c:200
     clip_push+0x6dc/0x720 net/atm/clip.c:200
    ...
     clip_push+0x6dc/0x720 net/atm/clip.c:200
     clip_push+0x6dc/0x720 net/atm/clip.c:200
     clip_push+0x6dc/0x720 net/atm/clip.c:200
     vcc_destroy_socket net/atm/common.c:183 [inline]
     vcc_release+0x157/0x460 net/atm/common.c:205
     __sock_release net/socket.c:647 [inline]
     sock_close+0xc0/0x240 net/socket.c:1391
     __fput+0x449/0xa70 fs/file_table.c:465
     task_work_run+0x1d1/0x260 kernel/task_work.c:227
     resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
     exit_to_user_mode_loop+0xec/0x110 kernel/entry/common.c:114
     exit_to_user_mode_prepare include/linux/entry-common.h:330 [inline]
     syscall_exit_to_user_mode_work include/linux/entry-common.h:414 [inline]
     syscall_exit_to_user_mode include/linux/entry-common.h:449 [inline]
     do_syscall_64+0x2bd/0x3b0 arch/x86/entry/syscall_64.c:100
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    RIP: 0033:0x7ff31c98e929
    Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
    RSP: 002b:00007fffb5aa1f78 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
    RAX: 0000000000000000 RBX: 0000000000012747 RCX: 00007ff31c98e929
    RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
    RBP: 00007ff31cbb7ba0 R08: 0000000000000001 R09: 0000000db5aa226f
    R10: 00007ff31c7ff030 R11: 0000000000000246 R12: 00007ff31cbb608c
    R13: 00007ff31cbb6080 R14: ffffffffffffffff R15: 00007fffb5aa2090
     </TASK>
    Modules linked in:
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=2371d94d248d126c1eb1
    Signed-off-by: Kuniyuki Iwashima <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

atm: clip: Fix memory leak of struct clip_vcc. [+ + +]
Author: Kuniyuki Iwashima <[email protected]>
Date:   Fri Jul 4 06:23:52 2025 +0000

    atm: clip: Fix memory leak of struct clip_vcc.
    
    [ Upstream commit 62dba28275a9a3104d4e33595c7b3328d4032d8d ]
    
    ioctl(ATMARP_MKIP) allocates struct clip_vcc and set it to
    vcc->user_back.
    
    The code assumes that vcc_destroy_socket() passes NULL skb
    to vcc->push() when the socket is close()d, and then clip_push()
    frees clip_vcc.
    
    However, ioctl(ATMARPD_CTRL) sets NULL to vcc->push() in
    atm_init_atmarp(), resulting in memory leak.
    
    Let's serialise two ioctl() by lock_sock() and check vcc->push()
    in atm_init_atmarp() to prevent memleak.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Kuniyuki Iwashima <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

atm: clip: Fix NULL pointer dereference in vcc_sendmsg() [+ + +]
Author: Yue Haibing <[email protected]>
Date:   Sat Jul 5 16:52:28 2025 +0800

    atm: clip: Fix NULL pointer dereference in vcc_sendmsg()
    
    [ Upstream commit 22fc46cea91df3dce140a7dc6847c6fcf0354505 ]
    
    atmarpd_dev_ops does not implement the send method, which may cause crash
    as bellow.
    
    BUG: kernel NULL pointer dereference, address: 0000000000000000
    PGD 0 P4D 0
    Oops: Oops: 0010 [#1] SMP KASAN NOPTI
    CPU: 0 UID: 0 PID: 5324 Comm: syz.0.0 Not tainted 6.15.0-rc6-syzkaller-00346-g5723cc3450bc #0 PREEMPT(full)
    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
    RIP: 0010:0x0
    Code: Unable to access opcode bytes at 0xffffffffffffffd6.
    RSP: 0018:ffffc9000d3cf778 EFLAGS: 00010246
    RAX: 1ffffffff1910dd1 RBX: 00000000000000c0 RCX: dffffc0000000000
    RDX: ffffc9000dc82000 RSI: ffff88803e4c4640 RDI: ffff888052cd0000
    RBP: ffffc9000d3cf8d0 R08: ffff888052c9143f R09: 1ffff1100a592287
    R10: dffffc0000000000 R11: 0000000000000000 R12: 1ffff92001a79f00
    R13: ffff888052cd0000 R14: ffff88803e4c4640 R15: ffffffff8c886e88
    FS:  00007fbc762566c0(0000) GS:ffff88808d6c2000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: ffffffffffffffd6 CR3: 0000000041f1b000 CR4: 0000000000352ef0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
     <TASK>
     vcc_sendmsg+0xa10/0xc50 net/atm/common.c:644
     sock_sendmsg_nosec net/socket.c:712 [inline]
     __sock_sendmsg+0x219/0x270 net/socket.c:727
     ____sys_sendmsg+0x52d/0x830 net/socket.c:2566
     ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2620
     __sys_sendmmsg+0x227/0x430 net/socket.c:2709
     __do_sys_sendmmsg net/socket.c:2736 [inline]
     __se_sys_sendmmsg net/socket.c:2733 [inline]
     __x64_sys_sendmmsg+0xa0/0xc0 net/socket.c:2733
     do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
     do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/all/[email protected]/T
    Signed-off-by: Yue Haibing <[email protected]>
    Reviewed-by: Kuniyuki Iwashima <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

atm: clip: Fix potential null-ptr-deref in to_atmarpd(). [+ + +]
Author: Kuniyuki Iwashima <[email protected]>
Date:   Fri Jul 4 06:23:51 2025 +0000

    atm: clip: Fix potential null-ptr-deref in to_atmarpd().
    
    [ Upstream commit 706cc36477139c1616a9b2b96610a8bb520b7119 ]
    
    atmarpd is protected by RTNL since commit f3a0592b37b8 ("[ATM]: clip
    causes unregister hang").
    
    However, it is not enough because to_atmarpd() is called without RTNL,
    especially clip_neigh_solicit() / neigh_ops->solicit() is unsleepable.
    
    Also, there is no RTNL dependency around atmarpd.
    
    Let's use a private mutex and RCU to protect access to atmarpd in
    to_atmarpd().
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Kuniyuki Iwashima <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

atm: idt77252: Add missing `dma_map_error()` [+ + +]
Author: Thomas Fourier <[email protected]>
Date:   Tue Jun 24 08:41:47 2025 +0200

    atm: idt77252: Add missing `dma_map_error()`
    
    [ Upstream commit c4890963350dcf4e9a909bae23665921fba4ad27 ]
    
    The DMA map functions can fail and should be tested for errors.
    
    Signed-off-by: Thomas Fourier <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
Bluetooth: HCI: Set extended advertising data synchronously [+ + +]
Author: Christian Eggers <[email protected]>
Date:   Fri Jun 27 09:05:08 2025 +0200

    Bluetooth: HCI: Set extended advertising data synchronously
    
    commit 89fb8acc38852116d38d721ad394aad7f2871670 upstream.
    
    Currently, for controllers with extended advertising, the advertising
    data is set in the asynchronous response handler for extended
    adverstising params. As most advertising settings are performed in a
    synchronous context, the (asynchronous) setting of the advertising data
    is done too late (after enabling the advertising).
    
    Move setting of adverstising data from asynchronous response handler
    into synchronous context to fix ordering of HCI commands.
    
    Signed-off-by: Christian Eggers <[email protected]>
    Fixes: a0fb3726ba55 ("Bluetooth: Use Set ext adv/scan rsp data if controller supports")
    Cc: [email protected]
    v2: https://lore.kernel.org/linux-bluetooth/[email protected]/
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    [ This patch deviates from the upstream version because 3 functions in
      hci_sync.c (hci_set_ext_adv_data_sync, hci_set_adv_data_sync and
      hci_update_adv_data_sync) had to be moved up within the file. The
      content of these functions differs between 6.6 and newer kernels. ]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: hci_event: Fix not marking Broadcast Sink BIS as connected [+ + +]
Author: Luiz Augusto von Dentz <[email protected]>
Date:   Fri Jun 27 11:19:02 2025 -0400

    Bluetooth: hci_event: Fix not marking Broadcast Sink BIS as connected
    
    [ Upstream commit c7349772c268ec3c91d83cbfbbcf63f1bd7c256c ]
    
    Upon receiving HCI_EVT_LE_BIG_SYNC_ESTABLISHED with status 0x00
    (success) the corresponding BIS hci_conn state shall be set to
    BT_CONNECTED otherwise they will be left with BT_OPEN which is invalid
    at that point, also create the debugfs and sysfs entries following the
    same logic as the likes of Broadcast Source BIS and CIS connections.
    
    Fixes: f777d8827817 ("Bluetooth: ISO: Notify user space about failed bis connections")
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

Bluetooth: hci_sync: Fix not disabling advertising instance [+ + +]
Author: Luiz Augusto von Dentz <[email protected]>
Date:   Fri Jun 27 12:31:33 2025 -0400

    Bluetooth: hci_sync: Fix not disabling advertising instance
    
    [ Upstream commit ef9675b0ef030d135413e8638989f3a7d1f3217a ]
    
    As the code comments on hci_setup_ext_adv_instance_sync suggests the
    advertising instance needs to be disabled in order to update its
    parameters, but it was wrongly checking that !adv->pending.
    
    Fixes: cba6b758711c ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 2")
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
bnxt_en: Fix DCB ETS validation [+ + +]
Author: Shravya KN <[email protected]>
Date:   Thu Jul 10 14:39:36 2025 -0700

    bnxt_en: Fix DCB ETS validation
    
    [ Upstream commit b74c2a2e9cc471e847abd87e50a2354c07e02040 ]
    
    In bnxt_ets_validate(), the code incorrectly loops over all possible
    traffic classes to check and add the ETS settings.  Fix it to loop
    over the configured traffic classes only.
    
    The unconfigured traffic classes will default to TSA_ETS with 0
    bandwidth.  Looping over these unconfigured traffic classes may
    cause the validation to fail and trigger this error message:
    
    "rejecting ETS config starving a TC\n"
    
    The .ieee_setets() will then fail.
    
    Fixes: 7df4ae9fe855 ("bnxt_en: Implement DCBNL to support host-based DCBX.")
    Reviewed-by: Sreekanth Reddy <[email protected]>
    Signed-off-by: Shravya KN <[email protected]>
    Signed-off-by: Michael Chan <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

bnxt_en: Set DMA unmap len correctly for XDP_REDIRECT [+ + +]
Author: Somnath Kotur <[email protected]>
Date:   Thu Jul 10 14:39:38 2025 -0700

    bnxt_en: Set DMA unmap len correctly for XDP_REDIRECT
    
    [ Upstream commit 3cdf199d4755d477972ee87110b2aebc88b3cfad ]
    
    When transmitting an XDP_REDIRECT packet, call dma_unmap_len_set()
    with the proper length instead of 0.  This bug triggers this warning
    on a system with IOMMU enabled:
    
    WARNING: CPU: 36 PID: 0 at drivers/iommu/dma-iommu.c:842 __iommu_dma_unmap+0x159/0x170
    RIP: 0010:__iommu_dma_unmap+0x159/0x170
    Code: a8 00 00 00 00 48 c7 45 b0 00 00 00 00 48 c7 45 c8 00 00 00 00 48 c7 45 a0 ff ff ff ff 4c 89 45
    b8 4c 89 45 c0 e9 77 ff ff ff <0f> 0b e9 60 ff ff ff e8 8b bf 6a 00 66 66 2e 0f 1f 84 00 00 00 00
    RSP: 0018:ff22d31181150c88 EFLAGS: 00010206
    RAX: 0000000000002000 RBX: 00000000e13a0000 RCX: 0000000000000000
    RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
    RBP: ff22d31181150cf0 R08: ff22d31181150ca8 R09: 0000000000000000
    R10: 0000000000000000 R11: ff22d311d36c9d80 R12: 0000000000001000
    R13: ff13544d10645010 R14: ff22d31181150c90 R15: ff13544d0b2bac00
    FS: 0000000000000000(0000) GS:ff13550908a00000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00005be909dacff8 CR3: 0008000173408003 CR4: 0000000000f71ef0
    PKRU: 55555554
    Call Trace:
    <IRQ>
    ? show_regs+0x6d/0x80
    ? __warn+0x89/0x160
    ? __iommu_dma_unmap+0x159/0x170
    ? report_bug+0x17e/0x1b0
    ? handle_bug+0x46/0x90
    ? exc_invalid_op+0x18/0x80
    ? asm_exc_invalid_op+0x1b/0x20
    ? __iommu_dma_unmap+0x159/0x170
    ? __iommu_dma_unmap+0xb3/0x170
    iommu_dma_unmap_page+0x4f/0x100
    dma_unmap_page_attrs+0x52/0x220
    ? srso_alias_return_thunk+0x5/0xfbef5
    ? xdp_return_frame+0x2e/0xd0
    bnxt_tx_int_xdp+0xdf/0x440 [bnxt_en]
    __bnxt_poll_work_done+0x81/0x1e0 [bnxt_en]
    bnxt_poll+0xd3/0x1e0 [bnxt_en]
    
    Fixes: f18c2b77b2e4 ("bnxt_en: optimized XDP_REDIRECT support")
    Signed-off-by: Somnath Kotur <[email protected]>
    Signed-off-by: Michael Chan <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
bpf: Adjust free target to avoid global starvation of LRU map [+ + +]
Author: Willem de Bruijn <[email protected]>
Date:   Wed Jun 18 17:57:40 2025 -0400

    bpf: Adjust free target to avoid global starvation of LRU map
    
    [ Upstream commit d4adf1c9ee7722545450608bcb095fb31512f0c6 ]
    
    BPF_MAP_TYPE_LRU_HASH can recycle most recent elements well before the
    map is full, due to percpu reservations and force shrink before
    neighbor stealing. Once a CPU is unable to borrow from the global map,
    it will once steal one elem from a neighbor and after that each time
    flush this one element to the global list and immediately recycle it.
    
    Batch value LOCAL_FREE_TARGET (128) will exhaust a 10K element map
    with 79 CPUs. CPU 79 will observe this behavior even while its
    neighbors hold 78 * 127 + 1 * 15 == 9921 free elements (99%).
    
    CPUs need not be active concurrently. The issue can appear with
    affinity migration, e.g., irqbalance. Each CPU can reserve and then
    hold onto its 128 elements indefinitely.
    
    Avoid global list exhaustion by limiting aggregate percpu caches to
    half of map size, by adjusting LOCAL_FREE_TARGET based on cpu count.
    This change has no effect on sufficiently large tables.
    
    Similar to LOCAL_NR_SCANS and lru->nr_scans, introduce a map variable
    lru->free_target. The extra field fits in a hole in struct bpf_lru.
    The cacheline is already warm where read in the hot path. The field is
    only accessed with the lru lock held.
    
    Tested-by: Anton Protopopov <[email protected]>
    Signed-off-by: Willem de Bruijn <[email protected]>
    Acked-by: Stanislav Fomichev <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
btrfs: fix assertion when building free space tree [+ + +]
Author: Filipe Manana <[email protected]>
Date:   Thu Jun 5 20:51:03 2025 +0100

    btrfs: fix assertion when building free space tree
    
    [ Upstream commit 1961d20f6fa8903266ed9bd77c691924c22c8f02 ]
    
    When building the free space tree with the block group tree feature
    enabled, we can hit an assertion failure like this:
    
      BTRFS info (device loop0 state M): rebuilding free space tree
      assertion failed: ret == 0, in fs/btrfs/free-space-tree.c:1102
      ------------[ cut here ]------------
      kernel BUG at fs/btrfs/free-space-tree.c:1102!
      Internal error: Oops - BUG: 00000000f2000800 [#1]  SMP
      Modules linked in:
      CPU: 1 UID: 0 PID: 6592 Comm: syz-executor322 Not tainted 6.15.0-rc7-syzkaller-gd7fa1af5b33e #0 PREEMPT
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
      pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      pc : populate_free_space_tree+0x514/0x518 fs/btrfs/free-space-tree.c:1102
      lr : populate_free_space_tree+0x514/0x518 fs/btrfs/free-space-tree.c:1102
      sp : ffff8000a4ce7600
      x29: ffff8000a4ce76e0 x28: ffff0000c9bc6000 x27: ffff0000ddfff3d8
      x26: ffff0000ddfff378 x25: dfff800000000000 x24: 0000000000000001
      x23: ffff8000a4ce7660 x22: ffff70001499cecc x21: ffff0000e1d8c160
      x20: ffff0000e1cb7800 x19: ffff0000e1d8c0b0 x18: 00000000ffffffff
      x17: ffff800092f39000 x16: ffff80008ad27e48 x15: ffff700011e740c0
      x14: 1ffff00011e740c0 x13: 0000000000000004 x12: ffffffffffffffff
      x11: ffff700011e740c0 x10: 0000000000ff0100 x9 : 94ef24f55d2dbc00
      x8 : 94ef24f55d2dbc00 x7 : 0000000000000001 x6 : 0000000000000001
      x5 : ffff8000a4ce6f98 x4 : ffff80008f415ba0 x3 : ffff800080548ef0
      x2 : 0000000000000000 x1 : 0000000100000000 x0 : 000000000000003e
      Call trace:
       populate_free_space_tree+0x514/0x518 fs/btrfs/free-space-tree.c:1102 (P)
       btrfs_rebuild_free_space_tree+0x14c/0x54c fs/btrfs/free-space-tree.c:1337
       btrfs_start_pre_rw_mount+0xa78/0xe10 fs/btrfs/disk-io.c:3074
       btrfs_remount_rw fs/btrfs/super.c:1319 [inline]
       btrfs_reconfigure+0x828/0x2418 fs/btrfs/super.c:1543
       reconfigure_super+0x1d4/0x6f0 fs/super.c:1083
       do_remount fs/namespace.c:3365 [inline]
       path_mount+0xb34/0xde0 fs/namespace.c:4200
       do_mount fs/namespace.c:4221 [inline]
       __do_sys_mount fs/namespace.c:4432 [inline]
       __se_sys_mount fs/namespace.c:4409 [inline]
       __arm64_sys_mount+0x3e8/0x468 fs/namespace.c:4409
       __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49
       el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132
       do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151
       el0_svc+0x58/0x17c arch/arm64/kernel/entry-common.c:767
       el0t_64_sync_handler+0x78/0x108 arch/arm64/kernel/entry-common.c:786
       el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600
      Code: f0047182 91178042 528089c3 9771d47b (d4210000)
      ---[ end trace 0000000000000000 ]---
    
    This happens because we are processing an empty block group, which has
    no extents allocated from it, there are no items for this block group,
    including the block group item since block group items are stored in a
    dedicated tree when using the block group tree feature. It also means
    this is the block group with the highest start offset, so there are no
    higher keys in the extent root, hence btrfs_search_slot_for_read()
    returns 1 (no higher key found).
    
    Fix this by asserting 'ret' is 0 only if the block group tree feature
    is not enabled, in which case we should find a block group item for
    the block group since it's stored in the extent root and block group
    item keys are greater than extent item keys (the value for
    BTRFS_BLOCK_GROUP_ITEM_KEY is 192 and for BTRFS_EXTENT_ITEM_KEY and
    BTRFS_METADATA_ITEM_KEY the values are 168 and 169 respectively).
    In case 'ret' is 1, we just need to add a record to the free space
    tree which spans the whole block group, and we can achieve this by
    making 'ret == 0' as the while loop's condition.
    
    Reported-by: [email protected]
    Link: https://lore.kernel.org/linux-btrfs/[email protected]/
    Reviewed-by: Qu Wenruo <[email protected]>
    Signed-off-by: Filipe Manana <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

btrfs: fix inode lookup error handling during log replay [+ + +]
Author: Filipe Manana <[email protected]>
Date:   Sat Jul 12 00:27:22 2025 -0400

    btrfs: fix inode lookup error handling during log replay
    
    [ Upstream commit 5f61b961599acbd2bed028d3089105a1f7d224b8 ]
    
    When replaying log trees we use read_one_inode() to get an inode, which is
    just a wrapper around btrfs_iget_logging(), which in turn is a wrapper for
    btrfs_iget(). But read_one_inode() always returns NULL for any error
    that btrfs_iget_logging() / btrfs_iget() may return and this is a problem
    because:
    
    1) In many callers of read_one_inode() we convert the NULL into -EIO,
       which is not accurate since btrfs_iget() may return -ENOMEM and -ENOENT
       for example, besides -EIO and other errors. So during log replay we
       may end up reporting a false -EIO, which is confusing since we may
       not have had any IO error at all;
    
    2) When replaying directory deletes, at replay_dir_deletes(), we assume
       the NULL returned from read_one_inode() means that the inode doesn't
       exist and then proceed as if no error had happened. This is wrong
       because unless btrfs_iget() returned ERR_PTR(-ENOENT), we had an
       actual error and the target inode may exist in the target subvolume
       root - this may later result in the log replay code failing at a
       later stage (if we are "lucky") or succeed but leaving some
       inconsistency in the filesystem.
    
    So fix this by not ignoring errors from btrfs_iget_logging() and as
    a consequence remove the read_one_inode() wrapper and just use
    btrfs_iget_logging() directly. Also since btrfs_iget_logging() is
    supposed to be called only against subvolume roots, just like
    read_one_inode() which had a comment about it, add an assertion to
    btrfs_iget_logging() to check that the target root corresponds to a
    subvolume root.
    
    Fixes: 5d4f98a28c7d ("Btrfs: Mixed back reference  (FORWARD ROLLING FORMAT CHANGE)")
    Reviewed-by: Johannes Thumshirn <[email protected]>
    Reviewed-by: Qu Wenruo <[email protected]>
    Signed-off-by: Filipe Manana <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

btrfs: remove noinline from btrfs_update_inode() [+ + +]
Author: Filipe Manana <[email protected]>
Date:   Fri Sep 22 11:37:20 2023 +0100

    btrfs: remove noinline from btrfs_update_inode()
    
    [ Upstream commit cddaaacca9339d2f13599a822dc2f68be71d2e0d ]
    
    The noinline attribute of btrfs_update_inode() is pointless as the
    function is exported and widely used, so remove it.
    
    Reviewed-by: Qu Wenruo <[email protected]>
    Signed-off-by: Filipe Manana <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Stable-dep-of: 5f61b961599a ("btrfs: fix inode lookup error handling during log replay")
    Signed-off-by: Sasha Levin <[email protected]>

btrfs: remove redundant root argument from btrfs_update_inode_fallback() [+ + +]
Author: Filipe Manana <[email protected]>
Date:   Fri Sep 22 11:37:21 2023 +0100

    btrfs: remove redundant root argument from btrfs_update_inode_fallback()
    
    [ Upstream commit 0a5d0dc55fcb15da016fa28d27bf50ca7f17ec11 ]
    
    The root argument for btrfs_update_inode_fallback() always matches the
    root of the given inode, so remove the root argument and get it from the
    inode argument.
    
    Reviewed-by: Qu Wenruo <[email protected]>
    Signed-off-by: Filipe Manana <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Stable-dep-of: 5f61b961599a ("btrfs: fix inode lookup error handling during log replay")
    Signed-off-by: Sasha Levin <[email protected]>

btrfs: remove redundant root argument from fixup_inode_link_count() [+ + +]
Author: Filipe Manana <[email protected]>
Date:   Fri Sep 22 11:37:26 2023 +0100

    btrfs: remove redundant root argument from fixup_inode_link_count()
    
    [ Upstream commit 8befc61cbba2d4567122d400542da8900a352971 ]
    
    The root argument for fixup_inode_link_count() always matches the root of
    the given inode, so remove the root argument and get it from the inode
    argument. This also applies to the helpers count_inode_extrefs() and
    count_inode_refs() used by fixup_inode_link_count() - they don't need the
    root argument, as it always matches the root of the inode passed to them.
    
    Reviewed-by: Qu Wenruo <[email protected]>
    Signed-off-by: Filipe Manana <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Stable-dep-of: 5f61b961599a ("btrfs: fix inode lookup error handling during log replay")
    Signed-off-by: Sasha Levin <[email protected]>

btrfs: return a btrfs_inode from btrfs_iget_logging() [+ + +]
Author: Filipe Manana <[email protected]>
Date:   Thu Mar 6 16:42:28 2025 +0000

    btrfs: return a btrfs_inode from btrfs_iget_logging()
    
    [ Upstream commit a488d8ac2c4d96ecc7da59bb35a573277204ac6b ]
    
    All callers of btrfs_iget_logging() are interested in the btrfs_inode
    structure rather than the VFS inode, so make btrfs_iget_logging() return
    the btrfs_inode instead, avoiding lots of BTRFS_I() calls.
    
    Signed-off-by: Filipe Manana <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Stable-dep-of: 5f61b961599a ("btrfs: fix inode lookup error handling during log replay")
    Signed-off-by: Sasha Levin <[email protected]>

 
can: m_can: m_can_handle_lost_msg(): downgrade msg lost in rx message to debug level [+ + +]
Author: Sean Nyekjaer <[email protected]>
Date:   Fri Jul 11 12:12:02 2025 +0200

    can: m_can: m_can_handle_lost_msg(): downgrade msg lost in rx message to debug level
    
    [ Upstream commit 58805e9cbc6f6a28f35d90e740956e983a0e036e ]
    
    Downgrade the "msg lost in rx" message to debug level, to prevent
    flooding the kernel log with error messages.
    
    Fixes: e0d1f4816f2a ("can: m_can: add Bosch M_CAN controller support")
    Reviewed-by: Vincent Mailhol <[email protected]>
    Signed-off-by: Sean Nyekjaer <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    [mkl: enhance commit message]
    Signed-off-by: Marc Kleine-Budde <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
cifs: all initializations for tcon should happen in tcon_info_alloc [+ + +]
Author: Shyam Prasad N <[email protected]>
Date:   Mon Jun 30 23:09:34 2025 +0530

    cifs: all initializations for tcon should happen in tcon_info_alloc
    
    [ Upstream commit 74ebd02163fde05baa23129e06dde4b8f0f2377a ]
    
    Today, a few work structs inside tcon are initialized inside
    cifs_get_tcon and not in tcon_info_alloc. As a result, if a tcon
    is obtained from tcon_info_alloc, but not called as a part of
    cifs_get_tcon, we may trip over.
    
    Cc: <[email protected]>
    Signed-off-by: Shyam Prasad N <[email protected]>
    Reviewed-by: Paulo Alcantara (Red Hat) <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
crypto: ecdsa - Harden against integer overflows in DIV_ROUND_UP() [+ + +]
Author: Lukas Wunner <[email protected]>
Date:   Sun Feb 2 20:00:52 2025 +0100

    crypto: ecdsa - Harden against integer overflows in DIV_ROUND_UP()
    
    commit b16510a530d1e6ab9683f04f8fb34f2e0f538275 upstream.
    
    Herbert notes that DIV_ROUND_UP() may overflow unnecessarily if an ecdsa
    implementation's ->key_size() callback returns an unusually large value.
    Herbert instead suggests (for a division by 8):
    
      X / 8 + !!(X & 7)
    
    Based on this formula, introduce a generic DIV_ROUND_UP_POW2() macro and
    use it in lieu of DIV_ROUND_UP() for ->key_size() return values.
    
    Additionally, use the macro in ecc_digits_from_bytes(), whose "nbytes"
    parameter is a ->key_size() return value in some instances, or a
    user-specified ASN.1 length in the case of ecdsa_get_signature_rs().
    
    Link: https://lore.kernel.org/r/[email protected]/
    Signed-off-by: Lukas Wunner <[email protected]>
    Signed-off-by: Lukas Wunner <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/exynos: exynos7_drm_decon: add vblank check in IRQ handling [+ + +]
Author: Kaustabh Chakraborty <[email protected]>
Date:   Fri Jun 27 00:50:30 2025 +0530

    drm/exynos: exynos7_drm_decon: add vblank check in IRQ handling
    
    commit b846350aa272de99bf6fecfa6b08e64ebfb13173 upstream.
    
    If there's support for another console device (such as a TTY serial),
    the kernel occasionally panics during boot. The panic message and a
    relevant snippet of the call stack is as follows:
    
      Unable to handle kernel NULL pointer dereference at virtual address 000000000000000
      Call trace:
        drm_crtc_handle_vblank+0x10/0x30 (P)
        decon_irq_handler+0x88/0xb4
        [...]
    
    Otherwise, the panics don't happen. This indicates that it's some sort
    of race condition.
    
    Add a check to validate if the drm device can handle vblanks before
    calling drm_crtc_handle_vblank() to avoid this.
    
    Cc: [email protected]
    Fixes: 96976c3d9aff ("drm/exynos: Add DECON driver")
    Signed-off-by: Kaustabh Chakraborty <[email protected]>
    Signed-off-by: Inki Dae <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/framebuffer: Acquire internal references on GEM handles [+ + +]
Author: Thomas Zimmermann <[email protected]>
Date:   Mon Jul 7 15:11:55 2025 +0200

    drm/framebuffer: Acquire internal references on GEM handles
    
    commit f6bfc9afc7510cb5e6fbe0a17c507917b0120280 upstream.
    
    Acquire GEM handles in drm_framebuffer_init() and release them in
    the corresponding drm_framebuffer_cleanup(). Ties the handle's
    lifetime to the framebuffer. Not all GEM buffer objects have GEM
    handles. If not set, no refcounting takes place. This is the case
    for some fbdev emulation. This is not a problem as these GEM objects
    do not use dma-bufs and drivers will not release them while fbdev
    emulation is running. Framebuffer flags keep a bit per color plane
    of which the framebuffer holds a GEM handle reference.
    
    As all drivers use drm_framebuffer_init(), they will now all hold
    dma-buf references as fixed in commit 5307dce878d4 ("drm/gem: Acquire
    references on GEM handles for framebuffers").
    
    In the GEM framebuffer helpers, restore the original ref counting
    on buffer objects. As the helpers for handle refcounting are now
    no longer called from outside the DRM core, unexport the symbols.
    
    v3:
    - don't mix internal flags with mode flags (Christian)
    v2:
    - track framebuffer handle refs by flag
    - drop gma500 cleanup (Christian)
    
    Signed-off-by: Thomas Zimmermann <[email protected]>
    Fixes: 5307dce878d4 ("drm/gem: Acquire references on GEM handles for framebuffers")
    Reported-by: Bert Karwatzki <[email protected]>
    Closes: https://lore.kernel.org/dri-devel/[email protected]/
    Tested-by: Bert Karwatzki <[email protected]>
    Tested-by: Mario Limonciello <[email protected]>
    Tested-by: Borislav Petkov (AMD) <[email protected]>
    Cc: Thomas Zimmermann <[email protected]>
    Cc: Anusha Srivatsa <[email protected]>
    Cc: Christian König <[email protected]>
    Cc: Maarten Lankhorst <[email protected]>
    Cc: Maxime Ripard <[email protected]>
    Cc: Sumit Semwal <[email protected]>
    Cc: "Christian König" <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: <[email protected]>
    Reviewed-by: Christian König <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/gem: Acquire references on GEM handles for framebuffers [+ + +]
Author: Thomas Zimmermann <[email protected]>
Date:   Mon Jun 30 10:36:47 2025 +0200

    drm/gem: Acquire references on GEM handles for framebuffers
    
    commit 5307dce878d4126e1b375587318955bd019c3741 upstream.
    
    A GEM handle can be released while the GEM buffer object is attached
    to a DRM framebuffer. This leads to the release of the dma-buf backing
    the buffer object, if any. [1] Trying to use the framebuffer in further
    mode-setting operations leads to a segmentation fault. Most easily
    happens with driver that use shadow planes for vmap-ing the dma-buf
    during a page flip. An example is shown below.
    
    [  156.791968] ------------[ cut here ]------------
    [  156.796830] WARNING: CPU: 2 PID: 2255 at drivers/dma-buf/dma-buf.c:1527 dma_buf_vmap+0x224/0x430
    [...]
    [  156.942028] RIP: 0010:dma_buf_vmap+0x224/0x430
    [  157.043420] Call Trace:
    [  157.045898]  <TASK>
    [  157.048030]  ? show_trace_log_lvl+0x1af/0x2c0
    [  157.052436]  ? show_trace_log_lvl+0x1af/0x2c0
    [  157.056836]  ? show_trace_log_lvl+0x1af/0x2c0
    [  157.061253]  ? drm_gem_shmem_vmap+0x74/0x710
    [  157.065567]  ? dma_buf_vmap+0x224/0x430
    [  157.069446]  ? __warn.cold+0x58/0xe4
    [  157.073061]  ? dma_buf_vmap+0x224/0x430
    [  157.077111]  ? report_bug+0x1dd/0x390
    [  157.080842]  ? handle_bug+0x5e/0xa0
    [  157.084389]  ? exc_invalid_op+0x14/0x50
    [  157.088291]  ? asm_exc_invalid_op+0x16/0x20
    [  157.092548]  ? dma_buf_vmap+0x224/0x430
    [  157.096663]  ? dma_resv_get_singleton+0x6d/0x230
    [  157.101341]  ? __pfx_dma_buf_vmap+0x10/0x10
    [  157.105588]  ? __pfx_dma_resv_get_singleton+0x10/0x10
    [  157.110697]  drm_gem_shmem_vmap+0x74/0x710
    [  157.114866]  drm_gem_vmap+0xa9/0x1b0
    [  157.118763]  drm_gem_vmap_unlocked+0x46/0xa0
    [  157.123086]  drm_gem_fb_vmap+0xab/0x300
    [  157.126979]  drm_atomic_helper_prepare_planes.part.0+0x487/0xb10
    [  157.133032]  ? lockdep_init_map_type+0x19d/0x880
    [  157.137701]  drm_atomic_helper_commit+0x13d/0x2e0
    [  157.142671]  ? drm_atomic_nonblocking_commit+0xa0/0x180
    [  157.147988]  drm_mode_atomic_ioctl+0x766/0xe40
    [...]
    [  157.346424] ---[ end trace 0000000000000000 ]---
    
    Acquiring GEM handles for the framebuffer's GEM buffer objects prevents
    this from happening. The framebuffer's cleanup later puts the handle
    references.
    
    Commit 1a148af06000 ("drm/gem-shmem: Use dma_buf from GEM object
    instance") triggers the segmentation fault easily by using the dma-buf
    field more widely. The underlying issue with reference counting has
    been present before.
    
    v2:
    - acquire the handle instead of the BO (Christian)
    - fix comment style (Christian)
    - drop the Fixes tag (Christian)
    - rename err_ gotos
    - add missing Link tag
    
    Suggested-by: Christian König <[email protected]>
    Signed-off-by: Thomas Zimmermann <[email protected]>
    Link: https://elixir.bootlin.com/linux/v6.15/source/drivers/gpu/drm/drm_gem.c#L241 # [1]
    Cc: Thomas Zimmermann <[email protected]>
    Cc: Anusha Srivatsa <[email protected]>
    Cc: Christian König <[email protected]>
    Cc: Maarten Lankhorst <[email protected]>
    Cc: Maxime Ripard <[email protected]>
    Cc: Sumit Semwal <[email protected]>
    Cc: "Christian König" <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: <[email protected]>
    Reviewed-by: Christian König <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/gem: Fix race in drm_gem_handle_create_tail() [+ + +]
Author: Simona Vetter <[email protected]>
Date:   Mon Jul 7 17:18:13 2025 +0200

    drm/gem: Fix race in drm_gem_handle_create_tail()
    
    commit bd46cece51a36ef088f22ef0416ac13b0a46d5b0 upstream.
    
    Object creation is a careful dance where we must guarantee that the
    object is fully constructed before it is visible to other threads, and
    GEM buffer objects are no difference.
    
    Final publishing happens by calling drm_gem_handle_create(). After
    that the only allowed thing to do is call drm_gem_object_put() because
    a concurrent call to the GEM_CLOSE ioctl with a correctly guessed id
    (which is trivial since we have a linear allocator) can already tear
    down the object again.
    
    Luckily most drivers get this right, the very few exceptions I've
    pinged the relevant maintainers for. Unfortunately we also need
    drm_gem_handle_create() when creating additional handles for an
    already existing object (e.g. GETFB ioctl or the various bo import
    ioctl), and hence we cannot have a drm_gem_handle_create_and_put() as
    the only exported function to stop these issues from happening.
    
    Now unfortunately the implementation of drm_gem_handle_create() isn't
    living up to standards: It does correctly finishe object
    initialization at the global level, and hence is safe against a
    concurrent tear down. But it also sets up the file-private aspects of
    the handle, and that part goes wrong: We fully register the object in
    the drm_file.object_idr before calling drm_vma_node_allow() or
    obj->funcs->open, which opens up races against concurrent removal of
    that handle in drm_gem_handle_delete().
    
    Fix this with the usual two-stage approach of first reserving the
    handle id, and then only registering the object after we've completed
    the file-private setup.
    
    Jacek reported this with a testcase of concurrently calling GEM_CLOSE
    on a freshly-created object (which also destroys the object), but it
    should be possible to hit this with just additional handles created
    through import or GETFB without completed destroying the underlying
    object with the concurrent GEM_CLOSE ioctl calls.
    
    Note that the close-side of this race was fixed in f6cd7daecff5 ("drm:
    Release driver references to handle before making it available
    again"), which means a cool 9 years have passed until someone noticed
    that we need to make this symmetry or there's still gaps left :-/
    Without the 2-stage close approach we'd still have a race, therefore
    that's an integral part of this bugfix.
    
    More importantly, this means we can have NULL pointers behind
    allocated id in our drm_file.object_idr. We need to check for that
    now:
    
    - drm_gem_handle_delete() checks for ERR_OR_NULL already
    
    - drm_gem.c:object_lookup() also chekcs for NULL
    
    - drm_gem_release() should never be called if there's another thread
      still existing that could call into an IOCTL that creates a new
      handle, so cannot race. For paranoia I added a NULL check to
      drm_gem_object_release_handle() though.
    
    - most drivers (etnaviv, i915, msm) are find because they use
      idr_find(), which maps both ENOENT and NULL to NULL.
    
    - drivers using idr_for_each_entry() should also be fine, because
      idr_get_next does filter out NULL entries and continues the
      iteration.
    
    - The same holds for drm_show_memory_stats().
    
    v2: Use drm_WARN_ON (Thomas)
    
    Reported-by: Jacek Lawrynowicz <[email protected]>
    Tested-by: Jacek Lawrynowicz <[email protected]>
    Reviewed-by: Thomas Zimmermann <[email protected]>
    Cc: [email protected]
    Cc: Jacek Lawrynowicz <[email protected]>
    Cc: Maarten Lankhorst <[email protected]>
    Cc: Maxime Ripard <[email protected]>
    Cc: Thomas Zimmermann <[email protected]>
    Cc: David Airlie <[email protected]>
    Cc: Simona Vetter <[email protected]>
    Signed-off-by: Simona Vetter <[email protected]>
    Signed-off-by: Simona Vetter <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/sched: Increment job count before swapping tail spsc queue [+ + +]
Author: Matthew Brost <[email protected]>
Date:   Fri Jun 13 14:20:13 2025 -0700

    drm/sched: Increment job count before swapping tail spsc queue
    
    commit 8af39ec5cf2be522c8eb43a3d8005ed59e4daaee upstream.
    
    A small race exists between spsc_queue_push and the run-job worker, in
    which spsc_queue_push may return not-first while the run-job worker has
    already idled due to the job count being zero. If this race occurs, job
    scheduling stops, leading to hangs while waiting on the job’s DMA
    fences.
    
    Seal this race by incrementing the job count before appending to the
    SPSC queue.
    
    This race was observed on a drm-tip 6.16-rc1 build with the Xe driver in
    an SVM test case.
    
    Fixes: 1b1f42d8fde4 ("drm: move amd_gpu_scheduler into common location")
    Fixes: 27105db6c63a ("drm/amdgpu: Add SPSC queue to scheduler.")
    Cc: [email protected]
    Signed-off-by: Matthew Brost <[email protected]>
    Reviewed-by: Jonathan Cavitt <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/tegra: nvdec: Fix dma_alloc_coherent error check [+ + +]
Author: Mikko Perttunen <[email protected]>
Date:   Wed Jul 2 11:08:07 2025 +0900

    drm/tegra: nvdec: Fix dma_alloc_coherent error check
    
    [ Upstream commit 44306a684cd1699b8562a54945ddc43e2abc9eab ]
    
    Check for NULL return value with dma_alloc_coherent, in line with
    Robin's fix for vic.c in 'drm/tegra: vic: Fix DMA API misuse'.
    
    Fixes: 46f226c93d35 ("drm/tegra: Add NVDEC driver")
    Signed-off-by: Mikko Perttunen <[email protected]>
    Signed-off-by: Thierry Reding <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/ttm: fix error handling in ttm_buffer_object_transfer [+ + +]
Author: Christian König <[email protected]>
Date:   Fri Jun 13 13:16:38 2025 +0200

    drm/ttm: fix error handling in ttm_buffer_object_transfer
    
    commit 97e000acf2e20a86a50a0ec8c2739f0846f37509 upstream.
    
    Unlocking the resv object was missing in the error path, additionally to
    that we should move over the resource only after the fence slot was
    reserved.
    
    Signed-off-by: Christian König <[email protected]>
    Reviewed-by: Matthew Brost <[email protected]>
    Fixes: c8d4c18bfbc4a ("dma-buf/drivers: make reserving a shared slot mandatory v4")
    Cc: <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
erofs: fix to add missing tracepoint in erofs_read_folio() [+ + +]
Author: Chao Yu <[email protected]>
Date:   Tue Jul 8 19:19:42 2025 +0800

    erofs: fix to add missing tracepoint in erofs_read_folio()
    
    commit 99f7619a77a0a2e3e2bcae676d0f301769167754 upstream.
    
    Commit 771c994ea51f ("erofs: convert all uncompressed cases to iomap")
    converts to use iomap interface, it removed trace_erofs_readpage()
    tracepoint in the meantime, let's add it back.
    
    Fixes: 771c994ea51f ("erofs: convert all uncompressed cases to iomap")
    Signed-off-by: Chao Yu <[email protected]>
    Reviewed-by: Gao Xiang <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Gao Xiang <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
eventpoll: don't decrement ep refcount while still holding the ep mutex [+ + +]
Author: Linus Torvalds <[email protected]>
Date:   Wed Jul 9 10:38:29 2025 -0700

    eventpoll: don't decrement ep refcount while still holding the ep mutex
    
    commit 8c2e52ebbe885c7eeaabd3b7ddcdc1246fc400d2 upstream.
    
    Jann Horn points out that epoll is decrementing the ep refcount and then
    doing a
    
        mutex_unlock(&ep->mtx);
    
    afterwards. That's very wrong, because it can lead to a use-after-free.
    
    That pattern is actually fine for the very last reference, because the
    code in question will delay the actual call to "ep_free(ep)" until after
    it has unlocked the mutex.
    
    But it's wrong for the much subtler "next to last" case when somebody
    *else* may also be dropping their reference and free the ep while we're
    still using the mutex.
    
    Note that this is true even if that other user is also using the same ep
    mutex: mutexes, unlike spinlocks, can not be used for object ownership,
    even if they guarantee mutual exclusion.
    
    A mutex "unlock" operation is not atomic, and as one user is still
    accessing the mutex as part of unlocking it, another user can come in
    and get the now released mutex and free the data structure while the
    first user is still cleaning up.
    
    See our mutex documentation in Documentation/locking/mutex-design.rst,
    in particular the section [1] about semantics:
    
            "mutex_unlock() may access the mutex structure even after it has
             internally released the lock already - so it's not safe for
             another context to acquire the mutex and assume that the
             mutex_unlock() context is not using the structure anymore"
    
    So if we drop our ep ref before the mutex unlock, but we weren't the
    last one, we may then unlock the mutex, another user comes in, drops
    _their_ reference and releases the 'ep' as it now has no users - all
    while the mutex_unlock() is still accessing it.
    
    Fix this by simply moving the ep refcount dropping to outside the mutex:
    the refcount itself is atomic, and doesn't need mutex protection (that's
    the whole _point_ of refcounts: unlike mutexes, they are inherently
    about object lifetimes).
    
    Reported-by: Jann Horn <[email protected]>
    Link: https://docs.kernel.org/locking/mutex-design.html#semantics [1]
    Cc: Alexander Viro <[email protected]>
    Cc: Christian Brauner <[email protected]>
    Cc: Jan Kara <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
 
Linux: fix proc_sys_compare() handling of in-lookup dentries [+ + +]
Author: Al Viro <[email protected]>
Date:   Mon Jun 30 02:52:13 2025 -0400

    fix proc_sys_compare() handling of in-lookup dentries
    
    [ Upstream commit b969f9614885c20f903e1d1f9445611daf161d6d ]
    
    There's one case where ->d_compare() can be called for an in-lookup
    dentry; usually that's nothing special from ->d_compare() point of
    view, but... proc_sys_compare() is weird.
    
    The thing is, /proc/sys subdirectories can look differently for
    different processes.  Up to and including having the same name
    resolve to different dentries - all of them hashed.
    
    The way it's done is ->d_compare() refusing to admit a match unless
    this dentry is supposed to be visible to this caller.  The information
    needed to discriminate between them is stored in inode; it is set
    during proc_sys_lookup() and until it's done d_splice_alias() we really
    can't tell who should that dentry be visible for.
    
    Normally there's no negative dentries in /proc/sys; we can run into
    a dying dentry in RCU dcache lookup, but those can be safely rejected.
    
    However, ->d_compare() is also called for in-lookup dentries, before
    they get positive - or hashed, for that matter.  In case of match
    we will wait until dentry leaves in-lookup state and repeat ->d_compare()
    afterwards.  In other words, the right behaviour is to treat the
    name match as sufficient for in-lookup dentries; if dentry is not
    for us, we'll see that when we recheck once proc_sys_lookup() is
    done with it.
    
    While we are at it, fix the misspelled READ_ONCE and WRITE_ONCE there.
    
    Fixes: d9171b934526 ("parallel lookups machinery, part 4 (and last)")
    Reported-by: NeilBrown <[email protected]>
    Reviewed-by: Christian Brauner <[email protected]>
    Reviewed-by: NeilBrown <[email protected]>
    Signed-off-by: Al Viro <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
gre: Fix IPv6 multicast route creation. [+ + +]
Author: Guillaume Nault <[email protected]>
Date:   Wed Jul 9 16:30:10 2025 +0200

    gre: Fix IPv6 multicast route creation.
    
    commit 4e914ef063de40397e25a025c70d9737a9e45a8c upstream.
    
    Use addrconf_add_dev() instead of ipv6_find_idev() in
    addrconf_gre_config() so that we don't just get the inet6_dev, but also
    install the default ff00::/8 multicast route.
    
    Before commit 3e6a0243ff00 ("gre: Fix again IPv6 link-local address
    generation."), the multicast route was created at the end of the
    function by addrconf_add_mroute(). But this code path is now only taken
    in one particular case (gre devices not bound to a local IP address and
    in EUI64 mode). For all other cases, the function exits early and
    addrconf_add_mroute() is not called anymore.
    
    Using addrconf_add_dev() instead of ipv6_find_idev() in
    addrconf_gre_config(), fixes the problem as it will create the default
    multicast route for all gre devices. This also brings
    addrconf_gre_config() a bit closer to the normal netdevice IPv6
    configuration code (addrconf_dev_config()).
    
    Cc: [email protected]
    Fixes: 3e6a0243ff00 ("gre: Fix again IPv6 link-local address generation.")
    Reported-by: Aiden Yang <[email protected]>
    Closes: https://lore.kernel.org/netdev/CANR=AhRM7YHHXVxJ4DmrTNMeuEOY87K2mLmo9KMed1JMr20p6g@mail.gmail.com/
    Reviewed-by: Gary Guo <[email protected]>
    Tested-by: Gary Guo <[email protected]>
    Signed-off-by: Guillaume Nault <[email protected]>
    Reviewed-by: Ido Schimmel <[email protected]>
    Link: https://patch.msgid.link/027a923dcb550ad115e6d93ee8bb7d310378bd01.1752070620.git.gnault@redhat.com
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
HID: Add IGNORE quirk for SMARTLINKTECHNOLOGY [+ + +]
Author: Zhang Heng <[email protected]>
Date:   Thu Jun 5 15:29:59 2025 +0800

    HID: Add IGNORE quirk for SMARTLINKTECHNOLOGY
    
    [ Upstream commit 1a8953f4f7746c6a515989774fe03047c522c613 ]
    
    MARTLINKTECHNOLOGY is a microphone device, when the HID interface in an
    audio device is requested to get specific report id, the following error
    may occur.
    
    [  562.939373] usb 1-1.4.1.2: new full-speed USB device number 21 using xhci_hcd
    [  563.104908] usb 1-1.4.1.2: New USB device found, idVendor=4c4a, idProduct=4155, bcdDevice= 1.00
    [  563.104910] usb 1-1.4.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  563.104911] usb 1-1.4.1.2: Product: USB Composite Device
    [  563.104912] usb 1-1.4.1.2: Manufacturer: SmartlinkTechnology
    [  563.104913] usb 1-1.4.1.2: SerialNumber: 20201111000001
    [  563.229499] input: SmartlinkTechnology USB Composite Device as /devices/pci0000:00/0000:00:07.1/0000:04:00.3/usb1/1-1/1-1.4/1-1.4.1/1-1.4.1.2/1-1.4.1.2:1.2/0003:4C4A:4155.000F/input/input35
    [  563.291505] hid-generic 0003:4C4A:4155.000F: input,hidraw2: USB HID v2.01 Keyboard [SmartlinkTechnology USB Composite Device] on usb-0000:04:00.3-1.4.1.2/input2
    [  563.291557] usbhid 1-1.4.1.2:1.3: couldn't find an input interrupt endpoint
    [  568.506654] usb 1-1.4.1.2: 1:1: usb_set_interface failed (-110)
    [  573.626656] usb 1-1.4.1.2: 1:1: usb_set_interface failed (-110)
    [  578.746657] usb 1-1.4.1.2: 1:1: usb_set_interface failed (-110)
    [  583.866655] usb 1-1.4.1.2: 1:1: usb_set_interface failed (-110)
    [  588.986657] usb 1-1.4.1.2: 1:1: usb_set_interface failed (-110)
    
    Ignore HID interface. The device is working properly.
    
    Signed-off-by: Zhang Heng <[email protected]>
    Signed-off-by: Jiri Kosina <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

HID: lenovo: Add support for ThinkPad X1 Tablet Thin Keyboard Gen2 [+ + +]
Author: Akira Inoue <[email protected]>
Date:   Thu Jun 12 13:34:38 2025 +0900

    HID: lenovo: Add support for ThinkPad X1 Tablet Thin Keyboard Gen2
    
    [ Upstream commit a8905238c3bbe13db90065ed74682418f23830c3 ]
    
    Add "Thinkpad X1 Tablet Gen 2 Keyboard" PID to hid-lenovo driver to fix trackpoint not working issue.
    
    Signed-off-by: Akira Inoue <[email protected]>
    Signed-off-by: Jiri Kosina <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

HID: quirks: Add quirk for 2 Chicony Electronics HP 5MP Cameras [+ + +]
Author: Chia-Lin Kao (AceLan) <[email protected]>
Date:   Tue May 6 13:50:15 2025 +0800

    HID: quirks: Add quirk for 2 Chicony Electronics HP 5MP Cameras
    
    [ Upstream commit 54bae4c17c11688339eb73a04fd24203bb6e7494 ]
    
    The Chicony Electronics HP 5MP Cameras (USB ID 04F2:B824 & 04F2:B82C)
    report a HID sensor interface that is not actually implemented.
    Attempting to access this non-functional sensor via iio_info causes
    system hangs as runtime PM tries to wake up an unresponsive sensor.
    
    Add these 2 devices to the HID ignore list since the sensor interface is
    non-functional by design and should not be exposed to userspace.
    
    Signed-off-by: Chia-Lin Kao (AceLan) <[email protected]>
    Signed-off-by: Jiri Kosina <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
ibmvnic: Fix hardcoded NUM_RX_STATS/NUM_TX_STATS with dynamic sizeof [+ + +]
Author: Mingming Cao <[email protected]>
Date:   Wed Jul 9 08:33:32 2025 -0700

    ibmvnic: Fix hardcoded NUM_RX_STATS/NUM_TX_STATS with dynamic sizeof
    
    [ Upstream commit 01b8114b432d7baaa5e51ab229c12c4f36b8e2c6 ]
    
    The previous hardcoded definitions of NUM_RX_STATS and
    NUM_TX_STATS were not updated when new fields were added
    to the ibmvnic_{rx,tx}_queue_stats structures. Specifically,
    commit 2ee73c54a615 ("ibmvnic: Add stat for tx direct vs tx
    batched") added a fourth TX stat, but NUM_TX_STATS remained 3,
    leading to a mismatch.
    
    This patch replaces the static defines with dynamic sizeof-based
    calculations to ensure the stat arrays are correctly sized.
    This fixes incorrect indexing and prevents incomplete stat
    reporting in tools like ethtool.
    
    Fixes: 2ee73c54a615 ("ibmvnic: Add stat for tx direct vs tx batched")
    Signed-off-by: Mingming Cao <[email protected]>
    Reviewed-by: Dave Marquardt <[email protected]>
    Reviewed-by: Haren Myneni <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
Input: atkbd - do not skip atkbd_deactivate() when skipping ATKBD_CMD_GETID [+ + +]
Author: Hans de Goede <[email protected]>
Date:   Fri Jan 26 17:07:24 2024 +0100

    Input: atkbd - do not skip atkbd_deactivate() when skipping ATKBD_CMD_GETID
    
    commit 9cf6e24c9fbf17e52de9fff07f12be7565ea6d61 upstream.
    
    After commit 936e4d49ecbc ("Input: atkbd - skip ATKBD_CMD_GETID in
    translated mode") not only the getid command is skipped, but also
    the de-activating of the keyboard at the end of atkbd_probe(), potentially
    re-introducing the problem fixed by commit be2d7e4233a4 ("Input: atkbd -
    fix multi-byte scancode handling on reconnect").
    
    Make sure multi-byte scancode handling on reconnect is still handled
    correctly by not skipping the atkbd_deactivate() call.
    
    Fixes: 936e4d49ecbc ("Input: atkbd - skip ATKBD_CMD_GETID in translated mode")
    Tested-by: Paul Menzel <[email protected]>
    Signed-off-by: Hans de Goede <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Dmitry Torokhov <[email protected]>
    Signed-off-by: Wang Hai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
io_uring: make fallocate be hashed work [+ + +]
Author: Fengnan Chang <[email protected]>
Date:   Mon Jun 23 19:02:18 2025 +0800

    io_uring: make fallocate be hashed work
    
    [ Upstream commit 88a80066af1617fab444776135d840467414beb6 ]
    
    Like ftruncate and write, fallocate operations on the same file cannot
    be executed in parallel, so it is better to make fallocate be hashed
    work.
    
    Signed-off-by: Fengnan Chang <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
Linux: ipmi:msghandler: Fix potential memory corruption in ipmi_create_user() [+ + +]
Author: Dan Carpenter <[email protected]>
Date:   Mon May 5 17:34:15 2025 +0300

    ipmi:msghandler: Fix potential memory corruption in ipmi_create_user()
    
    commit fa332f5dc6fc662ad7d3200048772c96b861cf6b upstream.
    
    The "intf" list iterator is an invalid pointer if the correct
    "intf->intf_num" is not found.  Calling atomic_dec(&intf->nr_users) on
    and invalid pointer will lead to memory corruption.
    
    We don't really need to call atomic_dec() if we haven't called
    atomic_add_return() so update the if (intf->in_shutdown) path as well.
    
    Fixes: 8e76741c3d8b ("ipmi: Add a limit on the number of users that may use IPMI")
    Signed-off-by: Dan Carpenter <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Corey Minyard <[email protected]>
    [ - Dropped change to the `if (intf->in_shutdown)` block since that logic
        doesn't exist yet.
      - Modified out_unlock to release the srcu lock instead of the mutex
        since we don't have the mutex here yet. ]
    Signed-off-by: Brendan Jackman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
kallsyms: fix build without execinfo [+ + +]
Author: Achill Gilgenast <[email protected]>
Date:   Sun Jun 22 03:45:49 2025 +0200

    kallsyms: fix build without execinfo
    
    commit a95743b53031b015e8949e845a9f6fdfb2656347 upstream.
    
    Some libc's like musl libc don't provide execinfo.h since it's not part of
    POSIX.  In order to fix compilation on musl, only include execinfo.h if
    available (HAVE_BACKTRACE_SUPPORT)
    
    This was discovered with c104c16073b7 ("Kunit to check the longest symbol
    length") which starts to include linux/kallsyms.h with Alpine Linux'
    configs.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: c104c16073b7 ("Kunit to check the longest symbol length")
    Signed-off-by: Achill Gilgenast <[email protected]>
    Cc: Luis Henriques <[email protected]>
    Cc: Greg Kroah-Hartman <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
kasan: remove kasan_find_vm_area() to prevent possible deadlock [+ + +]
Author: Yeoreum Yun <[email protected]>
Date:   Thu Jul 3 19:10:18 2025 +0100

    kasan: remove kasan_find_vm_area() to prevent possible deadlock
    
    commit 6ee9b3d84775944fb8c8a447961cd01274ac671c upstream.
    
    find_vm_area() couldn't be called in atomic_context.  If find_vm_area() is
    called to reports vm area information, kasan can trigger deadlock like:
    
    CPU0                                CPU1
    vmalloc();
     alloc_vmap_area();
      spin_lock(&vn->busy.lock)
                                        spin_lock_bh(&some_lock);
       <interrupt occurs>
       <in softirq>
       spin_lock(&some_lock);
                                        <access invalid address>
                                        kasan_report();
                                         print_report();
                                          print_address_description();
                                           kasan_find_vm_area();
                                            find_vm_area();
                                             spin_lock(&vn->busy.lock) // deadlock!
    
    To prevent possible deadlock while kasan reports, remove kasan_find_vm_area().
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: c056a364e954 ("kasan: print virtual mapping info in reports")
    Signed-off-by: Yeoreum Yun <[email protected]>
    Reported-by: Yunseong Kim <[email protected]>
    Reviewed-by: Andrey Ryabinin <[email protected]>
    Cc: Alexander Potapenko <[email protected]>
    Cc: Andrey Konovalov <[email protected]>
    Cc: Byungchul Park <[email protected]>
    Cc: Dmitriy Vyukov <[email protected]>
    Cc: Sebastian Andrzej Siewior <[email protected]>
    Cc: Steven Rostedt <[email protected]>
    Cc: Vincenzo Frascino <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ksmbd: fix a mount write count leak in ksmbd_vfs_kern_path_locked() [+ + +]
Author: Al Viro <[email protected]>
Date:   Sun Jul 6 02:26:45 2025 +0100

    ksmbd: fix a mount write count leak in ksmbd_vfs_kern_path_locked()
    
    commit 277627b431a0a6401635c416a21b2a0f77a77347 upstream.
    
    If the call of ksmbd_vfs_lock_parent() fails, we drop the parent_path
    references and return an error.  We need to drop the write access we
    just got on parent_path->mnt before we drop the mount reference - callers
    assume that ksmbd_vfs_kern_path_locked() returns with mount write
    access grabbed if and only if it has returned 0.
    
    Fixes: 864fb5d37163 ("ksmbd: fix possible deadlock in smb2_open")
    Signed-off-by: Al Viro <[email protected]>
    Acked-by: Namjae Jeon <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ksmbd: fix potential use-after-free in oplock/lease break ack [+ + +]
Author: Namjae Jeon <[email protected]>
Date:   Tue Jul 8 07:47:40 2025 +0900

    ksmbd: fix potential use-after-free in oplock/lease break ack
    
    commit 50f930db22365738d9387c974416f38a06e8057e upstream.
    
    If ksmbd_iov_pin_rsp return error, use-after-free can happen by
    accessing opinfo->state and opinfo_put and ksmbd_fd_put could
    called twice.
    
    Reported-by: Ziyan Xu <[email protected]>
    Signed-off-by: Namjae Jeon <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
KVM: SVM: Reject SEV{-ES} intra host migration if vCPU creation is in-flight [+ + +]
Author: Sean Christopherson <[email protected]>
Date:   Mon Jun 2 15:44:58 2025 -0700

    KVM: SVM: Reject SEV{-ES} intra host migration if vCPU creation is in-flight
    
    commit ecf371f8b02d5e31b9aa1da7f159f1b2107bdb01 upstream.
    
    Reject migration of SEV{-ES} state if either the source or destination VM
    is actively creating a vCPU, i.e. if kvm_vm_ioctl_create_vcpu() is in the
    section between incrementing created_vcpus and online_vcpus.  The bulk of
    vCPU creation runs _outside_ of kvm->lock to allow creating multiple vCPUs
    in parallel, and so sev_info.es_active can get toggled from false=>true in
    the destination VM after (or during) svm_vcpu_create(), resulting in an
    SEV{-ES} VM effectively having a non-SEV{-ES} vCPU.
    
    The issue manifests most visibly as a crash when trying to free a vCPU's
    NULL VMSA page in an SEV-ES VM, but any number of things can go wrong.
    
      BUG: unable to handle page fault for address: ffffebde00000000
      #PF: supervisor read access in kernel mode
      #PF: error_code(0x0000) - not-present page
      PGD 0 P4D 0
      Oops: Oops: 0000 [#1] SMP KASAN NOPTI
      CPU: 227 UID: 0 PID: 64063 Comm: syz.5.60023 Tainted: G     U     O        6.15.0-smp-DEV #2 NONE
      Tainted: [U]=USER, [O]=OOT_MODULE
      Hardware name: Google, Inc. Arcadia_IT_80/Arcadia_IT_80, BIOS 12.52.0-0 10/28/2024
      RIP: 0010:constant_test_bit arch/x86/include/asm/bitops.h:206 [inline]
      RIP: 0010:arch_test_bit arch/x86/include/asm/bitops.h:238 [inline]
      RIP: 0010:_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline]
      RIP: 0010:PageHead include/linux/page-flags.h:866 [inline]
      RIP: 0010:___free_pages+0x3e/0x120 mm/page_alloc.c:5067
      Code: <49> f7 06 40 00 00 00 75 05 45 31 ff eb 0c 66 90 4c 89 f0 4c 39 f0
      RSP: 0018:ffff8984551978d0 EFLAGS: 00010246
      RAX: 0000777f80000001 RBX: 0000000000000000 RCX: ffffffff918aeb98
      RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffebde00000000
      RBP: 0000000000000000 R08: ffffebde00000007 R09: 1ffffd7bc0000000
      R10: dffffc0000000000 R11: fffff97bc0000001 R12: dffffc0000000000
      R13: ffff8983e19751a8 R14: ffffebde00000000 R15: 1ffffd7bc0000000
      FS:  0000000000000000(0000) GS:ffff89ee661d3000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: ffffebde00000000 CR3: 000000793ceaa000 CR4: 0000000000350ef0
      DR0: 0000000000000000 DR1: 0000000000000b5f DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Call Trace:
       <TASK>
       sev_free_vcpu+0x413/0x630 arch/x86/kvm/svm/sev.c:3169
       svm_vcpu_free+0x13a/0x2a0 arch/x86/kvm/svm/svm.c:1515
       kvm_arch_vcpu_destroy+0x6a/0x1d0 arch/x86/kvm/x86.c:12396
       kvm_vcpu_destroy virt/kvm/kvm_main.c:470 [inline]
       kvm_destroy_vcpus+0xd1/0x300 virt/kvm/kvm_main.c:490
       kvm_arch_destroy_vm+0x636/0x820 arch/x86/kvm/x86.c:12895
       kvm_put_kvm+0xb8e/0xfb0 virt/kvm/kvm_main.c:1310
       kvm_vm_release+0x48/0x60 virt/kvm/kvm_main.c:1369
       __fput+0x3e4/0x9e0 fs/file_table.c:465
       task_work_run+0x1a9/0x220 kernel/task_work.c:227
       exit_task_work include/linux/task_work.h:40 [inline]
       do_exit+0x7f0/0x25b0 kernel/exit.c:953
       do_group_exit+0x203/0x2d0 kernel/exit.c:1102
       get_signal+0x1357/0x1480 kernel/signal.c:3034
       arch_do_signal_or_restart+0x40/0x690 arch/x86/kernel/signal.c:337
       exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
       exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
       __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
       syscall_exit_to_user_mode+0x67/0xb0 kernel/entry/common.c:218
       do_syscall_64+0x7c/0x150 arch/x86/entry/syscall_64.c:100
       entry_SYSCALL_64_after_hwframe+0x76/0x7e
      RIP: 0033:0x7f87a898e969
       </TASK>
      Modules linked in: gq(O)
      gsmi: Log Shutdown Reason 0x03
      CR2: ffffebde00000000
      ---[ end trace 0000000000000000 ]---
    
    Deliberately don't check for a NULL VMSA when freeing the vCPU, as crashing
    the host is likely desirable due to the VMSA being consumed by hardware.
    E.g. if KVM manages to allow VMRUN on the vCPU, hardware may read/write a
    bogus VMSA page.  Accessing PFN 0 is "fine"-ish now that it's sequestered
    away thanks to L1TF, but panicking in this scenario is preferable to
    potentially running with corrupted state.
    
    Reported-by: Alexander Potapenko <[email protected]>
    Tested-by: Alexander Potapenko <[email protected]>
    Fixes: 0b020f5af092 ("KVM: SEV: Add support for SEV-ES intra host migration")
    Fixes: b56639318bb2 ("KVM: SEV: Add support for SEV intra host migration")
    Cc: [email protected]
    Cc: James Houghton <[email protected]>
    Cc: Peter Gonda <[email protected]>
    Reviewed-by: Liam Merwick <[email protected]>
    Tested-by: Liam Merwick <[email protected]>
    Reviewed-by: James Houghton <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: x86/xen: Allow 'out of range' event channel ports in IRQ routing table. [+ + +]
Author: David Woodhouse <[email protected]>
Date:   Thu May 8 13:30:12 2025 -0700

    KVM: x86/xen: Allow 'out of range' event channel ports in IRQ routing table.
    
    commit a7f4dff21fd744d08fa956c243d2b1795f23cbf7 upstream.
    
    To avoid imposing an ordering constraint on userspace, allow 'invalid'
    event channel targets to be configured in the IRQ routing table.
    
    This is the same as accepting interrupts targeted at vCPUs which don't
    exist yet, which is already the case for both Xen event channels *and*
    for MSIs (which don't do any filtering of permitted APIC ID targets at
    all).
    
    If userspace actually *triggers* an IRQ with an invalid target, that
    will fail cleanly, as kvm_xen_set_evtchn_fast() also does the same range
    check.
    
    If KVM enforced that the IRQ target must be valid at the time it is
    *configured*, that would force userspace to create all vCPUs and do
    various other parts of setup (in this case, setting the Xen long_mode)
    before restoring the IRQ table.
    
    Cc: [email protected]
    Signed-off-by: David Woodhouse <[email protected]>
    Reviewed-by: Paul Durrant <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    [sean: massage comment]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Linux: Linux 6.6.99 [+ + +]
Author: Greg Kroah-Hartman <[email protected]>
Date:   Thu Jul 17 18:35:23 2025 +0200

    Linux 6.6.99
    
    Link: https://lore.kernel.org/r/[email protected]
    Tested-by: Miguel Ojeda <[email protected]>
    Tested-by: Shuah Khan <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Tested-by: Miguel Ojeda <[email protected]>
    Tested-by: Harshit Mogalapalli <[email protected]>
    Tested-by: Jon Hunter <[email protected]>
    Tested-by: Mark Brown <[email protected]>
    Tested-by: Ron Economos <[email protected]>
    Tested-by: Linux Kernel Functional Testing <[email protected]>
    Tested-by: Peter Schneider <[email protected]>
    Tested-by: Florian Fainelli <[email protected]>
    Tested-by: Brett A C Sheffield <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
maple_tree: fix MA_STATE_PREALLOC flag in mas_preallocate() [+ + +]
Author: Liam R. Howlett <[email protected]>
Date:   Mon Jun 16 14:45:20 2025 -0400

    maple_tree: fix MA_STATE_PREALLOC flag in mas_preallocate()
    
    commit fba46a5d83ca8decb338722fb4899026d8d9ead2 upstream.
    
    Temporarily clear the preallocation flag when explicitly requesting
    allocations.  Pre-existing allocations are already counted against the
    request through mas_node_count_gfp(), but the allocations will not happen
    if the MA_STATE_PREALLOC flag is set.  This flag is meant to avoid
    re-allocating in bulk allocation mode, and to detect issues with
    preallocation calculations.
    
    The MA_STATE_PREALLOC flag should also always be set on zero allocations
    so that detection of underflow allocations will print a WARN_ON() during
    consumption.
    
    User visible effect of this flaw is a WARN_ON() followed by a null pointer
    dereference when subsequent requests for larger number of nodes is
    ignored, such as the vma merge retry in mmap_region() caused by drivers
    altering the vma flags (which happens in v6.6, at least)
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 54a611b60590 ("Maple Tree: add new data structure")
    Signed-off-by: Liam R. Howlett <[email protected]>
    Reported-by: Zhaoyang Huang <[email protected]>
    Reported-by: Hailong Liu <[email protected]>
    Link: https://lore.kernel.org/all/[email protected]/
    Link: https://lore.kernel.org/all/[email protected]/
    Link: https://lore.kernel.org/all/[email protected]/
    Cc: Lorenzo Stoakes <[email protected]>
    Cc: Suren Baghdasaryan <[email protected]>
    Cc: Hailong Liu <[email protected]>
    Cc: [email protected] <[email protected]>
    Cc: Steve Kang <[email protected]>
    Cc: Matthew Wilcox <[email protected]>
    Cc: Sidhartha Kumar <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Liam R. Howlett <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

maple_tree: fix mt_destroy_walk() on root leaf node [+ + +]
Author: Wei Yang <[email protected]>
Date:   Tue Jun 24 15:18:40 2025 -0400

    maple_tree: fix mt_destroy_walk() on root leaf node
    
    commit ea9b77f98d94c4d5c1bd1ac1db078f78b40e8bf5 upstream.
    
    On destroy, we should set each node dead.  But current code miss this when
    the maple tree has only the root node.
    
    The reason is mt_destroy_walk() leverage mte_destroy_descend() to set node
    dead, but this is skipped since the only root node is a leaf.
    
    Fixes this by setting the node dead if it is a leaf.
    
    Link: https://lore.kernel.org/all/[email protected]/
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 54a611b60590 ("Maple Tree: add new data structure")
    Signed-off-by: Wei Yang <[email protected]>
    Signed-off-by: Liam R. Howlett <[email protected]>
    Reviewed-by: Dev Jain <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
md/md-bitmap: fix GPF in bitmap_get_stats() [+ + +]
Author: HÃ¥kon Bugge <[email protected]>
Date:   Wed Jul 2 11:10:34 2025 +0200

    md/md-bitmap: fix GPF in bitmap_get_stats()
    
    commit c17fb542dbd1db745c9feac15617056506dd7195 upstream.
    
    The commit message of commit 6ec1f0239485 ("md/md-bitmap: fix stats
    collection for external bitmaps") states:
    
        Remove the external bitmap check as the statistics should be
        available regardless of bitmap storage location.
    
        Return -EINVAL only for invalid bitmap with no storage (neither in
        superblock nor in external file).
    
    But, the code does not adhere to the above, as it does only check for
    a valid super-block for "internal" bitmaps. Hence, we observe:
    
    Oops: GPF, probably for non-canonical address 0x1cd66f1f40000028
    RIP: 0010:bitmap_get_stats+0x45/0xd0
    Call Trace:
    
     seq_read_iter+0x2b9/0x46a
     seq_read+0x12f/0x180
     proc_reg_read+0x57/0xb0
     vfs_read+0xf6/0x380
     ksys_read+0x6d/0xf0
     do_syscall_64+0x8c/0x1b0
     entry_SYSCALL_64_after_hwframe+0x76/0x7e
    
    We fix this by checking the existence of a super-block for both the
    internal and external case.
    
    Fixes: 6ec1f0239485 ("md/md-bitmap: fix stats collection for external bitmaps")
    Cc: [email protected]
    Reported-by: Gerald Gibson <[email protected]>
    Signed-off-by: HÃ¥kon Bugge <[email protected]>
    Link: https://lore.kernel.org/linux-raid/[email protected]
    Signed-off-by: Yu Kuai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
md/raid1: Fix stack memory use after return in raid1_reshape [+ + +]
Author: Wang Jinchao <[email protected]>
Date:   Thu Jun 12 19:28:40 2025 +0800

    md/raid1: Fix stack memory use after return in raid1_reshape
    
    [ Upstream commit d67ed2ccd2d1dcfda9292c0ea8697a9d0f2f0d98 ]
    
    In the raid1_reshape function, newpool is
    allocated on the stack and assigned to conf->r1bio_pool.
    This results in conf->r1bio_pool.wait.head pointing
    to a stack address.
    Accessing this address later can lead to a kernel panic.
    
    Example access path:
    
    raid1_reshape()
    {
            // newpool is on the stack
            mempool_t newpool, oldpool;
            // initialize newpool.wait.head to stack address
            mempool_init(&newpool, ...);
            conf->r1bio_pool = newpool;
    }
    
    raid1_read_request() or raid1_write_request()
    {
            alloc_r1bio()
            {
                    mempool_alloc()
                    {
                            // if pool->alloc fails
                            remove_element()
                            {
                                    --pool->curr_nr;
                            }
                    }
            }
    }
    
    mempool_free()
    {
            if (pool->curr_nr < pool->min_nr) {
                    // pool->wait.head is a stack address
                    // wake_up() will try to access this invalid address
                    // which leads to a kernel panic
                    return;
                    wake_up(&pool->wait);
            }
    }
    
    Fix:
    reinit conf->r1bio_pool.wait after assigning newpool.
    
    Fixes: afeee514ce7f ("md: convert to bioset_init()/mempool_init()")
    Signed-off-by: Wang Jinchao <[email protected]>
    Reviewed-by: Yu Kuai <[email protected]>
    Link: https://lore.kernel.org/linux-raid/[email protected]
    Signed-off-by: Yu Kuai <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
mm/vmalloc: leave lazy MMU mode on PTE mapping error [+ + +]
Author: Alexander Gordeev <[email protected]>
Date:   Mon Jun 23 09:57:21 2025 +0200

    mm/vmalloc: leave lazy MMU mode on PTE mapping error
    
    commit fea18c686320a53fce7ad62a87a3e1d10ad02f31 upstream.
    
    vmap_pages_pte_range() enters the lazy MMU mode, but fails to leave it in
    case an error is encountered.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 2ba3e6947aed ("mm/vmalloc: track which page-table levels were modified")
    Signed-off-by: Alexander Gordeev <[email protected]>
    Reported-by: kernel test robot <[email protected]>
    Reported-by: Dan Carpenter <[email protected]>
    Closes: https://lore.kernel.org/r/[email protected]/
    Reviewed-by: Ryan Roberts <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mm: fix the inaccurate memory statistics issue for users [+ + +]
Author: Baolin Wang <[email protected]>
Date:   Thu Jun 5 20:58:29 2025 +0800

    mm: fix the inaccurate memory statistics issue for users
    
    commit 82241a83cd15aaaf28200a40ad1a8b480012edaf upstream.
    
    On some large machines with a high number of CPUs running a 64K pagesize
    kernel, we found that the 'RES' field is always 0 displayed by the top
    command for some processes, which will cause a lot of confusion for users.
    
        PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
     875525 root      20   0   12480      0      0 R   0.3   0.0   0:00.08 top
          1 root      20   0  172800      0      0 S   0.0   0.0   0:04.52 systemd
    
    The main reason is that the batch size of the percpu counter is quite
    large on these machines, caching a significant percpu value, since
    converting mm's rss stats into percpu_counter by commit f1a7941243c1 ("mm:
    convert mm's rss stats into percpu_counter").  Intuitively, the batch
    number should be optimized, but on some paths, performance may take
    precedence over statistical accuracy.  Therefore, introducing a new
    interface to add the percpu statistical count and display it to users,
    which can remove the confusion.  In addition, this change is not expected
    to be on a performance-critical path, so the modification should be
    acceptable.
    
    In addition, the 'mm->rss_stat' is updated by using add_mm_counter() and
    dec/inc_mm_counter(), which are all wrappers around
    percpu_counter_add_batch().  In percpu_counter_add_batch(), there is
    percpu batch caching to avoid 'fbc->lock' contention.  This patch changes
    task_mem() and task_statm() to get the accurate mm counters under the
    'fbc->lock', but this should not exacerbate kernel 'mm->rss_stat' lock
    contention due to the percpu batch caching of the mm counters.  The
    following test also confirm the theoretical analysis.
    
    I run the stress-ng that stresses anon page faults in 32 threads on my 32
    cores machine, while simultaneously running a script that starts 32
    threads to busy-loop pread each stress-ng thread's /proc/pid/status
    interface.  From the following data, I did not observe any obvious impact
    of this patch on the stress-ng tests.
    
    w/o patch:
    stress-ng: info:  [6848]          4,399,219,085,152 CPU Cycles          67.327 B/sec
    stress-ng: info:  [6848]          1,616,524,844,832 Instructions          24.740 B/sec (0.367 instr. per cycle)
    stress-ng: info:  [6848]          39,529,792 Page Faults Total           0.605 M/sec
    stress-ng: info:  [6848]          39,529,792 Page Faults Minor           0.605 M/sec
    
    w/patch:
    stress-ng: info:  [2485]          4,462,440,381,856 CPU Cycles          68.382 B/sec
    stress-ng: info:  [2485]          1,615,101,503,296 Instructions          24.750 B/sec (0.362 instr. per cycle)
    stress-ng: info:  [2485]          39,439,232 Page Faults Total           0.604 M/sec
    stress-ng: info:  [2485]          39,439,232 Page Faults Minor           0.604 M/sec
    
    On comparing a very simple app which just allocates & touches some
    memory against v6.1 (which doesn't have f1a7941243c1) and latest Linus
    tree (4c06e63b9203) I can see that on latest Linus tree the values for
    VmRSS, RssAnon and RssFile from /proc/self/status are all zeroes while
    they do report values on v6.1 and a Linus tree with this patch.
    
    Link: https://lkml.kernel.org/r/f4586b17f66f97c174f7fd1f8647374fdb53de1c.1749119050.git.baolin.wang@linux.alibaba.com
    Fixes: f1a7941243c1 ("mm: convert mm's rss stats into percpu_counter")
    Signed-off-by: Baolin Wang <[email protected]>
    Reviewed-by: Aboorva Devarajan <[email protected]>
    Tested-by: Aboorva Devarajan <[email protected]>
    Tested-by Donet Tom <[email protected]>
    Acked-by: Shakeel Butt <[email protected]>
    Acked-by: SeongJae Park <[email protected]>
    Acked-by: Michal Hocko <[email protected]>
    Reviewed-by: Vlastimil Babka <[email protected]>
    Cc: David Hildenbrand <[email protected]>
    Cc: Liam Howlett <[email protected]>
    Cc: Lorenzo Stoakes <[email protected]>
    Cc: Mike Rapoport <[email protected]>
    Cc: Suren Baghdasaryan <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
nbd: fix uaf in nbd_genl_connect() error path [+ + +]
Author: Zheng Qixing <[email protected]>
Date:   Thu Jun 12 21:24:05 2025 +0800

    nbd: fix uaf in nbd_genl_connect() error path
    
    [ Upstream commit aa9552438ebf015fc5f9f890dbfe39f0c53cf37e ]
    
    There is a use-after-free issue in nbd:
    
    block nbd6: Receive control failed (result -104)
    block nbd6: shutting down sockets
    ==================================================================
    BUG: KASAN: slab-use-after-free in recv_work+0x694/0xa80 drivers/block/nbd.c:1022
    Write of size 4 at addr ffff8880295de478 by task kworker/u33:0/67
    
    CPU: 2 UID: 0 PID: 67 Comm: kworker/u33:0 Not tainted 6.15.0-rc5-syzkaller-00123-g2c89c1b655c0 #0 PREEMPT(full)
    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
    Workqueue: nbd6-recv recv_work
    Call Trace:
     <TASK>
     __dump_stack lib/dump_stack.c:94 [inline]
     dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
     print_address_description mm/kasan/report.c:408 [inline]
     print_report+0xc3/0x670 mm/kasan/report.c:521
     kasan_report+0xe0/0x110 mm/kasan/report.c:634
     check_region_inline mm/kasan/generic.c:183 [inline]
     kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189
     instrument_atomic_read_write include/linux/instrumented.h:96 [inline]
     atomic_dec include/linux/atomic/atomic-instrumented.h:592 [inline]
     recv_work+0x694/0xa80 drivers/block/nbd.c:1022
     process_one_work+0x9cc/0x1b70 kernel/workqueue.c:3238
     process_scheduled_works kernel/workqueue.c:3319 [inline]
     worker_thread+0x6c8/0xf10 kernel/workqueue.c:3400
     kthread+0x3c2/0x780 kernel/kthread.c:464
     ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:153
     ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
     </TASK>
    
    nbd_genl_connect() does not properly stop the device on certain
    error paths after nbd_start_device() has been called. This causes
    the error path to put nbd->config while recv_work continue to use
    the config after putting it, leading to use-after-free in recv_work.
    
    This patch moves nbd_start_device() after the backend file creation.
    
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/all/[email protected]/T/
    Fixes: 6497ef8df568 ("nbd: provide a way for userspace processes to identify device backends")
    Signed-off-by: Zheng Qixing <[email protected]>
    Reviewed-by: Yu Kuai <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
net/sched: Abort __tc_modify_qdisc if parent class does not exist [+ + +]
Author: Victor Nogueira <[email protected]>
Date:   Mon Jul 7 18:08:01 2025 -0300

    net/sched: Abort __tc_modify_qdisc if parent class does not exist
    
    [ Upstream commit ffdde7bf5a439aaa1955ebd581f5c64ab1533963 ]
    
    Lion's patch [1] revealed an ancient bug in the qdisc API.
    Whenever a user creates/modifies a qdisc specifying as a parent another
    qdisc, the qdisc API will, during grafting, detect that the user is
    not trying to attach to a class and reject. However grafting is
    performed after qdisc_create (and thus the qdiscs' init callback) is
    executed. In qdiscs that eventually call qdisc_tree_reduce_backlog
    during init or change (such as fq, hhf, choke, etc), an issue
    arises. For example, executing the following commands:
    
    sudo tc qdisc add dev lo root handle a: htb default 2
    sudo tc qdisc add dev lo parent a: handle beef fq
    
    Qdiscs such as fq, hhf, choke, etc unconditionally invoke
    qdisc_tree_reduce_backlog() in their control path init() or change() which
    then causes a failure to find the child class; however, that does not stop
    the unconditional invocation of the assumed child qdisc's qlen_notify with
    a null class. All these qdiscs make the assumption that class is non-null.
    
    The solution is ensure that qdisc_leaf() which looks up the parent
    class, and is invoked prior to qdisc_create(), should return failure on
    not finding the class.
    In this patch, we leverage qdisc_leaf to return ERR_PTRs whenever the
    parentid doesn't correspond to a class, so that we can detect it
    earlier on and abort before qdisc_create is called.
    
    [1] https://lore.kernel.org/netdev/[email protected]/
    
    Fixes: 5e50da01d0ce ("[NET_SCHED]: Fix endless loops (part 2): "simple" qdiscs")
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/netdev/[email protected]/
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/netdev/[email protected]/
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/netdev/[email protected]/
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/netdev/[email protected]/
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/netdev/[email protected]/
    Acked-by: Jamal Hadi Salim <[email protected]>
    Reviewed-by: Cong Wang <[email protected]>
    Signed-off-by: Victor Nogueira <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
net: appletalk: Fix device refcount leak in atrtr_create() [+ + +]
Author: Kito Xu <[email protected]>
Date:   Wed Jul 9 03:52:51 2025 +0000

    net: appletalk: Fix device refcount leak in atrtr_create()
    
    [ Upstream commit 711c80f7d8b163d3ecd463cd96f07230f488e750 ]
    
    When updating an existing route entry in atrtr_create(), the old device
    reference was not being released before assigning the new device,
    leading to a device refcount leak. Fix this by calling dev_put() to
    release the old device reference before holding the new one.
    
    Fixes: c7f905f0f6d4 ("[ATALK]: Add missing dev_hold() to atrtr_create().")
    Signed-off-by: Kito Xu <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: ll_temac: Fix missing tx_pending check in ethtools_set_ringparam() [+ + +]
Author: Alok Tiwari <[email protected]>
Date:   Thu Jul 10 11:06:17 2025 -0700

    net: ll_temac: Fix missing tx_pending check in ethtools_set_ringparam()
    
    [ Upstream commit e81750b4e3826fedce7362dad839cb40384d60ae ]
    
    The function ll_temac_ethtools_set_ringparam() incorrectly checked
    rx_pending twice, once correctly for RX and once mistakenly in place
    of tx_pending. This caused tx_pending to be left unchecked against
    TX_BD_NUM_MAX.
    As a result, invalid TX ring sizes may have been accepted or valid
    ones wrongly rejected based on the RX limit, leading to potential
    misconfiguration or unexpected results.
    
    This patch corrects the condition to properly validate tx_pending.
    
    Fixes: f7b261bfc35e ("net: ll_temac: Make RX/TX ring sizes configurable")
    Signed-off-by: Alok Tiwari <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: mana: Record doorbell physical address in PF mode [+ + +]
Author: Long Li <[email protected]>
Date:   Tue Jun 17 18:36:46 2025 -0700

    net: mana: Record doorbell physical address in PF mode
    
    [ Upstream commit e0fca6f2cebff539e9317a15a37dcf432e3b851a ]
    
    MANA supports RDMA in PF mode. The driver should record the doorbell
    physical address when in PF mode.
    
    The doorbell physical address is used by the RDMA driver to map
    doorbell pages of the device to user-mode applications through RDMA
    verbs interface. In the past, they have been mapped to user-mode while
    the device is in VF mode. With the support for PF mode implemented,
    also expose those pages in PF mode.
    
    Support for PF mode is implemented in
    290e5d3c49f6 ("net: mana: Add support for Multi Vports on Bare metal")
    
    Signed-off-by: Long Li <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: phy: microchip: limit 100M workaround to link-down events on LAN88xx [+ + +]
Author: Oleksij Rempel <[email protected]>
Date:   Wed Jul 9 15:07:53 2025 +0200

    net: phy: microchip: limit 100M workaround to link-down events on LAN88xx
    
    [ Upstream commit dd4360c0e8504f2f7639c7f5d07c93cfd6a98333 ]
    
    Restrict the 100Mbit forced-mode workaround to link-down transitions
    only, to prevent repeated link reset cycles in certain configurations.
    
    The workaround was originally introduced to improve signal reliability
    when switching cables between long and short distances. It temporarily
    forces the PHY into 10 Mbps before returning to 100 Mbps.
    
    However, when used with autonegotiating link partners (e.g., Intel i350),
    executing this workaround on every link change can confuse the partner
    and cause constant renegotiation loops. This results in repeated link
    down/up transitions and the PHY never reaching a stable state.
    
    Limit the workaround to only run during the PHY_NOLINK state. This ensures
    it is triggered only once per link drop, avoiding disruptive toggling
    while still preserving its intended effect.
    
    Note: I am not able to reproduce the original issue that this workaround
    addresses. I can only confirm that 100 Mbit mode works correctly in my
    test setup. Based on code inspection, I assume the workaround aims to
    reset some internal state machine or signal block by toggling speeds.
    However, a PHY reset is already performed earlier in the function via
    phy_init_hw(), which may achieve a similar effect. Without a reproducer,
    I conservatively keep the workaround but restrict its conditions.
    
    Fixes: e57cf3639c32 ("net: lan78xx: fix accessing the LAN7800's internal phy specific registers from the MAC driver")
    Signed-off-by: Oleksij Rempel <[email protected]>
    Reviewed-by: Andrew Lunn <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: phy: smsc: Fix Auto-MDIX configuration when disabled by strap [+ + +]
Author: Oleksij Rempel <[email protected]>
Date:   Thu Jul 3 13:49:39 2025 +0200

    net: phy: smsc: Fix Auto-MDIX configuration when disabled by strap
    
    [ Upstream commit a141af8eb2272ab0f677a7f2653874840bc9b214 ]
    
    Correct the Auto-MDIX configuration to ensure userspace settings are
    respected when the feature is disabled by the AUTOMDIX_EN hardware strap.
    
    The LAN9500 PHY allows its default MDI-X mode to be configured via a
    hardware strap. If this strap sets the default to "MDI-X off", the
    driver was previously unable to enable Auto-MDIX from userspace.
    
    When handling the ETH_TP_MDI_AUTO case, the driver would set the
    SPECIAL_CTRL_STS_AMDIX_ENABLE_ bit but neglected to set the required
    SPECIAL_CTRL_STS_OVRRD_AMDIX_ bit. Without the override flag, the PHY
    falls back to its hardware strap default, ignoring the software request.
    
    This patch corrects the behavior by also setting the override bit when
    enabling Auto-MDIX. This ensures that the userspace configuration takes
    precedence over the hardware strap, allowing Auto-MDIX to be enabled
    correctly in all scenarios.
    
    Fixes: 05b35e7eb9a1 ("smsc95xx: add phylib support")
    Signed-off-by: Oleksij Rempel <[email protected]>
    Cc: Andre Edich <[email protected]>
    Reviewed-by: Maxime Chevallier <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: phy: smsc: Fix link failure in forced mode with Auto-MDIX [+ + +]
Author: Oleksij Rempel <[email protected]>
Date:   Thu Jul 3 13:49:41 2025 +0200

    net: phy: smsc: Fix link failure in forced mode with Auto-MDIX
    
    [ Upstream commit 9dfe110cc0f6ef42af8e81ce52aef34a647d0b8a ]
    
    Force a fixed MDI-X mode when auto-negotiation is disabled to prevent
    link instability.
    
    When forcing the link speed and duplex on a LAN9500 PHY (e.g., with
    `ethtool -s eth0 autoneg off ...`) while leaving MDI-X control in auto
    mode, the PHY fails to establish a stable link. This occurs because the
    PHY's Auto-MDIX algorithm is not designed to operate when
    auto-negotiation is disabled. In this state, the PHY continuously
    toggles the TX/RX signal pairs, which prevents the link partner from
    synchronizing.
    
    This patch resolves the issue by detecting when auto-negotiation is
    disabled. If the MDI-X control mode is set to 'auto', the driver now
    forces a specific, stable mode (ETH_TP_MDI) to prevent the pair
    toggling. This choice of a fixed MDI mode mirrors the behavior the
    hardware would exhibit if the AUTOMDIX_EN strap were configured for a
    fixed MDI connection.
    
    Fixes: 05b35e7eb9a1 ("smsc95xx: add phylib support")
    Signed-off-by: Oleksij Rempel <[email protected]>
    Cc: Andre Edich <[email protected]>
    Reviewed-by: Andrew Lunn <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: phy: smsc: Force predictable MDI-X state on LAN87xx [+ + +]
Author: Oleksij Rempel <[email protected]>
Date:   Thu Jul 3 13:49:40 2025 +0200

    net: phy: smsc: Force predictable MDI-X state on LAN87xx
    
    [ Upstream commit 0713e55533c88a20edb53eea6517dc56786a0078 ]
    
    Override the hardware strap configuration for MDI-X mode to ensure a
    predictable initial state for the driver. The initial mode of the LAN87xx
    PHY is determined by the AUTOMDIX_EN strap pin, but the driver has no
    documented way to read its latched status.
    
    This unpredictability means the driver cannot know if the PHY has
    initialized with Auto-MDIX enabled or disabled, preventing it from
    providing a reliable interface to the user.
    
    This patch introduces a `config_init` hook that forces the PHY into a
    known state by explicitly enabling Auto-MDIX.
    
    Fixes: 05b35e7eb9a1 ("smsc95xx: add phylib support")
    Signed-off-by: Oleksij Rempel <[email protected]>
    Cc: Andre Edich <[email protected]>
    Reviewed-by: Andrew Lunn <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: stmmac: Fix interrupt handling for level-triggered mode in DWC_XGMAC2 [+ + +]
Author: EricChan <[email protected]>
Date:   Thu Jul 3 10:04:49 2025 +0800

    net: stmmac: Fix interrupt handling for level-triggered mode in DWC_XGMAC2
    
    [ Upstream commit 78b7920a03351a8402de2f81914c1d2e2bdf24b7 ]
    
    According to the Synopsys Controller IP XGMAC-10G Ethernet MAC Databook
    v3.30a (section 2.7.2), when the INTM bit in the DMA_Mode register is set
    to 2, the sbd_perch_tx_intr_o[] and sbd_perch_rx_intr_o[] signals operate
    in level-triggered mode. However, in this configuration, the DMA does not
    assert the XGMAC_NIS status bit for Rx or Tx interrupt events.
    
    This creates a functional regression where the condition
    if (likely(intr_status & XGMAC_NIS)) in dwxgmac2_dma_interrupt() will
    never evaluate to true, preventing proper interrupt handling for
    level-triggered mode. The hardware specification explicitly states that
    "The DMA does not assert the NIS status bit for the Rx or Tx interrupt
    events" (Synopsys DWC_XGMAC2 Databook v3.30a, sec. 2.7.2).
    
    The fix ensures correct handling of both edge and level-triggered
    interrupts while maintaining backward compatibility with existing
    configurations. It has been tested on the hardware device (not publicly
    available), and it can properly trigger the RX and TX interrupt handling
    in both the INTM=0 and INTM=2 configurations.
    
    Fixes: d6ddfacd95c7 ("net: stmmac: Add DMA related callbacks for XGMAC2")
    Tested-by: EricChan <[email protected]>
    Signed-off-by: EricChan <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: usb: qmi_wwan: add SIMCom 8230C composition [+ + +]
Author: Xiaowei Li <[email protected]>
Date:   Fri Jun 20 10:27:02 2025 +0800

    net: usb: qmi_wwan: add SIMCom 8230C composition
    
    [ Upstream commit 0b39b055b5b48cbbdf5746a1ca6e3f6b0221e537 ]
    
    Add support for SIMCom 8230C which is based on Qualcomm SDX35 chip.
    0x9071: tty (DM) + tty (NMEA) + tty (AT) + rmnet
    T:  Bus=01 Lev=01 Prnt=01 Port=05 Cnt=02 Dev#=  8 Spd=480  MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1e0e ProdID=9071 Rev= 5.15
    S:  Manufacturer=SIMCOM
    S:  Product=SDXBAAGHA-IDP _SN:D744C4C5
    S:  SerialNumber=0123456789ABCDEF
    C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
    I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan
    E:  Ad=86(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=none
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    Signed-off-by: Xiaowei Li <[email protected]>
    Acked-by: Bjørn Mork <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
netfilter: flowtable: account for Ethernet header in nf_flow_pppoe_proto() [+ + +]
Author: Eric Dumazet <[email protected]>
Date:   Mon Jul 7 12:45:17 2025 +0000

    netfilter: flowtable: account for Ethernet header in nf_flow_pppoe_proto()
    
    [ Upstream commit 18cdb3d982da8976b28d57691eb256ec5688fad2 ]
    
    syzbot found a potential access to uninit-value in nf_flow_pppoe_proto()
    
    Blamed commit forgot the Ethernet header.
    
    BUG: KMSAN: uninit-value in nf_flow_offload_inet_hook+0x7e4/0x940 net/netfilter/nf_flow_table_inet.c:27
      nf_flow_offload_inet_hook+0x7e4/0x940 net/netfilter/nf_flow_table_inet.c:27
      nf_hook_entry_hookfn include/linux/netfilter.h:157 [inline]
      nf_hook_slow+0xe1/0x3d0 net/netfilter/core.c:623
      nf_hook_ingress include/linux/netfilter_netdev.h:34 [inline]
      nf_ingress net/core/dev.c:5742 [inline]
      __netif_receive_skb_core+0x4aff/0x70c0 net/core/dev.c:5837
      __netif_receive_skb_one_core net/core/dev.c:5975 [inline]
      __netif_receive_skb+0xcc/0xac0 net/core/dev.c:6090
      netif_receive_skb_internal net/core/dev.c:6176 [inline]
      netif_receive_skb+0x57/0x630 net/core/dev.c:6235
      tun_rx_batched+0x1df/0x980 drivers/net/tun.c:1485
      tun_get_user+0x4ee0/0x6b40 drivers/net/tun.c:1938
      tun_chr_write_iter+0x3e9/0x5c0 drivers/net/tun.c:1984
      new_sync_write fs/read_write.c:593 [inline]
      vfs_write+0xb4b/0x1580 fs/read_write.c:686
      ksys_write fs/read_write.c:738 [inline]
      __do_sys_write fs/read_write.c:749 [inline]
    
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/netdev/[email protected]/T/#u
    Fixes: 87b3593bed18 ("netfilter: flowtable: validate pppoe header")
    Signed-off-by: Eric Dumazet <[email protected]>
    Reviewed-by: Pablo Neira Ayuso <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
netlink: Fix rmem check in netlink_broadcast_deliver(). [+ + +]
Author: Kuniyuki Iwashima <[email protected]>
Date:   Fri Jul 11 05:32:07 2025 +0000

    netlink: Fix rmem check in netlink_broadcast_deliver().
    
    commit a3c4a125ec725cefb40047eb05ff9eafd57830b4 upstream.
    
    We need to allow queuing at least one skb even when skb is
    larger than sk->sk_rcvbuf.
    
    The cited commit made a mistake while converting a condition
    in netlink_broadcast_deliver().
    
    Let's correct the rmem check for the allow-one-skb rule.
    
    Fixes: ae8f160e7eb24 ("netlink: Fix wraparounds of sk->sk_rmem_alloc.")
    Signed-off-by: Kuniyuki Iwashima <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

netlink: Fix wraparounds of sk->sk_rmem_alloc. [+ + +]
Author: Kuniyuki Iwashima <[email protected]>
Date:   Fri Jul 4 05:48:18 2025 +0000

    netlink: Fix wraparounds of sk->sk_rmem_alloc.
    
    [ Upstream commit ae8f160e7eb24240a2a79fc4c815c6a0d4ee16cc ]
    
    Netlink has this pattern in some places
    
      if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf)
            atomic_add(skb->truesize, &sk->sk_rmem_alloc);
    
    , which has the same problem fixed by commit 5a465a0da13e ("udp:
    Fix multiple wraparounds of sk->sk_rmem_alloc.").
    
    For example, if we set INT_MAX to SO_RCVBUFFORCE, the condition
    is always false as the two operands are of int.
    
    Then, a single socket can eat as many skb as possible until OOM
    happens, and we can see multiple wraparounds of sk->sk_rmem_alloc.
    
    Let's fix it by using atomic_add_return() and comparing the two
    variables as unsigned int.
    
    Before:
      [root@fedora ~]# ss -f netlink
      Recv-Q      Send-Q Local Address:Port                Peer Address:Port
      -1668710080 0               rtnl:nl_wraparound/293               *
    
    After:
      [root@fedora ~]# ss -f netlink
      Recv-Q     Send-Q Local Address:Port                Peer Address:Port
      2147483072 0               rtnl:nl_wraparound/290               *
      ^
      `--- INT_MAX - 576
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Reported-by: Jason Baron <[email protected]>
    Closes: https://lore.kernel.org/netdev/[email protected]/
    Signed-off-by: Kuniyuki Iwashima <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

netlink: make sure we allow at least one dump skb [+ + +]
Author: Jakub Kicinski <[email protected]>
Date:   Thu Jul 10 17:11:21 2025 -0700

    netlink: make sure we allow at least one dump skb
    
    commit a215b5723922f8099078478122f02100e489cb80 upstream.
    
    Commit under Fixes tightened up the memory accounting for Netlink
    sockets. Looks like the accounting is too strict for some existing
    use cases, Marek reported issues with nl80211 / WiFi iw CLI.
    
    To reduce number of iterations Netlink dumps try to allocate
    messages based on the size of the buffer passed to previous
    recvmsg() calls. If user space uses a larger buffer in recvmsg()
    than sk_rcvbuf we will allocate an skb we won't be able to queue.
    
    Make sure we always allow at least one skb to be queued.
    Same workaround is already present in netlink_attachskb().
    Alternative would be to cap the allocation size to
      rcvbuf - rmem_alloc
    but as I said, the workaround is already present in other places.
    
    Reported-by: Marek Szyprowski <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Fixes: ae8f160e7eb2 ("netlink: Fix wraparounds of sk->sk_rmem_alloc.")
    Tested-by: Marek Szyprowski <[email protected]>
    Reviewed-by: Kuniyuki Iwashima <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
perf/core: Fix the WARN_ON_ONCE is out of lock protected region [+ + +]
Author: Luo Gengkun <[email protected]>
Date:   Thu Jun 26 13:54:03 2025 +0000

    perf/core: Fix the WARN_ON_ONCE is out of lock protected region
    
    [ Upstream commit 7b4c5a37544ba22c6ebe72c0d4ea56c953459fa5 ]
    
    commit 3172fb986666 ("perf/core: Fix WARN in perf_cgroup_switch()") try to
    fix a concurrency problem between perf_cgroup_switch and
    perf_cgroup_event_disable. But it does not to move the WARN_ON_ONCE into
    lock-protected region, so the warning is still be triggered.
    
    Fixes: 3172fb986666 ("perf/core: Fix WARN in perf_cgroup_switch()")
    Signed-off-by: Luo Gengkun <[email protected]>
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>

 
perf: build: Setup PKG_CONFIG_LIBDIR for cross compilation [+ + +]
Author: Leo Yan <[email protected]>
Date:   Wed Jul 17 09:22:06 2024 +0100

    perf: build: Setup PKG_CONFIG_LIBDIR for cross compilation
    
    commit 440cf77625e300e683ca0edc39fbc4b6f3175feb upstream.
    
    On recent Linux distros like Ubuntu Noble and Debian Bookworm, the
    'pkg-config-aarch64-linux-gnu' package is missing. As a result, the
    aarch64-linux-gnu-pkg-config command is not available, which causes
    build failures.
    
    When a build passes the environment variables PKG_CONFIG_LIBDIR or
    PKG_CONFIG_PATH, like a user uses make command or a build system
    (like Yocto, Buildroot, etc) prepares the variables and passes to the
    Perf's Makefile, the commit keeps these variables for package
    configuration. Otherwise, this commit sets the PKG_CONFIG_LIBDIR
    variable to use the Multiarch libs for the cross compilation.
    
    Signed-off-by: Leo Yan <[email protected]>
    Tested-by: Ian Rogers <[email protected]>
    Cc: [email protected]
    Cc: Thomas Richter <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Namhyung Kim <[email protected]>
    Cc: Alexis Lothoré <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

perf: Revert to requiring CAP_SYS_ADMIN for uprobes [+ + +]
Author: Peter Zijlstra <[email protected]>
Date:   Wed Jul 2 18:21:44 2025 +0200

    perf: Revert to requiring CAP_SYS_ADMIN for uprobes
    
    [ Upstream commit ba677dbe77af5ffe6204e0f3f547f3ba059c6302 ]
    
    Jann reports that uprobes can be used destructively when used in the
    middle of an instruction. The kernel only verifies there is a valid
    instruction at the requested offset, but due to variable instruction
    length cannot determine if this is an instruction as seen by the
    intended execution stream.
    
    Additionally, Mark Rutland notes that on architectures that mix data
    in the text segment (like arm64), a similar things can be done if the
    data word is 'mistaken' for an instruction.
    
    As such, require CAP_SYS_ADMIN for uprobes.
    
    Fixes: c9e0924e5c2b ("perf/core: open access to probes for CAP_PERFMON privileged process")
    Reported-by: Jann Horn <[email protected]>
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Link: https://lkml.kernel.org/r/CAG48ez1n4520sq0XrWYDHKiKxE_+WCfAK+qt9qkY4ZiBGmL-5g@mail.gmail.com
    Signed-off-by: Sasha Levin <[email protected]>

 
pinctrl: amd: Clear GPIO debounce for suspend [+ + +]
Author: Mario Limonciello <[email protected]>
Date:   Fri Jun 27 10:01:46 2025 -0500

    pinctrl: amd: Clear GPIO debounce for suspend
    
    [ Upstream commit 8ff4fb276e2384a87ae7f65f3c28e1e139dbb3fe ]
    
    soc-button-array hardcodes a debounce value by means of gpio_keys
    which uses pinctrl-amd as a backend to program debounce for a GPIO.
    
    This hardcoded value doesn't match what the firmware intended to be
    programmed in _AEI. The hardcoded debounce leads to problems waking
    from suspend. There isn't appetite to conditionalize the behavior in
    soc-button-array or gpio-keys so clear it when the system suspends to
    avoid problems with being able to resume.
    
    Cc: Dmitry Torokhov <[email protected]>
    Cc: Hans de Goede <[email protected]>
    Fixes: 5c4fa2a6da7fb ("Input: soc_button_array - debounce the buttons")
    Link: https://lore.kernel.org/linux-input/mkgtrb5gt7miyg6kvqdlbu4nj3elym6ijudobpdi26gp4xxay5@rsa6ytrjvj2q/
    Link: https://lore.kernel.org/linux-input/[email protected]/
    Signed-off-by: Mario Limonciello <[email protected]>
    Reviewed-by: Hans de Goede <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Linus Walleij <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

pinctrl: qcom: msm: mark certain pins as invalid for interrupts [+ + +]
Author: Bartosz Golaszewski <[email protected]>
Date:   Thu Jun 12 11:14:48 2025 +0200

    pinctrl: qcom: msm: mark certain pins as invalid for interrupts
    
    commit 93712205ce2f1fb047739494c0399a26ea4f0890 upstream.
    
    On some platforms, the UFS-reset pin has no interrupt logic in TLMM but
    is nevertheless registered as a GPIO in the kernel. This enables the
    user-space to trigger a BUG() in the pinctrl-msm driver by running, for
    example: `gpiomon -c 0 113` on RB2.
    
    The exact culprit is requesting pins whose intr_detection_width setting
    is not 1 or 2 for interrupts. This hits a BUG() in
    msm_gpio_irq_set_type(). Potentially crashing the kernel due to an
    invalid request from user-space is not optimal, so let's go through the
    pins and mark those that would fail the check as invalid for the irq chip
    as we should not even register them as available irqs.
    
    This function can be extended if we determine that there are more
    corner-cases like this.
    
    Fixes: f365be092572 ("pinctrl: Add Qualcomm TLMM driver")
    Cc: [email protected]
    Reviewed-by: Bjorn Andersson <[email protected]>
    Signed-off-by: Bartosz Golaszewski <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Linus Walleij <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
pwm: mediatek: Ensure to disable clocks in error path [+ + +]
Author: Uwe Kleine-König <[email protected]>
Date:   Fri Jul 4 19:27:27 2025 +0200

    pwm: mediatek: Ensure to disable clocks in error path
    
    commit 505b730ede7f5c4083ff212aa955155b5b92e574 upstream.
    
    After enabling the clocks each error path must disable the clocks again.
    One of them failed to do so. Unify the error paths to use goto to make it
    harder for future changes to add a similar bug.
    
    Fixes: 7ca59947b5fc ("pwm: mediatek: Prevent divide-by-zero in pwm_mediatek_config()")
    Signed-off-by: Uwe Kleine-König <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Cc: [email protected]
    [ukleinek: backported to 6.6.y]
    Signed-off-by: Uwe Kleine-König <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
raid10: cleanup memleak at raid10_make_request [+ + +]
Author: Nigel Croxon <[email protected]>
Date:   Thu Jul 3 11:23:04 2025 -0400

    raid10: cleanup memleak at raid10_make_request
    
    [ Upstream commit 43806c3d5b9bb7d74ba4e33a6a8a41ac988bde24 ]
    
    If raid10_read_request or raid10_write_request registers a new
    request and the REQ_NOWAIT flag is set, the code does not
    free the malloc from the mempool.
    
    unreferenced object 0xffff8884802c3200 (size 192):
       comm "fio", pid 9197, jiffies 4298078271
       hex dump (first 32 bytes):
         00 00 00 00 00 00 00 00 88 41 02 00 00 00 00 00  .........A......
         08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
       backtrace (crc c1a049a2):
         __kmalloc+0x2bb/0x450
         mempool_alloc+0x11b/0x320
         raid10_make_request+0x19e/0x650 [raid10]
         md_handle_request+0x3b3/0x9e0
         __submit_bio+0x394/0x560
         __submit_bio_noacct+0x145/0x530
         submit_bio_noacct_nocheck+0x682/0x830
         __blkdev_direct_IO_async+0x4dc/0x6b0
         blkdev_read_iter+0x1e5/0x3b0
         __io_read+0x230/0x1110
         io_read+0x13/0x30
         io_issue_sqe+0x134/0x1180
         io_submit_sqes+0x48c/0xe90
         __do_sys_io_uring_enter+0x574/0x8b0
         do_syscall_64+0x5c/0xe0
         entry_SYSCALL_64_after_hwframe+0x76/0x7e
    
    V4: changing backing tree to see if CKI tests will pass.
    The patch code has not changed between any versions.
    
    Fixes: c9aa889b035f ("md: raid10 add nowait support")
    Signed-off-by: Nigel Croxon <[email protected]>
    Link: https://lore.kernel.org/linux-raid/[email protected]
    Signed-off-by: Yu Kuai <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
Revert "ACPI: battery: negate current when discharging" [+ + +]
Author: Rafael J. Wysocki <[email protected]>
Date:   Thu Jul 3 12:54:55 2025 +0200

    Revert "ACPI: battery: negate current when discharging"
    
    commit de1675de39aa945bad5937d1fde4df3682670639 upstream.
    
    Revert commit 234f71555019 ("ACPI: battery: negate current when
    discharging") breaks not one but several userspace implementations
    of battery monitoring: Steam and MangoHud. Perhaps it breaks more,
    but those are the two that have been tested.
    
    Reported-by: Matthew Schwartz <[email protected]>
    Closes: https://lore.kernel.org/linux-acpi/[email protected]/
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Revert "usb: gadget: u_serial: Add null pointer check in gs_start_io" [+ + +]
Author: Kuen-Han Tsai <[email protected]>
Date:   Tue Jun 17 13:07:11 2025 +0800

    Revert "usb: gadget: u_serial: Add null pointer check in gs_start_io"
    
    commit f6c7bc4a6823a0a959f40866a1efe99bd03c2c5b upstream.
    
    This reverts commit ffd603f214237e250271162a5b325c6199a65382.
    
    Commit ffd603f21423 ("usb: gadget: u_serial: Add null pointer check in
    gs_start_io") adds null pointer checks at the beginning of the
    gs_start_io() function to prevent a null pointer dereference. However,
    these checks are redundant because the function's comment already
    requires callers to hold the port_lock and ensure port.tty and port_usb
    are not null. All existing callers already follow these rules.
    
    The true cause of the null pointer dereference is a race condition. When
    gs_start_io() calls either gs_start_rx() or gs_start_tx(), the port_lock
    is temporarily released for usb_ep_queue(). This allows port.tty and
    port_usb to be cleared.
    
    Fixes: ffd603f21423 ("usb: gadget: u_serial: Add null pointer check in gs_start_io")
    Cc: stable <[email protected]>
    Signed-off-by: Kuen-Han Tsai <[email protected]>
    Reviewed-by: Prashanth K <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
rseq: Fix segfault on registration when rseq_cs is non-zero [+ + +]
Author: Michael Jeanson <[email protected]>
Date:   Thu Mar 6 16:12:21 2025 -0500

    rseq: Fix segfault on registration when rseq_cs is non-zero
    
    commit fd881d0a085fc54354414aed990ccf05f282ba53 upstream.
    
    The rseq_cs field is documented as being set to 0 by user-space prior to
    registration, however this is not currently enforced by the kernel. This
    can result in a segfault on return to user-space if the value stored in
    the rseq_cs field doesn't point to a valid struct rseq_cs.
    
    The correct solution to this would be to fail the rseq registration when
    the rseq_cs field is non-zero. However, some older versions of glibc
    will reuse the rseq area of previous threads without clearing the
    rseq_cs field and will also terminate the process if the rseq
    registration fails in a secondary thread. This wasn't caught in testing
    because in this case the leftover rseq_cs does point to a valid struct
    rseq_cs.
    
    What we can do is clear the rseq_cs field on registration when it's
    non-zero which will prevent segfaults on registration and won't break
    the glibc versions that reuse rseq areas on thread creation.
    
    Signed-off-by: Michael Jeanson <[email protected]>
    Signed-off-by: Ingo Molnar <[email protected]>
    Reviewed-by: Mathieu Desnoyers <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
rxrpc: Fix bug due to prealloc collision [+ + +]
Author: David Howells <[email protected]>
Date:   Tue Jul 8 22:15:03 2025 +0100

    rxrpc: Fix bug due to prealloc collision
    
    [ Upstream commit 69e4186773c6445b258fb45b6e1df18df831ec45 ]
    
    When userspace is using AF_RXRPC to provide a server, it has to preallocate
    incoming calls and assign to them call IDs that will be used to thread
    related recvmsg() and sendmsg() together.  The preallocated call IDs will
    automatically be attached to calls as they come in until the pool is empty.
    
    To the kernel, the call IDs are just arbitrary numbers, but userspace can
    use the call ID to hold a pointer to prepared structs.  In any case, the
    user isn't permitted to create two calls with the same call ID (call IDs
    become available again when the call ends) and EBADSLT should result from
    sendmsg() if an attempt is made to preallocate a call with an in-use call
    ID.
    
    However, the cleanup in the error handling will trigger both assertions in
    rxrpc_cleanup_call() because the call isn't marked complete and isn't
    marked as having been released.
    
    Fix this by setting the call state in rxrpc_service_prealloc_one() and then
    marking it as being released before calling the cleanup function.
    
    Fixes: 00e907127e6f ("rxrpc: Preallocate peers, conns and calls for incoming service requests")
    Reported-by: Junvyyang, Tencent Zhuque Lab <[email protected]>
    Signed-off-by: David Howells <[email protected]>
    cc: LePremierHomme <[email protected]>
    cc: Marc Dionne <[email protected]>
    cc: Simon Horman <[email protected]>
    cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

rxrpc: Fix oops due to non-existence of prealloc backlog struct [+ + +]
Author: David Howells <[email protected]>
Date:   Tue Jul 8 22:15:04 2025 +0100

    rxrpc: Fix oops due to non-existence of prealloc backlog struct
    
    commit 880a88f318cf1d2a0f4c0a7ff7b07e2062b434a4 upstream.
    
    If an AF_RXRPC service socket is opened and bound, but calls are
    preallocated, then rxrpc_alloc_incoming_call() will oops because the
    rxrpc_backlog struct doesn't get allocated until the first preallocation is
    made.
    
    Fix this by returning NULL from rxrpc_alloc_incoming_call() if there is no
    backlog struct.  This will cause the incoming call to be aborted.
    
    Reported-by: Junvyyang, Tencent Zhuque Lab <[email protected]>
    Suggested-by: Junvyyang, Tencent Zhuque Lab <[email protected]>
    Signed-off-by: David Howells <[email protected]>
    cc: LePremierHomme <[email protected]>
    cc: Marc Dionne <[email protected]>
    cc: Willy Tarreau <[email protected]>
    cc: Simon Horman <[email protected]>
    cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
scripts/gdb: de-reference per-CPU MCE interrupts [+ + +]
Author: Florian Fainelli <[email protected]>
Date:   Mon Jun 23 20:00:19 2025 -0700

    scripts/gdb: de-reference per-CPU MCE interrupts
    
    commit 50f4d2ba26d5c3a4687ae0569be3bbf1c8f0cbed upstream.
    
    The per-CPU MCE interrupts are looked up by reference and need to be
    de-referenced before printing, otherwise we print the addresses of the
    variables instead of their contents:
    
    MCE: 18379471554386948492   Machine check exceptions
    MCP: 18379471554386948488   Machine check polls
    
    The corrected output looks like this instead now:
    
    MCE:          0   Machine check exceptions
    MCP:          1   Machine check polls
    
    Link: https://lkml.kernel.org/r/[email protected]
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: b0969d7687a7 ("scripts/gdb: print interrupts")
    Signed-off-by: Florian Fainelli <[email protected]>
    Cc: Jan Kiszka <[email protected]>
    Cc: Kieran Bingham <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scripts/gdb: fix interrupts display after MCP on x86 [+ + +]
Author: Florian Fainelli <[email protected]>
Date:   Mon Jun 23 09:41:52 2025 -0700

    scripts/gdb: fix interrupts display after MCP on x86
    
    commit 7627b459aa0737bdd62a8591a1481cda467f20e3 upstream.
    
    The text line would not be appended to as it should have, it should have
    been a '+=' but ended up being a '==', fix that.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: b0969d7687a7 ("scripts/gdb: print interrupts")
    Signed-off-by: Florian Fainelli <[email protected]>
    Cc: Jan Kiszka <[email protected]>
    Cc: Kieran Bingham <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scripts/gdb: fix interrupts.py after maple tree conversion [+ + +]
Author: Florian Fainelli <[email protected]>
Date:   Tue Jun 24 19:10:20 2025 -0700

    scripts/gdb: fix interrupts.py after maple tree conversion
    
    commit a02b0cde8ee515ee0c8efd33e7fbe6830c282e69 upstream.
    
    In commit 721255b9826b ("genirq: Use a maple tree for interrupt descriptor
    management"), the irq_desc_tree was replaced with a sparse_irqs tree using
    a maple tree structure.  Since the script looked for the irq_desc_tree
    symbol which is no longer available, no interrupts would be printed and
    the script output would not be useful anymore.
    
    In addition to looking up the correct symbol (sparse_irqs), a new module
    (mapletree.py) is added whose mtree_load() implementation is largely
    copied after the C version and uses the same variable and intermediate
    function names wherever possible to ensure that both the C and Python
    version be updated in the future.
    
    This restores the scripts' output to match that of /proc/interrupts.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 721255b9826b ("genirq: Use a maple tree for interrupt descriptor management")
    Signed-off-by: Florian Fainelli <[email protected]>
    Cc: Jan Kiszka <[email protected]>
    Cc: Kieran Bingham <[email protected]>
    Cc: Shanker Donthineni <[email protected]>
    Cc: Thomas Gleinxer <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
selftests/bpf: adapt one more case in test_lru_map to the new target_free [+ + +]
Author: Willem de Bruijn <[email protected]>
Date:   Wed Jun 25 17:03:55 2025 -0400

    selftests/bpf: adapt one more case in test_lru_map to the new target_free
    
    commit 5e9388f7984a9cc7e659a105113f6ccf0aebedd0 upstream.
    
    The below commit that updated BPF_MAP_TYPE_LRU_HASH free target,
    also updated tools/testing/selftests/bpf/test_lru_map to match.
    
    But that missed one case that passes with 4 cores, but fails at
    higher cpu counts.
    
    Update test_lru_sanity3 to also adjust its expectation of target_free.
    
    This time tested with 1, 4, 16, 64 and 384 cpu count.
    
    Fixes: d4adf1c9ee77 ("bpf: Adjust free target to avoid global starvation of LRU map")
    Signed-off-by: Willem de Bruijn <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
smb: client: avoid unnecessary reconnects when refreshing referrals [+ + +]
Author: Paulo Alcantara <[email protected]>
Date:   Wed Sep 18 02:03:35 2024 -0300

    smb: client: avoid unnecessary reconnects when refreshing referrals
    
    [ Upstream commit 242d23efc987151ecd34bc0cae4c0b737494fc40 ]
    
    Do not mark tcons for reconnect when current connection matches any of
    the targets returned by new referral even when there is no cached
    entry.
    
    Signed-off-by: Paulo Alcantara (Red Hat) <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Stable-dep-of: 74ebd02163fd ("cifs: all initializations for tcon should happen in tcon_info_alloc")
    Signed-off-by: Sasha Levin <[email protected]>

smb: client: fix DFS interlink failover [+ + +]
Author: Paulo Alcantara <[email protected]>
Date:   Wed Sep 18 02:03:55 2024 -0300

    smb: client: fix DFS interlink failover
    
    [ Upstream commit 4f42a8b54b5c6e36519aef3cb1f6210e54abd451 ]
    
    The DFS interlinks point to different DFS namespaces so make sure to
    use the correct DFS root server to chase any DFS links under it by
    storing the SMB session in dfs_ref_walk structure and then using it on
    every referral walk.
    
    Signed-off-by: Paulo Alcantara (Red Hat) <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Stable-dep-of: 74ebd02163fd ("cifs: all initializations for tcon should happen in tcon_info_alloc")
    Signed-off-by: Sasha Levin <[email protected]>

smb: client: fix potential race in cifs_put_tcon() [+ + +]
Author: Paulo Alcantara <[email protected]>
Date:   Fri Dec 6 11:49:07 2024 -0300

    smb: client: fix potential race in cifs_put_tcon()
    
    commit c32b624fa4f7ca5a2ff217a0b1b2f1352bb4ec11 upstream.
    
    dfs_cache_refresh() delayed worker could race with cifs_put_tcon(), so
    make sure to call list_replace_init() on @tcon->dfs_ses_list after
    kworker is cancelled or finished.
    
    Fixes: 4f42a8b54b5c ("smb: client: fix DFS interlink failover")
    Signed-off-by: Paulo Alcantara (Red Hat) <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

smb: server: make use of rdma_destroy_qp() [+ + +]
Author: Stefan Metzmacher <[email protected]>
Date:   Wed Jul 2 09:18:05 2025 +0200

    smb: server: make use of rdma_destroy_qp()
    
    commit 0c2b53997e8f5e2ec9e0fbd17ac0436466b65488 upstream.
    
    The qp is created by rdma_create_qp() as t->cm_id->qp
    and t->qp is just a shortcut.
    
    rdma_destroy_qp() also calls ib_destroy_qp(cm_id->qp) internally,
    but it is protected by a mutex, clears the cm_id and also calls
    trace_cm_qp_destroy().
    
    This should make the tracing more useful as both
    rdma_create_qp() and rdma_destroy_qp() are traces and it makes
    the code look more sane as functions from the same layer are used
    for the specific qp object.
    
    trace-cmd stream -e rdma_cma:cm_qp_create -e rdma_cma:cm_qp_destroy
    shows this now while doing a mount and unmount from a client:
    
      <...>-80   [002] 378.514182: cm_qp_create:  cm.id=1 src=172.31.9.167:5445 dst=172.31.9.166:37113 tos=0 pd.id=0 qp_type=RC send_wr=867 recv_wr=255 qp_num=1 rc=0
      <...>-6283 [001] 381.686172: cm_qp_destroy: cm.id=1 src=172.31.9.167:5445 dst=172.31.9.166:37113 tos=0 qp_num=1
    
    Before we only saw the first line.
    
    Cc: Namjae Jeon <[email protected]>
    Cc: Steve French <[email protected]>
    Cc: Sergey Senozhatsky <[email protected]>
    Cc: Hyunchul Lee <[email protected]>
    Cc: Tom Talpey <[email protected]>
    Cc: [email protected]
    Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
    Signed-off-by: Stefan Metzmacher <[email protected]>
    Reviewed-by: Tom Talpey <[email protected]>
    Acked-by: Namjae Jeon <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
tcp: Correct signedness in skb remaining space calculation [+ + +]
Author: Jiayuan Chen <[email protected]>
Date:   Mon Jul 7 13:41:11 2025 +0800

    tcp: Correct signedness in skb remaining space calculation
    
    [ Upstream commit d3a5f2871adc0c61c61869f37f3e697d97f03d8c ]
    
    Syzkaller reported a bug [1] where sk->sk_forward_alloc can overflow.
    
    When we send data, if an skb exists at the tail of the write queue, the
    kernel will attempt to append the new data to that skb. However, the code
    that checks for available space in the skb is flawed:
    '''
    copy = size_goal - skb->len
    '''
    
    The types of the variables involved are:
    '''
    copy: ssize_t (s64 on 64-bit systems)
    size_goal: int
    skb->len: unsigned int
    '''
    
    Due to C's type promotion rules, the signed size_goal is converted to an
    unsigned int to match skb->len before the subtraction. The result is an
    unsigned int.
    
    When this unsigned int result is then assigned to the s64 copy variable,
    it is zero-extended, preserving its non-negative value. Consequently, copy
    is always >= 0.
    
    Assume we are sending 2GB of data and size_goal has been adjusted to a
    value smaller than skb->len. The subtraction will result in copy holding a
    very large positive integer. In the subsequent logic, this large value is
    used to update sk->sk_forward_alloc, which can easily cause it to overflow.
    
    The syzkaller reproducer uses TCP_REPAIR to reliably create this
    condition. However, this can also occur in real-world scenarios. The
    tcp_bound_to_half_wnd() function can also reduce size_goal to a small
    value. This would cause the subsequent tcp_wmem_schedule() to set
    sk->sk_forward_alloc to a value close to INT_MAX. Further memory
    allocation requests would then cause sk_forward_alloc to wrap around and
    become negative.
    
    [1]: https://syzkaller.appspot.com/bug?extid=de6565462ab540f50e47
    
    Reported-by: [email protected]
    Fixes: 270a1c3de47e ("tcp: Support MSG_SPLICE_PAGES")
    Signed-off-by: Jiayuan Chen <[email protected]>
    Reviewed-by: Eric Dumazet <[email protected]>
    Reviewed-by: David Howells <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
tipc: Fix use-after-free in tipc_conn_close(). [+ + +]
Author: Kuniyuki Iwashima <[email protected]>
Date:   Wed Jul 2 01:43:40 2025 +0000

    tipc: Fix use-after-free in tipc_conn_close().
    
    [ Upstream commit 667eeab4999e981c96b447a4df5f20bdf5c26f13 ]
    
    syzbot reported a null-ptr-deref in tipc_conn_close() during netns
    dismantle. [0]
    
    tipc_topsrv_stop() iterates tipc_net(net)->topsrv->conn_idr and calls
    tipc_conn_close() for each tipc_conn.
    
    The problem is that tipc_conn_close() is called after releasing the
    IDR lock.
    
    At the same time, there might be tipc_conn_recv_work() running and it
    could call tipc_conn_close() for the same tipc_conn and release its
    last ->kref.
    
    Once we release the IDR lock in tipc_topsrv_stop(), there is no
    guarantee that the tipc_conn is alive.
    
    Let's hold the ref before releasing the lock and put the ref after
    tipc_conn_close() in tipc_topsrv_stop().
    
    [0]:
    BUG: KASAN: use-after-free in tipc_conn_close+0x122/0x140 net/tipc/topsrv.c:165
    Read of size 8 at addr ffff888099305a08 by task kworker/u4:3/435
    
    CPU: 0 PID: 435 Comm: kworker/u4:3 Not tainted 4.19.204-syzkaller #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Workqueue: netns cleanup_net
    Call Trace:
     __dump_stack lib/dump_stack.c:77 [inline]
     dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
     print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
     kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
     kasan_report mm/kasan/report.c:412 [inline]
     __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
     tipc_conn_close+0x122/0x140 net/tipc/topsrv.c:165
     tipc_topsrv_stop net/tipc/topsrv.c:701 [inline]
     tipc_topsrv_exit_net+0x27b/0x5c0 net/tipc/topsrv.c:722
     ops_exit_list+0xa5/0x150 net/core/net_namespace.c:153
     cleanup_net+0x3b4/0x8b0 net/core/net_namespace.c:553
     process_one_work+0x864/0x1570 kernel/workqueue.c:2153
     worker_thread+0x64c/0x1130 kernel/workqueue.c:2296
     kthread+0x33f/0x460 kernel/kthread.c:259
     ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
    
    Allocated by task 23:
     kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625
     kmalloc include/linux/slab.h:515 [inline]
     kzalloc include/linux/slab.h:709 [inline]
     tipc_conn_alloc+0x43/0x4f0 net/tipc/topsrv.c:192
     tipc_topsrv_accept+0x1b5/0x280 net/tipc/topsrv.c:470
     process_one_work+0x864/0x1570 kernel/workqueue.c:2153
     worker_thread+0x64c/0x1130 kernel/workqueue.c:2296
     kthread+0x33f/0x460 kernel/kthread.c:259
     ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
    
    Freed by task 23:
     __cache_free mm/slab.c:3503 [inline]
     kfree+0xcc/0x210 mm/slab.c:3822
     tipc_conn_kref_release net/tipc/topsrv.c:150 [inline]
     kref_put include/linux/kref.h:70 [inline]
     conn_put+0x2cd/0x3a0 net/tipc/topsrv.c:155
     process_one_work+0x864/0x1570 kernel/workqueue.c:2153
     worker_thread+0x64c/0x1130 kernel/workqueue.c:2296
     kthread+0x33f/0x460 kernel/kthread.c:259
     ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
    
    The buggy address belongs to the object at ffff888099305a00
     which belongs to the cache kmalloc-512 of size 512
    The buggy address is located 8 bytes inside of
     512-byte region [ffff888099305a00, ffff888099305c00)
    The buggy address belongs to the page:
    page:ffffea000264c140 count:1 mapcount:0 mapping:ffff88813bff0940 index:0x0
    flags: 0xfff00000000100(slab)
    raw: 00fff00000000100 ffffea00028b6b88 ffffea0002cd2b08 ffff88813bff0940
    raw: 0000000000000000 ffff888099305000 0000000100000006 0000000000000000
    page dumped because: kasan: bad access detected
    
    Memory state around the buggy address:
     ffff888099305900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
     ffff888099305980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
    >ffff888099305a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                          ^
     ffff888099305a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
     ffff888099305b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    
    Fixes: c5fa7b3cf3cb ("tipc: introduce new TIPC server infrastructure")
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=27169a847a70550d17be
    Signed-off-by: Kuniyuki Iwashima <[email protected]>
    Reviewed-by: Tung Nguyen <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
ublk: sanity check add_dev input for underflow [+ + +]
Author: Ronnie Sahlberg <[email protected]>
Date:   Thu Jun 26 12:20:45 2025 +1000

    ublk: sanity check add_dev input for underflow
    
    [ Upstream commit 969127bf0783a4ac0c8a27e633a9e8ea1738583f ]
    
    Add additional checks that queue depth and number of queues are
    non-zero.
    
    Signed-off-by: Ronnie Sahlberg <[email protected]>
    Reviewed-by: Ming Lei <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
um: vector: Reduce stack usage in vector_eth_configure() [+ + +]
Author: Tiwei Bie <[email protected]>
Date:   Mon Jun 23 19:08:29 2025 +0800

    um: vector: Reduce stack usage in vector_eth_configure()
    
    [ Upstream commit 2d65fc13be85c336c56af7077f08ccd3a3a15a4a ]
    
    When compiling with clang (19.1.7), initializing *vp using a compound
    literal may result in excessive stack usage. Fix it by initializing the
    required fields of *vp individually.
    
    Without this patch:
    
    $ objdump -d arch/um/drivers/vector_kern.o | ./scripts/checkstack.pl x86_64 0
    ...
    0x0000000000000540 vector_eth_configure [vector_kern.o]:1472
    ...
    
    With this patch:
    
    $ objdump -d arch/um/drivers/vector_kern.o | ./scripts/checkstack.pl x86_64 0
    ...
    0x0000000000000540 vector_eth_configure [vector_kern.o]:208
    ...
    
    Reported-by: kernel test robot <[email protected]>
    Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
    Signed-off-by: Tiwei Bie <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
usb: cdnsp: Fix issue with CV Bad Descriptor test [+ + +]
Author: Pawel Laszczak <[email protected]>
Date:   Fri Jun 20 08:23:12 2025 +0000

    usb: cdnsp: Fix issue with CV Bad Descriptor test
    
    [ Upstream commit 2831a81077f5162f104ba5a97a7d886eb371c21c ]
    
    The SSP2 controller has extra endpoint state preserve bit (ESP) which
    setting causes that endpoint state will be preserved during
    Halt Endpoint command. It is used only for EP0.
    Without this bit the Command Verifier "TD 9.10 Bad Descriptor Test"
    failed.
    Setting this bit doesn't have any impact for SSP controller.
    
    Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver")
    Cc: stable <[email protected]>
    Signed-off-by: Pawel Laszczak <[email protected]>
    Acked-by: Peter Chen <[email protected]>
    Link: https://lore.kernel.org/r/PH7PR07MB95382CCD50549DABAEFD6156DD7CA@PH7PR07MB9538.namprd07.prod.outlook.com
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

usb: cdnsp: Replace snprintf() with the safer scnprintf() variant [+ + +]
Author: Lee Jones <[email protected]>
Date:   Thu Nov 30 10:54:36 2023 +0000

    usb: cdnsp: Replace snprintf() with the safer scnprintf() variant
    
    [ Upstream commit b385ef088c7aab20a2c0dc20d390d69a6620f0f3 ]
    
    There is a general misunderstanding amongst engineers that {v}snprintf()
    returns the length of the data *actually* encoded into the destination
    array.  However, as per the C99 standard {v}snprintf() really returns
    the length of the data that *would have been* written if there were
    enough space for it.  This misunderstanding has led to buffer-overruns
    in the past.  It's generally considered safer to use the {v}scnprintf()
    variants in their place (or even sprintf() in simple cases).  So let's
    do that.
    
    The uses in this file all seem to assume that data *has been* written!
    
    Link: https://lwn.net/Articles/69419/
    Link: https://github.com/KSPP/linux/issues/105
    Cc: Pawel Laszczak <[email protected]>
    Cc: Greg Kroah-Hartman <[email protected]>
    Cc: [email protected]
    Signed-off-by: Lee Jones <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Stable-dep-of: 2831a81077f5 ("usb: cdnsp: Fix issue with CV Bad Descriptor test")
    Signed-off-by: Sasha Levin <[email protected]>

usb: dwc3: Abort suspend on soft disconnect failure [+ + +]
Author: Kuen-Han Tsai <[email protected]>
Date:   Wed May 28 18:03:11 2025 +0800

    usb: dwc3: Abort suspend on soft disconnect failure
    
    [ Upstream commit 630a1dec3b0eba2a695b9063f1c205d585cbfec9 ]
    
    When dwc3_gadget_soft_disconnect() fails, dwc3_suspend_common() keeps
    going with the suspend, resulting in a period where the power domain is
    off, but the gadget driver remains connected.  Within this time frame,
    invoking vbus_event_work() will cause an error as it attempts to access
    DWC3 registers for endpoint disabling after the power domain has been
    completely shut down.
    
    Abort the suspend sequence when dwc3_gadget_suspend() cannot halt the
    controller and proceeds with a soft connect.
    
    Fixes: 9f8a67b65a49 ("usb: dwc3: gadget: fix gadget suspend/resume")
    Cc: stable <[email protected]>
    Acked-by: Thinh Nguyen <[email protected]>
    Signed-off-by: Kuen-Han Tsai <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

usb: gadget: u_serial: Fix race condition in TTY wakeup [+ + +]
Author: Kuen-Han Tsai <[email protected]>
Date:   Tue Jun 17 13:07:12 2025 +0800

    usb: gadget: u_serial: Fix race condition in TTY wakeup
    
    commit c529c3730bd09115684644e26bf01ecbd7e2c2c9 upstream.
    
    A race condition occurs when gs_start_io() calls either gs_start_rx() or
    gs_start_tx(), as those functions briefly drop the port_lock for
    usb_ep_queue(). This allows gs_close() and gserial_disconnect() to clear
    port.tty and port_usb, respectively.
    
    Use the null-safe TTY Port helper function to wake up TTY.
    
    Example
      CPU1:                       CPU2:
      gserial_connect() // lock
                                  gs_close() // await lock
      gs_start_rx()     // unlock
      usb_ep_queue()
                                  gs_close() // lock, reset port.tty and unlock
      gs_start_rx()     // lock
      tty_wakeup()      // NPE
    
    Fixes: 35f95fd7f234 ("TTY: usb/u_serial, use tty from tty_port")
    Cc: stable <[email protected]>
    Signed-off-by: Kuen-Han Tsai <[email protected]>
    Reviewed-by: Prashanth K <[email protected]>
    Link: https://lore.kernel.org/linux-usb/[email protected]/
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Linux: usb:cdnsp: remove TRB_FLUSH_ENDPOINT command [+ + +]
Author: Pawel Laszczak <[email protected]>
Date:   Thu Oct 26 09:37:37 2023 +0200

    usb:cdnsp: remove TRB_FLUSH_ENDPOINT command
    
    [ Upstream commit 2998874736bca1031ca84b0a3235a2cd09dfa426 ]
    
    Patch removes TRB_FLUSH_ENDPOINT command from driver.
    This command is not supported by controller and
    USBSSP returns TRB Error completion code for it.
    
    Signed-off-by: Pawel Laszczak <[email protected]>
    Acked-by: Peter Chen <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Stable-dep-of: 2831a81077f5 ("usb: cdnsp: Fix issue with CV Bad Descriptor test")
    Signed-off-by: Sasha Levin <[email protected]>

 
vsock: fix `vsock_proto` declaration [+ + +]
Author: Stefano Garzarella <[email protected]>
Date:   Thu Jul 3 13:23:29 2025 +0200

    vsock: fix `vsock_proto` declaration
    
    [ Upstream commit 1e3b66e326015f77bc4b36976bebeedc2ac0f588 ]
    
    From commit 634f1a7110b4 ("vsock: support sockmap"), `struct proto
    vsock_proto`, defined in af_vsock.c, is not static anymore, since it's
    used by vsock_bpf.c.
    
    If CONFIG_BPF_SYSCALL is not defined, `make C=2` will print a warning:
        $ make O=build C=2 W=1 net/vmw_vsock/
          ...
          CC [M]  net/vmw_vsock/af_vsock.o
          CHECK   ../net/vmw_vsock/af_vsock.c
        ../net/vmw_vsock/af_vsock.c:123:14: warning: symbol 'vsock_proto' was not declared. Should it be static?
    
    Declare `vsock_proto` regardless of CONFIG_BPF_SYSCALL, since it's defined
    in af_vsock.c, which is built regardless of CONFIG_BPF_SYSCALL.
    
    Fixes: 634f1a7110b4 ("vsock: support sockmap")
    Signed-off-by: Stefano Garzarella <[email protected]>
    Acked-by: Michael S. Tsirkin <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

vsock: Fix IOCTL_VM_SOCKETS_GET_LOCAL_CID to check also `transport_local` [+ + +]
Author: Michal Luczaj <[email protected]>
Date:   Thu Jul 3 17:18:20 2025 +0200

    vsock: Fix IOCTL_VM_SOCKETS_GET_LOCAL_CID to check also `transport_local`
    
    [ Upstream commit 1e7d9df379a04ccd0c2f82f39fbb69d482e864cc ]
    
    Support returning VMADDR_CID_LOCAL in case no other vsock transport is
    available.
    
    Fixes: 0e12190578d0 ("vsock: add local transport support in the vsock core")
    Suggested-by: Stefano Garzarella <[email protected]>
    Reviewed-by: Stefano Garzarella <[email protected]>
    Signed-off-by: Michal Luczaj <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

vsock: Fix transport_* TOCTOU [+ + +]
Author: Michal Luczaj <[email protected]>
Date:   Thu Jul 3 17:18:19 2025 +0200

    vsock: Fix transport_* TOCTOU
    
    [ Upstream commit 687aa0c5581b8d4aa87fd92973e4ee576b550cdf ]
    
    Transport assignment may race with module unload. Protect new_transport
    from becoming a stale pointer.
    
    This also takes care of an insecure call in vsock_use_local_transport();
    add a lockdep assert.
    
    BUG: unable to handle page fault for address: fffffbfff8056000
    Oops: Oops: 0000 [#1] SMP KASAN
    RIP: 0010:vsock_assign_transport+0x366/0x600
    Call Trace:
     vsock_connect+0x59c/0xc40
     __sys_connect+0xe8/0x100
     __x64_sys_connect+0x6e/0xc0
     do_syscall_64+0x92/0x1c0
     entry_SYSCALL_64_after_hwframe+0x4b/0x53
    
    Fixes: c0cfa2d8a788 ("vsock: add multi-transports support")
    Reviewed-by: Stefano Garzarella <[email protected]>
    Signed-off-by: Michal Luczaj <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

vsock: Fix transport_{g2h,h2g} TOCTOU [+ + +]
Author: Michal Luczaj <[email protected]>
Date:   Thu Jul 3 17:18:18 2025 +0200

    vsock: Fix transport_{g2h,h2g} TOCTOU
    
    [ Upstream commit 209fd720838aaf1420416494c5505096478156b4 ]
    
    vsock_find_cid() and vsock_dev_do_ioctl() may race with module unload.
    transport_{g2h,h2g} may become NULL after the NULL check.
    
    Introduce vsock_transport_local_cid() to protect from a potential
    null-ptr-deref.
    
    KASAN: null-ptr-deref in range [0x0000000000000118-0x000000000000011f]
    RIP: 0010:vsock_find_cid+0x47/0x90
    Call Trace:
     __vsock_bind+0x4b2/0x720
     vsock_bind+0x90/0xe0
     __sys_bind+0x14d/0x1e0
     __x64_sys_bind+0x6e/0xc0
     do_syscall_64+0x92/0x1c0
     entry_SYSCALL_64_after_hwframe+0x4b/0x53
    
    KASAN: null-ptr-deref in range [0x0000000000000118-0x000000000000011f]
    RIP: 0010:vsock_dev_do_ioctl.isra.0+0x58/0xf0
    Call Trace:
     __x64_sys_ioctl+0x12d/0x190
     do_syscall_64+0x92/0x1c0
     entry_SYSCALL_64_after_hwframe+0x4b/0x53
    
    Fixes: c0cfa2d8a788 ("vsock: add multi-transports support")
    Suggested-by: Stefano Garzarella <[email protected]>
    Reviewed-by: Stefano Garzarella <[email protected]>
    Signed-off-by: Michal Luczaj <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
vt: add missing notification when switching back to text mode [+ + +]
Author: Nicolas Pitre <[email protected]>
Date:   Tue Jun 10 21:41:44 2025 -0400

    vt: add missing notification when switching back to text mode
    
    [ Upstream commit ff78538e07fa284ce08cbbcb0730daa91ed16722 ]
    
    Programs using poll() on /dev/vcsa to be notified when VT changes occur
    were missing one case: the switch from gfx to text mode.
    
    Signed-off-by: Nicolas Pitre <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
wifi: prevent A-MSDU attacks in mesh networks [+ + +]
Author: Mathy Vanhoef <[email protected]>
Date:   Mon Jun 16 02:46:35 2025 +0200

    wifi: prevent A-MSDU attacks in mesh networks
    
    commit 737bb912ebbe4571195c56eba557c4d7315b26fb upstream.
    
    This patch is a mitigation to prevent the A-MSDU spoofing vulnerability
    for mesh networks. The initial update to the IEEE 802.11 standard, in
    response to the FragAttacks, missed this case (CVE-2025-27558). It can
    be considered a variant of CVE-2020-24588 but for mesh networks.
    
    This patch tries to detect if a standard MSDU was turned into an A-MSDU
    by an adversary. This is done by parsing a received A-MSDU as a standard
    MSDU, calculating the length of the Mesh Control header, and seeing if
    the 6 bytes after this header equal the start of an rfc1042 header. If
    equal, this is a strong indication of an ongoing attack attempt.
    
    This defense was tested with mac80211_hwsim against a mesh network that
    uses an empty Mesh Address Extension field, i.e., when four addresses
    are used, and when using a 12-byte Mesh Address Extension field, i.e.,
    when six addresses are used. Functionality of normal MSDUs and A-MSDUs
    was also tested, and confirmed working, when using both an empty and
    12-byte Mesh Address Extension field.
    
    It was also tested with mac80211_hwsim that A-MSDU attacks in non-mesh
    networks keep being detected and prevented.
    
    Note that the vulnerability being patched, and the defense being
    implemented, was also discussed in the following paper and in the
    following IEEE 802.11 presentation:
    
    https://papers.mathyvanhoef.com/wisec2025.pdf
    https://mentor.ieee.org/802.11/dcn/25/11-25-0949-00-000m-a-msdu-mesh-spoof-protection.docx
    
    Cc: [email protected]
    Signed-off-by: Mathy Vanhoef <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: zd1211rw: Fix potential NULL pointer dereference in zd_mac_tx_to_dev() [+ + +]
Author: Daniil Dulov <[email protected]>
Date:   Thu Jun 26 14:46:19 2025 +0300

    wifi: zd1211rw: Fix potential NULL pointer dereference in zd_mac_tx_to_dev()
    
    [ Upstream commit 74b1ec9f5d627d2bdd5e5b6f3f81c23317657023 ]
    
    There is a potential NULL pointer dereference in zd_mac_tx_to_dev(). For
    example, the following is possible:
    
            T0                                      T1
    zd_mac_tx_to_dev()
      /* len == skb_queue_len(q) */
      while (len > ZD_MAC_MAX_ACK_WAITERS) {
    
                                              filter_ack()
                                                spin_lock_irqsave(&q->lock, flags);
                                                /* position == skb_queue_len(q) */
                                                for (i=1; i<position; i++)
                                                  skb = __skb_dequeue(q)
    
                                                if (mac->type == NL80211_IFTYPE_AP)
                                                  skb = __skb_dequeue(q);
                                                spin_unlock_irqrestore(&q->lock, flags);
    
        skb_dequeue() -> NULL
    
    Since there is a small gap between checking skb queue length and skb being
    unconditionally dequeued in zd_mac_tx_to_dev(), skb_dequeue() can return NULL.
    Then the pointer is passed to zd_mac_tx_status() where it is dereferenced.
    
    In order to avoid potential NULL pointer dereference due to situations like
    above, check if skb is not NULL before passing it to zd_mac_tx_status().
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 459c51ad6e1f ("zd1211rw: port to mac80211")
    Signed-off-by: Daniil Dulov <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
x86/mce/amd: Add default names for MCA banks and blocks [+ + +]
Author: Yazen Ghannam <[email protected]>
Date:   Tue Jun 24 14:15:58 2025 +0000

    x86/mce/amd: Add default names for MCA banks and blocks
    
    commit d66e1e90b16055d2f0ee76e5384e3f119c3c2773 upstream.
    
    Ensure that sysfs init doesn't fail for new/unrecognized bank types or if
    a bank has additional blocks available.
    
    Most MCA banks have a single thresholding block, so the block takes the same
    name as the bank.
    
    Unified Memory Controllers (UMCs) are a special case where there are two
    blocks and each has a unique name.
    
    However, the microarchitecture allows for five blocks. Any new MCA bank types
    with more than one block will be missing names for the extra blocks. The MCE
    sysfs will fail to initialize in this case.
    
    Fixes: 87a6d4091bd7 ("x86/mce/AMD: Update sysfs bank names for SMCA systems")
    Signed-off-by: Yazen Ghannam <[email protected]>
    Signed-off-by: Borislav Petkov (AMD) <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

x86/mce/amd: Fix threshold limit reset [+ + +]
Author: Yazen Ghannam <[email protected]>
Date:   Tue Jun 24 14:15:59 2025 +0000

    x86/mce/amd: Fix threshold limit reset
    
    commit 5f6e3b720694ad771911f637a51930f511427ce1 upstream.
    
    The MCA threshold limit must be reset after servicing the interrupt.
    
    Currently, the restart function doesn't have an explicit check for this.  It
    makes some assumptions based on the current limit and what's in the registers.
    These assumptions don't always hold, so the limit won't be reset in some
    cases.
    
    Make the reset condition explicit. Either an interrupt/overflow has occurred
    or the bank is being initialized.
    
    Signed-off-by: Yazen Ghannam <[email protected]>
    Signed-off-by: Borislav Petkov (AMD) <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
x86/mce: Don't remove sysfs if thresholding sysfs init fails [+ + +]
Author: Yazen Ghannam <[email protected]>
Date:   Tue Jun 24 14:15:56 2025 +0000

    x86/mce: Don't remove sysfs if thresholding sysfs init fails
    
    commit 4c113a5b28bfd589e2010b5fc8867578b0135ed7 upstream.
    
    Currently, the MCE subsystem sysfs interface will be removed if the
    thresholding sysfs interface fails to be created. A common failure is due to
    new MCA bank types that are not recognized and don't have a short name set.
    
    The MCA thresholding feature is optional and should not break the common MCE
    sysfs interface. Also, new MCA bank types are occasionally introduced, and
    updates will be needed to recognize them. But likewise, this should not break
    the common sysfs interface.
    
    Keep the MCE sysfs interface regardless of the status of the thresholding
    sysfs interface.
    
    Signed-off-by: Yazen Ghannam <[email protected]>
    Signed-off-by: Borislav Petkov (AMD) <[email protected]>
    Reviewed-by: Qiuxu Zhuo <[email protected]>
    Reviewed-by: Tony Luck <[email protected]>
    Tested-by: Tony Luck <[email protected]>
    Cc: [email protected]
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

x86/mce: Make sure CMCI banks are cleared during shutdown on Intel [+ + +]
Author: JP Kobryn <[email protected]>
Date:   Fri Jun 27 10:49:35 2025 -0700

    x86/mce: Make sure CMCI banks are cleared during shutdown on Intel
    
    commit 30ad231a5029bfa16e46ce868497b1a5cdd3c24d upstream.
    
    CMCI banks are not cleared during shutdown on Intel CPUs. As a side effect,
    when a kexec is performed, CPUs coming back online are unable to
    rediscover/claim these occupied banks which breaks MCE reporting.
    
    Clear the CPU ownership during shutdown via cmci_clear() so the banks can
    be reclaimed and MCE reporting will become functional once more.
    
      [ bp: Massage commit message. ]
    
    Reported-by: Aijay Adams <[email protected]>
    Signed-off-by: JP Kobryn <[email protected]>
    Signed-off-by: Borislav Petkov (AMD) <[email protected]>
    Reviewed-by: Tony Luck <[email protected]>
    Reviewed-by: Qiuxu Zhuo <[email protected]>
    Cc: <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
x86/mm: Disable hugetlb page table sharing on 32-bit [+ + +]
Author: Jann Horn <[email protected]>
Date:   Wed Jul 2 10:32:04 2025 +0200

    x86/mm: Disable hugetlb page table sharing on 32-bit
    
    commit 76303ee8d54bff6d9a6d55997acd88a6c2ba63cf upstream.
    
    Only select ARCH_WANT_HUGE_PMD_SHARE on 64-bit x86.
    Page table sharing requires at least three levels because it involves
    shared references to PMD tables; 32-bit x86 has either two-level paging
    (without PAE) or three-level paging (with PAE), but even with
    three-level paging, having a dedicated PGD entry for hugetlb is only
    barely possible (because the PGD only has four entries), and it seems
    unlikely anyone's actually using PMD sharing on 32-bit.
    
    Having ARCH_WANT_HUGE_PMD_SHARE enabled on non-PAE 32-bit X86 (which
    has 2-level paging) became particularly problematic after commit
    59d9094df3d7 ("mm: hugetlb: independent PMD page table shared count"),
    since that changes `struct ptdesc` such that the `pt_mm` (for PGDs) and
    the `pt_share_count` (for PMDs) share the same union storage - and with
    2-level paging, PMDs are PGDs.
    
    (For comparison, arm64 also gates ARCH_WANT_HUGE_PMD_SHARE on the
    configuration of page tables such that it is never enabled with 2-level
    paging.)
    
    Closes: https://lore.kernel.org/r/[email protected]
    Fixes: cfe28c5d63d8 ("x86: mm: Remove x86 version of huge_pmd_share.")
    Reported-by: Vitaly Chikunov <[email protected]>
    Suggested-by: Dave Hansen <[email protected]>
    Signed-off-by: Jann Horn <[email protected]>
    Signed-off-by: Dave Hansen <[email protected]>
    Acked-by: Oscar Salvador <[email protected]>
    Acked-by: David Hildenbrand <[email protected]>
    Tested-by: Vitaly Chikunov <[email protected]>
    Cc:[email protected]
    Link: https://lore.kernel.org/all/20250702-x86-2level-hugetlb-v2-1-1a98096edf92%40google.com
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
x86/rdrand: Disable RDSEED on AMD Cyan Skillfish [+ + +]
Author: Mikhail Paulyshka <[email protected]>
Date:   Sat May 24 17:53:19 2025 +0300

    x86/rdrand: Disable RDSEED on AMD Cyan Skillfish
    
    commit 5b937a1ed64ebeba8876e398110a5790ad77407c upstream.
    
    AMD Cyan Skillfish (Family 17h, Model 47h, Stepping 0h) has an error that
    causes RDSEED to always return 0xffffffff, while RDRAND works correctly.
    
    Mask the RDSEED cap for this CPU so that both /proc/cpuinfo and direct CPUID
    read report RDSEED as unavailable.
    
      [ bp: Move to amd.c, massage. ]
    
    Signed-off-by: Mikhail Paulyshka <[email protected]>
    Signed-off-by: Borislav Petkov (AMD) <[email protected]>
    Cc: <[email protected]>
    Link: https://lore.kernel.org/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>