mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
getname_kernel() needs to make sure that ->name != ->iname in long case
commit 30ce4d1903 upstream.
missed it in "kill struct filename.separate" several years ago.
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
93da190b72
commit
5da4880c98
@@ -219,9 +219,10 @@ getname_kernel(const char * filename)
|
||||
if (len <= EMBEDDED_NAME_MAX) {
|
||||
result->name = (char *)result->iname;
|
||||
} else if (len <= PATH_MAX) {
|
||||
const size_t size = offsetof(struct filename, iname[1]);
|
||||
struct filename *tmp;
|
||||
|
||||
tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
|
||||
tmp = kmalloc(size, GFP_KERNEL);
|
||||
if (unlikely(!tmp)) {
|
||||
__putname(result);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
Reference in New Issue
Block a user