]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
udf: Allocate name buffer in directory iterator on heap
authorJan Kara <jack@suse.cz>
Tue, 20 Dec 2022 11:38:45 +0000 (12:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Nov 2024 14:06:26 +0000 (15:06 +0100)
commit5ea4b73e268bf9e1d26271943f2f7c4517253395
tree2c125323f14d3f71f2478d61d5037102557c8828
parenta5ee9fe48fa51a79620b041b27a94a05e7ac75a0
udf: Allocate name buffer in directory iterator on heap

commit 0aba4860b0d0216a1a300484ff536171894d49d8 upstream.

Currently we allocate name buffer in directory iterators (struct
udf_fileident_iter) on stack. These structures are relatively large
(some 360 bytes on 64-bit architectures). For udf_rename() which needs
to keep three of these structures in parallel the stack usage becomes
rather heavy - 1536 bytes in total. Allocate the name buffer in the
iterator from heap to avoid excessive stack usage.

Link: https://lore.kernel.org/all/202212200558.lK9x1KW0-lkp@intel.com
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
[Add extra include linux/slab.h]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/udf/directory.c
fs/udf/udfdecl.h