diff options
author | yonghua zheng <younghua.zheng@gmail.com> | 2013-08-14 01:01:03 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-08-14 02:57:50 +0200 |
commit | 8c8296223f3abb142be8fc31711b18a704c0e7d8 (patch) | |
tree | 1de036ad6669fc8c4b9ce45eea00d514e4261944 /arch/x86 | |
parent | arch: *: Kconfig: add "kernel/Kconfig.freezer" to "arch/*/Kconfig" (diff) | |
download | linux-8c8296223f3abb142be8fc31711b18a704c0e7d8.tar.xz linux-8c8296223f3abb142be8fc31711b18a704c0e7d8.zip |
fs/proc/task_mmu.c: fix buffer overflow in add_page_map()
Recently we met quite a lot of random kernel panic issues after enabling
CONFIG_PROC_PAGE_MONITOR. After debuggind we found this has something
to do with following bug in pagemap:
In struct pagemapread:
struct pagemapread {
int pos, len;
pagemap_entry_t *buffer;
bool v2;
};
pos is number of PM_ENTRY_BYTES in buffer, but len is the size of
buffer, it is a mistake to compare pos and len in add_page_map() for
checking buffer is full or not, and this can lead to buffer overflow and
random kernel panic issue.
Correct len to be total number of PM_ENTRY_BYTES in buffer.
[akpm@linux-foundation.org: document pagemapread.pos and .len units, fix PM_ENTRY_BYTES definition]
Signed-off-by: Yonghua Zheng <younghua.zheng@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86')
0 files changed, 0 insertions, 0 deletions