projects
/
linux-2.6-block.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mm/memunmap: don't access uninitialized memmap in memunmap_pages()
[linux-2.6-block.git]
/
fs
/
proc
/
page.c
diff --git
a/fs/proc/page.c
b/fs/proc/page.c
index 544d1ee15aeece96efa3e5b39a9481c879584419..7c952ee732e63dffd0ae09f92a6ec3e6c57e5771 100644
(file)
--- a/
fs/proc/page.c
+++ b/
fs/proc/page.c
@@
-42,10
+42,12
@@
static ssize_t kpagecount_read(struct file *file, char __user *buf,
return -EINVAL;
while (count > 0) {
return -EINVAL;
while (count > 0) {
- if (pfn_valid(pfn))
- ppage = pfn_to_page(pfn);
- else
- ppage = NULL;
+ /*
+ * TODO: ZONE_DEVICE support requires to identify
+ * memmaps that were actually initialized.
+ */
+ ppage = pfn_to_online_page(pfn);
+
if (!ppage || PageSlab(ppage) || page_has_type(ppage))
pcount = 0;
else
if (!ppage || PageSlab(ppage) || page_has_type(ppage))
pcount = 0;
else
@@
-216,10
+218,11
@@
static ssize_t kpageflags_read(struct file *file, char __user *buf,
return -EINVAL;
while (count > 0) {
return -EINVAL;
while (count > 0) {
- if (pfn_valid(pfn))
- ppage = pfn_to_page(pfn);
- else
- ppage = NULL;
+ /*
+ * TODO: ZONE_DEVICE support requires to identify
+ * memmaps that were actually initialized.
+ */
+ ppage = pfn_to_online_page(pfn);
if (put_user(stable_page_flags(ppage), out)) {
ret = -EFAULT;
if (put_user(stable_page_flags(ppage), out)) {
ret = -EFAULT;
@@
-261,10
+264,11
@@
static ssize_t kpagecgroup_read(struct file *file, char __user *buf,
return -EINVAL;
while (count > 0) {
return -EINVAL;
while (count > 0) {
- if (pfn_valid(pfn))
- ppage = pfn_to_page(pfn);
- else
- ppage = NULL;
+ /*
+ * TODO: ZONE_DEVICE support requires to identify
+ * memmaps that were actually initialized.
+ */
+ ppage = pfn_to_online_page(pfn);
if (ppage)
ino = page_cgroup_ino(ppage);
if (ppage)
ino = page_cgroup_ino(ppage);