From: David Sterba <dsterba@suse.cz>
To: Maximilian Heyne <mheyne@amazon.de>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>,
Anand Jain <anand.jain@oracle.com>,
David Sterba <dsterba@suse.com>,
stable@vger.kernel.org, Chris Mason <clm@fb.com>,
Josef Bacik <josef@toxicpanda.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: allocate btrfs_ioctl_defrag_range_args on stack
Date: Wed, 20 Mar 2024 17:14:33 +0100 [thread overview]
Message-ID: <20240320161433.GF14596@suse.cz> (raw)
In-Reply-To: <20240320113156.22283-1-mheyne@amazon.de>
On Wed, Mar 20, 2024 at 11:31:56AM +0000, Maximilian Heyne wrote:
> From: Goldwyn Rodrigues <rgoldwyn@suse.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@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>
> CC: stable@vger.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@amazon.de>
Acked-by: David Sterba <dsterba@suse.com>
for backport to stable as a prerequisite for 173431b274a9a5 ("btrfs:
defrag: reject unknown flags of btrfs_ioctl_defrag_range_args").
next prev parent reply other threads:[~2024-03-20 16:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-20 11:31 [PATCH] btrfs: allocate btrfs_ioctl_defrag_range_args on stack Maximilian Heyne
2024-03-20 16:14 ` David Sterba [this message]
2024-03-29 12:16 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240320161433.GF14596@suse.cz \
--to=dsterba@suse.cz \
--cc=anand.jain@oracle.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mheyne@amazon.de \
--cc=rgoldwyn@suse.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).