linux-brain/fs/hostfs
Al Viro e472f6814c 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:24:14 +02:00
..
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
hostfs.h hostfs: fix mismatch between link_file definition and declaration 2019-05-07 23:18:28 +02:00
hostfs_kern.c hostfs: fix memory handling in follow_link() 2021-04-14 08:24:14 +02:00
hostfs_user.c hostfs: rename do_rmdir() to hostfs_do_rmdir() 2018-04-02 20:15:53 +02:00