[lkml]   [2013]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [GIT PULL] Revert "dlm: check the maximum size of a request from user"
On Mon, Feb 04, 2013 at 12:06:55PM -0500, David Teigland wrote:
> Please pull the following fix from branch:
> git:// for-linus
> This reverts commit 2b75bc9121e54e22537207b47b71373bcb0be41c.

Hi Linus,

You can choose to pull that revert, or you can alternatively pull this fix
to the original patch from this branch:

git:// fix-max-write

Thanks to Jana who reported the problem and was able to test this fix so

Subject: [PATCH] dlm: check the write size from user

Return EINVAL from write if the size is larger than
allowed. Do this before allocating kernel memory for
the bogus size, which could lead to OOM.

Reported-by: Sasha Levin <>
Tested-by: Jana Saout <>
Signed-off-by: David Teigland <>
fs/dlm/user.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 7ff4985..911649a 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -503,11 +503,11 @@ static ssize_t device_write(struct file *file, const char __user *buf,
return -EINVAL;

- if (count > sizeof(struct dlm_write_request32) + DLM_RESNAME_MAXLEN)
+ /*
+ * can't compare against COMPAT/dlm_write_request32 because
+ * we don't yet know if is64bit is zero
+ */
if (count > sizeof(struct dlm_write_request) + DLM_RESNAME_MAXLEN)
return -EINVAL;

kbuf = kzalloc(count + 1, GFP_NOFS);

 \ /
  Last update: 2013-02-04 23:43    [W:0.041 / U:26.916 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site