linux_dsm_epyc7002/fs/hostfs
Al Viro e5a3449ce1 hostfs: fix memory handling in follow_link()
[ Upstream commit 7f6c411c9b50cfab41cc798e003eff27608c7016 ]

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: 52b209f7b8 ("get rid of hostfs_read_inode()")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-04-14 08:42:06 +02:00
..
hostfs_kern.c hostfs: fix memory handling in follow_link() 2021-04-14 08:42:06 +02:00
hostfs_user.c hostfs: rename do_rmdir() to hostfs_do_rmdir() 2018-04-02 20:15:53 +02:00
hostfs.h hostfs: pass 64-bit timestamps to/from user space 2019-12-18 18:07:32 +01:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00