aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorAdrian Huang (Lenovo) <[email protected]>2025-08-18 13:43:10 +0000
committerChristian Brauner <[email protected]>2025-08-19 11:51:28 +0000
commita2c1f82618b0b65f1ef615aa9cfdac8122537d69 (patch)
treebb25211a18395b90a1dd80695d0a14550047d283 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parentkernfs: don't fail listing extended attributes (diff)
downloadkernel-a2c1f82618b0b65f1ef615aa9cfdac8122537d69.tar.gz
kernel-a2c1f82618b0b65f1ef615aa9cfdac8122537d69.zip
signal: Fix memory leak for PIDFD_SELF* sentinels
Commit f08d0c3a7111 ("pidfd: add PIDFD_SELF* sentinels to refer to own thread/process") introduced a leak by acquiring a pid reference through get_task_pid(), which increments pid->count but never drops it with put_pid(). As a result, kmemleak reports unreferenced pid objects after running tools/testing/selftests/pidfd/pidfd_test, for example: unreferenced object 0xff1100206757a940 (size 160): comm "pidfd_test", pid 16965, jiffies 4294853028 hex dump (first 32 bytes): 01 00 00 00 00 00 00 00 00 00 00 00 fd 57 50 04 .............WP. 5e 44 00 00 00 00 00 00 18 de 34 17 01 00 11 ff ^D........4..... backtrace (crc cd8844d4): kmem_cache_alloc_noprof+0x2f4/0x3f0 alloc_pid+0x54/0x3d0 copy_process+0xd58/0x1740 kernel_clone+0x99/0x3b0 __do_sys_clone3+0xbe/0x100 do_syscall_64+0x7b/0x2c0 entry_SYSCALL_64_after_hwframe+0x76/0x7e Fix this by calling put_pid() after do_pidfd_send_signal() returns. Fixes: f08d0c3a7111 ("pidfd: add PIDFD_SELF* sentinels to refer to own thread/process") Signed-off-by: Adrian Huang (Lenovo) <[email protected]> Link: https://lore.kernel.org/[email protected] Tested-by: Lorenzo Stoakes <[email protected]> Reviewed-by: Lorenzo Stoakes <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
0 files changed, 0 insertions, 0 deletions