[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2024032957-muppet-scabby-e708@gregkh>
Date: Fri, 29 Mar 2024 13:16:05 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: David Sterba <dsterba@...e.cz>
Cc: Maximilian Heyne <mheyne@...zon.de>,
Goldwyn Rodrigues <rgoldwyn@...e.com>,
Anand Jain <anand.jain@...cle.com>, David Sterba <dsterba@...e.com>,
stable@...r.kernel.org, Chris Mason <clm@...com>,
Josef Bacik <josef@...icpanda.com>, linux-btrfs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] btrfs: allocate btrfs_ioctl_defrag_range_args on stack
On Wed, Mar 20, 2024 at 05:14:33PM +0100, David Sterba wrote:
> On Wed, Mar 20, 2024 at 11:31:56AM +0000, Maximilian Heyne wrote:
> > From: Goldwyn Rodrigues <rgoldwyn@...e.com>
> >
> > 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@...cle.com>
> > Signed-off-by: Goldwyn Rodrigues <rgoldwyn@...e.com>
> > Reviewed-by: David Sterba <dsterba@...e.com>
> > Signed-off-by: David Sterba <dsterba@...e.com>
> > CC: stable@...r.kernel.org # 4.14+
> > [ 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@...zon.de>
>
> Acked-by: David Sterba <dsterba@...e.com>
>
> for backport to stable as a prerequisite for 173431b274a9a5 ("btrfs:
> defrag: reject unknown flags of btrfs_ioctl_defrag_range_args").
>
Now queued up, thanks!
greg k-h
Powered by blists - more mailing lists