Commit 44c9dc8e authored by Ma Wupeng's avatar Ma Wupeng Committed by Wupeng Ma
Browse files

mm/mlock: return EINVAL for illegal user memory range in mlock

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9C0QZ



--------------------------------

While testing mlock, we have a problem if the len of mlock is ULONG_MAX.
The return value of mlock is zero. But nothing will be locked since the
len in do_mlock overflows to zero due to the following code in mlock:

  len = PAGE_ALIGN(len + (offset_in_page(start)));

The same problem happens in munlock.

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
parent 55d14eb3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment