From: Vlad Tsyrklevich Date: Wed, 22 Feb 2017 21:31:45 +0000 (-0600) Subject: dlm: Fix kernel memory disclosure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8286d6b14c7c0e2c52d565a8727f6028a487fcf0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git dlm: Fix kernel memory disclosure Clear the 'unused' field and the uninitialized padding in 'lksb' to avoid leaking memory to userland in copy_result_to_user(). Signed-off-by: Vlad Tsyrklevich Signed-off-by: David Teigland --- diff --git a/fs/dlm/user.c b/fs/dlm/user.c index 23488f559cf9..322a6bcd70a2 100644 --- a/fs/dlm/user.c +++ b/fs/dlm/user.c @@ -123,6 +123,8 @@ static void compat_input(struct dlm_write_request *kb, static void compat_output(struct dlm_lock_result *res, struct dlm_lock_result32 *res32) { + memset(res32, 0, sizeof(*res32)); + res32->version[0] = res->version[0]; res32->version[1] = res->version[1]; res32->version[2] = res->version[2];