Re: [PATCH] btrfs: fix uninit pointer free on read_alloc_one_name error

From: David Sterba
Date: Fri Oct 11 2024 - 12:10:09 EST


On Thu, Oct 10, 2024 at 09:47:17PM +0200, Roi Martin wrote:
> The read_alloc_one_name function does not initialize the name field of
> the passed fscrypt_str struct if kmalloc fails to allocate the
> corresponding buffer. Thus, it is not guaranteed that
> fscrypt_str.name is initialized when freeing it.
>
> This is a follow-up to the linked patch that fixes the remaining
> instances of the bug introduced by commit e43eec81c516 ("btrfs: use
> struct qstr instead of name and namelen pairs").
>
> Link: https://lore.kernel.org/linux-btrfs/20241009080833.1355894-1-jroi.martin@xxxxxxxxx/
> Fixes: e43eec81c516 ("btrfs: use struct qstr instead of name and namelen pairs")
> Signed-off-by: Roi Martin <jroi.martin@xxxxxxxxx>

Added to for-next, thanks.