]> git.baikalelectronics.ru Git - kernel.git/commit
dlm: check the maximum size of a request from user
authorSasha Levin <levinsasha928@gmail.com>
Sun, 9 Sep 2012 14:16:58 +0000 (16:16 +0200)
committerDavid Teigland <teigland@redhat.com>
Mon, 10 Sep 2012 14:50:27 +0000 (09:50 -0500)
commit3e1645f7398e3b2e9ede6b9c8a4953939168831b
tree1b2778a163dedd71cd968b3b4e1d2049b5a86319
parent7e81690ce112332d8da52fd149bf96f89ede727a
dlm: check the maximum size of a request from user

device_write only checks whether the request size is big enough, but it doesn't
check if the size is too big.

At that point, it also tries to allocate as much memory as the user has requested
even if it's too much. This can lead to OOM killer kicking in, or memory corruption
if (count + 1) overflows.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/user.c