vfs: read file_handle only once in handle_to_path
This patch was related with "[CVE-2015-1420] Race condition in fs/fhandle.c in the Linux kernel".
We used to read file_handle twice. Once to get the amount of extra bytes, and
once to fetch the entire structure.
This may be problematic since we do size verifications only after the first
read, so if the number of extra bytes changes in userspace between the first
and second calls, we'll have an incoherent view of file_handle.
Instead, read the constant size once, and copy that over to the final
structure without having to re-read it again.
Change-Id: I318d7428079e323f53bc7eb1f7dc0a5dfac7eb0b
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Byungsoo Kim <bs1770.kim@samsung.com>
Signed-off-by: sungmin ha <sungmin82.ha@samsung.com>