Home
last modified time | relevance | path

Searched hist:"7 f6c411c" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/fs/hostfs/
H A Dhostfs_kern.c7f6c411c Thu Mar 25 13:12:34 CDT 2021 Al Viro <viro@zeniv.linux.org.uk> hostfs: fix memory handling in follow_link()

1) argument should not be freed in any case - the caller already has
it as ->s_fs_info (and uses it a lot afterwards)
2) allocate readlink buffer with kmalloc() - the caller has no way
to tell if it's got that (on absolute symlink) or a result of
kasprintf(). Sure, for SLAB and SLUB kfree() works on results of
kmem_cache_alloc(), but that's not documented anywhere, might change
in the future *and* is already not true for SLOB.

Fixes: 52b209f7b848 ("get rid of hostfs_read_inode()")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>