Goldwyn Rodrigues 022ed023c8 btrfs: allocate btrfs_ioctl_defrag_range_args on stack
commit c853a5783ebe123847886d432354931874367292 upstream.

Instead of using kmalloc() to allocate btrfs_ioctl_defrag_range_args,
allocate btrfs_ioctl_defrag_range_args on stack, the size is reasonably
small and ioctls are called in process context.

sizeof(btrfs_ioctl_defrag_range_args) = 48

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
[ This patch is needed to fix a memory leak of "range" that was
introduced when commit 173431b274a9 ("btrfs: defrag: reject unknown
flags of btrfs_ioctl_defrag_range_args") was backported to kernels
lacking this patch. Now with these two patches applied in reverse order,
range->flags needed to change back to range.flags.
This bug was discovered and resolved using Coverity Static Analysis
Security Testing (SAST) by Synopsys, Inc.]
Signed-off-by: Maximilian Heyne <mheyne@amazon.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-13 12:50:09 +02:00
..
2019-08-06 19:06:51 +02:00
2021-09-22 11:48:02 +02:00
2024-04-13 12:50:05 +02:00
2023-11-28 16:46:32 +00:00
2023-09-23 10:48:12 +02:00
2023-09-23 10:48:17 +02:00
2022-06-14 16:59:24 +02:00
2023-01-18 11:30:40 +01:00
2021-12-14 10:18:07 +01:00