Skip to contentSkip to conversation

fs/dlm: Fix kernel memory disclosure

PATCH New Vlad Tsyrklevich 3 participants 3 messages Feb 22, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 fs/dlm: Fix kernel memory disclosure

Hello, I wanted to ping the list and see if this could get a review:

Quoted 21 lines

Clear the 'unused' field and the uninitialized padding in 'lksb' to avoid leaking memory to userland in copy_result_to_user().

---
 fs/dlm/user.c | 2 ++
 1 file changed, 2 insertions(+)
fs/dlm/user.c +2 -0
index 1ce908c..83ddd47 100644
@@ -122,6 +122,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];
#1 lore raw

PATCH v2 1/1 fs/dlm: Fix kernel memory disclosure

Hi,

Quoted 1 line · Vlad Tsyrklevich

Hello, I wanted to ping the list and see if this could get a review:

It looks good to me,

Steve.

Quoted 21 lines
Quoted 21 lines

Clear the 'unused' field and the uninitialized padding in 'lksb' to avoid leaking memory to userland in copy_result_to_user().

---
  fs/dlm/user.c | 2 ++
  1 file changed, 2 insertions(+)
fs/dlm/user.c +2 -0
index 1ce908c..83ddd47 100644
@@ -122,6 +122,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];
#2 lore raw

PATCH v2 1/1 fs/dlm: Fix kernel memory disclosure

In reply to Vlad Tsyrklevich
Quoted 1 line · Vlad Tsyrklevich

Hello, I wanted to ping the list and see if this could get a review:

now pushed to linux-dlm.git

Quoted 21 lines
Quoted 21 lines

Clear the 'unused' field and the uninitialized padding in 'lksb' to avoid leaking memory to userland in copy_result_to_user().

---
 fs/dlm/user.c | 2 ++
 1 file changed, 2 insertions(+)
fs/dlm/user.c +2 -0
index 1ce908c..83ddd47 100644
@@ -122,6 +122,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];